## Problem Description and Formulation

The problem is a linear programming optimization problem. Thomas has 50 cows and wants to minimize the cost of feeding them with silage and mixed grains while ensuring they receive the required nutrition.

### Decision Variables

Let $x$ be the amount of silage (in kilograms) per cow per day, and $y$ be the amount of mixed grains (in kilograms) per cow per day.

### Objective Function

The objective is to minimize the total cost of feeding all cows per day. The cost of silage per kilogram is $215, and the cost of mixed grains per kilogram is $320. Therefore, the objective function is:

$$\min 50(215x + 320y)$$

### Constraints

1. **Protein requirement**: Each cow requires at least 2 kilograms of protein per day. Since each kilogram of silage contains 0.5 kilograms of protein and each kilogram of mixed grains contains 0.2 kilograms of protein, we have:

$$0.5x + 0.2y \geq 2$$

2. **Minerals requirement**: Each cow requires at least 1.5 kilograms of minerals per day. Since each kilogram of silage contains 0.1 kilograms of minerals and each kilogram of mixed grains contains 0.2 kilograms of minerals, we have:

$$0.1x + 0.2y \geq 1.5$$

3. **Vitamins limit**: Each cow can have at most 1.0 kilograms of vitamins per day. Since each kilogram of silage contains 0.2 kilograms of vitamins and each kilogram of mixed grains contains 0.1 kilograms of vitamins, we have:

$$0.2x + 0.1y \leq 1.0$$

4. **Non-negativity**: The amounts of silage and mixed grains cannot be negative:

$$x \geq 0, y \geq 0$$

## Gurobi Code

```python
import gurobi

def solve_feeding_problem():
    # Create a new Gurobi model
    model = gurobi.Model()

    # Decision variables
    x = model.addVar(name="silage", lb=0, ub=gurobi.GRB.INFINITY)
    y = model.addVar(name="mixed_grains", lb=0, ub=gurobi.GRB.INFINITY)

    # Objective function: minimize cost
    model.setObjective(215 * x + 320 * y, gurobi.GRB.MINIMIZE)

    # Constraints
    model.addConstr(0.5 * x + 0.2 * y >= 2, name="protein_requirement")
    model.addConstr(0.1 * x + 0.2 * y >= 1.5, name="minerals_requirement")
    model.addConstr(0.2 * x + 0.1 * y <= 1.0, name="vitamins_limit")

    # Solve the problem for one cow
    model.optimize()

    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal solution found.")
        silage_per_cow = x.varValue
        mixed_grains_per_cow = y.varValue
        cost_per_cow = 215 * silage_per_cow + 320 * mixed_grains_per_cow
        total_cost = 50 * cost_per_cow  # For 50 cows
        print(f"Silage per cow: {silage_per_cow:.2f} kg")
        print(f"Mixed grains per cow: {mixed_grains_per_cow:.2f} kg")
        print(f"Cost per cow: ${cost_per_cow:.2f}")
        print(f"Total cost for 50 cows: ${total_cost:.2f}")
    else:
        print("No optimal solution found.")

solve_feeding_problem()
```