## Problem Description and Formulation

The syrup factory produces two types of syrup: chocolate and caramel. The goal is to maximize profit given certain constraints.

### Decision Variables
- Let \(x\) be the tons of chocolate syrup produced per week.
- Let \(y\) be the tons of caramel syrup produced per week.

### Objective Function
The profit per ton of chocolate syrup is $500, and the profit per ton of caramel syrup is $350. The objective function to maximize profit (\(P\)) is:
\[ P = 500x + 350y \]

### Constraints
1. **Production Limits**: The factory can make at most 15 tons of each syrup per week.
\[ x \leq 15 \]
\[ y \leq 15 \]

2. **Minimum Production Requirements**: They must make at least 2 tons of chocolate syrup and at least 3 tons of caramel syrup per week.
\[ x \geq 2 \]
\[ y \geq 3 \]

3. **Heating Machine Availability**: Each ton of syrup requires 3 hours on the heating machine, which is available for at most 50 hours per week.
\[ 3x + 3y \leq 50 \]

### Non-Negativity Constraints
Since production cannot be negative:
\[ x \geq 0 \]
\[ y \geq 0 \]

However, these are already implied by the minimum production requirements.

## Gurobi Code

```python
import gurobi

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

    # Define variables
    x = model.addVar(lb=2, ub=15, name="chocolate_syrup")  # tons of chocolate syrup
    y = model.addVar(lb=3, ub=15, name="caramel_syrup")  # tons of caramel syrup

    # Objective function: Maximize profit
    model.setObjective(500 * x + 350 * y, gurobi.GRB.MAXIMIZE)

    # Heating machine constraint
    model.addConstr(3 * x + 3 * y <= 50, name="heating_machine_constraint")

    # Solve the model
    model.optimize()

    # Check if the model is optimized
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal production levels: Chocolate syrup = {x.varValue} tons, Caramel syrup = {y.varValue} tons")
        print(f"Maximum profit: ${model.objVal}")
    else:
        print("The model is infeasible.")

# Run the function
solve_syrup_factory_problem()
```

This code defines the optimization problem using Gurobi's Python interface, sets up the objective function and constraints according to the problem description, and solves the model to find the optimal production levels of chocolate and caramel syrup that maximize profit.