## Problem Description and Formulation

The bodybuilder needs to purchase protein bars to meet his nutritional requirements while minimizing cost. The requirements are:

- Minimum of 80 grams of protein
- Minimum of 50 grams of fat
- Minimum of 100 grams of carbs

There are two types of protein bars available:

- **Protein Bar A**: 10g protein, 3g fat, 11g carbs, and costs $7
- **Protein Bar B**: 15g protein, 5g fat, 8g carbs, and costs $10

Let's denote the number of Protein Bar A to be purchased as \(x\) and the number of Protein Bar B as \(y\).

## Mathematical Formulation

The objective is to minimize the total cost: \(7x + 10y\)

Subject to the constraints:

1. Protein: \(10x + 15y \geq 80\)
2. Fat: \(3x + 5y \geq 50\)
3. Carbs: \(11x + 8y \geq 100\)
4. Non-negativity: \(x \geq 0, y \geq 0\)
5. Integer constraints: \(x\) and \(y\) must be integers since they represent the number of protein bars.

## Gurobi Code

```python
import gurobi

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

    # Define variables
    x = model.addVar(name="Protein_Bar_A", vtype=gurobi.GRB.INTEGER, lb=0)
    y = model.addVar(name="Protein_Bar_B", vtype=gurobi.GRB.INTEGER, lb=0)

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

    # Constraints
    model.addConstr(10*x + 15*y >= 80, name="protein_requirement")
    model.addConstr(3*x + 5*y >= 50, name="fat_requirement")
    model.addConstr(11*x + 8*y >= 100, name="carbs_requirement")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal cost: ${model.objval}")
        print(f"Buy {x.varValue} of Protein Bar A and {y.varValue} of Protein Bar B")
    else:
        print("No optimal solution found")

solve_protein_bar_problem()
```