## Problem Description and Formulation

The problem is a linear programming optimization problem. We have two types of sodas, Soda 1 and Soda 2, with different amounts of caffeine and sugar per can. The goal is to minimize the cost of buying cans of soda while meeting the requirements of at least 50 units of caffeine and 40 units of sugar.

Let's define the decision variables:
- \(x_1\): The number of cans of Soda 1 to buy.
- \(x_2\): The number of cans of Soda 2 to buy.

The constraints based on the requirements are:
- Caffeine: \(3x_1 + 2x_2 \geq 50\)
- Sugar: \(2x_1 + 5x_2 \geq 40\)

The objective function to minimize the cost is:
- Cost: \(5x_1 + 7x_2\)

Since we cannot buy a negative number of cans, we also have:
- \(x_1 \geq 0\)
- \(x_2 \geq 0\)

And because we are dealing with cans of soda, \(x_1\) and \(x_2\) should be integers.

## Gurobi Code

```python
import gurobi

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

    # Define the variables
    x1 = model.addVar(name="Soda1", vtype=gurobi.GRB.INTEGER, lb=0)
    x2 = model.addVar(name="Soda2", vtype=gurobi.GRB.INTEGER, lb=0)

    # Objective function: Minimize cost
    model.setObjective(5 * x1 + 7 * x2, gurobi.GRB.MINIMIZE)

    # Constraints
    model.addConstr(3 * x1 + 2 * x2 >= 50, name="Caffeine_Requirement")
    model.addConstr(2 * x1 + 5 * x2 >= 40, name="Sugar_Requirement")

    # Solve the model
    model.optimize()

    # Check if the model is optimized
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: Soda 1 = {x1.varValue}, Soda 2 = {x2.varValue}")
        print(f"Minimum cost: {model.objVal}")
    elif model.status == gurobi.GRB.INFEASIBLE:
        print("The model is infeasible")
    else:
        print("The model has a non-optimal status")

solve_soda_problem()
```