## Problem Description and Formulation

The problem is a linear programming optimization problem. Jason has $1,000,000 to invest in four energy sectors: solar, wind, nuclear, and coal, with annual rates of return of 6%, 9%, 12%, and 3%, respectively. The investment is subject to the following conditions:

1. The amount invested in coal cannot exceed the amount invested in solar.
2. The amount invested in wind cannot exceed the amount invested in nuclear.
3. At most 10% of the investment can be in coal.

The goal is to maximize the total return on investment.

## Mathematical Formulation

Let \(S\), \(W\), \(N\), and \(C\) be the amounts invested in solar, wind, nuclear, and coal, respectively. The problem can be formulated as:

Maximize: \(0.06S + 0.09W + 0.12N + 0.03C\)

Subject to:

1. \(C \leq S\)
2. \(W \leq N\)
3. \(C \leq 0.10 \times 1,000,000 = 100,000\)
4. \(S + W + N + C \leq 1,000,000\)
5. \(S, W, N, C \geq 0\)

## Gurobi Code

```python
import gurobi

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

    # Define the variables
    S = model.addVar(name="solar", lb=0)
    W = model.addVar(name="wind", lb=0)
    N = model.addVar(name="nuclear", lb=0)
    C = model.addVar(name="coal", lb=0)

    # Objective function: Maximize return
    model.setObjective(0.06 * S + 0.09 * W + 0.12 * N + 0.03 * C, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(C <= S, name="coal_solar_constraint")
    model.addConstr(W <= N, name="wind_nuclear_constraint")
    model.addConstr(C <= 100000, name="coal_limit_constraint")
    model.addConstr(S + W + N + C <= 1000000, name="total_investment_constraint")

    # Solve the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal Solution:")
        print(f"Solar: ${S.varValue:.2f}")
        print(f"Wind: ${W.varValue:.2f}")
        print(f"Nuclear: ${N.varValue:.2f}")
        print(f"Coal: ${C.varValue:.2f}")
        print(f"Max Return: ${model.objVal:.2f}")
    else:
        print("No optimal solution found.")

solve_investment_problem()
```