## Problem Description and Formulation

The city planner has 120 acres of land and 2000 units of resources. The goal is to maximize savings by deciding how many acres to allocate to solar panels and windmills. The requirements and savings per acre for each are as follows:

- Solar Panels: 20 units of resources per acre, $500 savings per acre
- Windmills: 40 units of resources per acre, $1000 savings per acre

## Mathematical Formulation

Let \(x\) be the number of acres for solar panels and \(y\) be the number of acres for windmills. The problem can be formulated as:

Maximize: \(500x + 1000y\)

Subject to:
1. \(x + y \leq 120\) (land constraint)
2. \(20x + 40y \leq 2000\) (resource constraint)
3. \(x \geq 0, y \geq 0\) (non-negativity constraint)

## Gurobi Code

```python
import gurobi

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

    # Define variables
    x = model.addVar(lb=0, name="solar_panels_acres")
    y = model.addVar(lb=0, name="windmills_acres")

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

    # Constraints
    model.addConstr(x + y <= 120, name="land_constraint")
    model.addConstr(20*x + 40*y <= 2000, name="resource_constraint")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal acres for solar panels: {x.varValue}")
        print(f"Optimal acres for windmills: {y.varValue}")
        print(f"Max savings: ${model.objVal}")
    else:
        print("The problem is infeasible")

solve_optimization_problem()
```