## Problem Description and Formulation

The gardener has 30 acres to grow peas and beans. The goal is to maximize profit given the constraints on bug-spray and care-taking hours.

Let's define the decision variables:
- \(P\): acres of peas
- \(B\): acres of beans

The objective function to maximize profit is:
\[ \text{Maximize:} \quad 100P + 160B \]

The constraints are:
1. Total acres: \( P + B \leq 30 \)
2. Bug-spray budget: \( 30P + 50B \leq 1300 \)
3. Care-taking hours: \( 2P + 1.5B \leq 50 \)
4. Non-negativity: \( P \geq 0, B \geq 0 \)

## Gurobi Code

```python
import gurobi

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

    # Define the decision variables
    P = model.addVar(lb=0, name="P")  # acres of peas
    B = model.addVar(lb=0, name="B")  # acres of beans

    # Objective function: Maximize profit
    model.setObjective(100 * P + 160 * B, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(P + B <= 30, name="total_acres")
    model.addConstr(30 * P + 50 * B <= 1300, name="bug_spray_budget")
    model.addConstr(2 * P + 1.5 * B <= 50, name="care_taking_hours")

    # Optimize the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal acres of peas: {P.varValue}")
        print(f"Optimal acres of beans: {B.varValue}")
        print(f"Maximal profit: {model.objVal}")
    else:
        print("The model is infeasible.")

if __name__ == "__main__":
    solve_gardener_problem()
```