Here's the formulation of the linear program and the Gurobi code to solve it:

**Decision Variables:**

* `x`: Investment in solar energy (in dollars)
* `y`: Investment in wind energy (in dollars)

**Objective Function:**

Maximize return:  `0.06x + 0.05y`

**Constraints:**

* **Total Investment:** `x + y <= 50000`
* **Wind Investment Proportion:** `y >= 0.7 * 50000`  (y >= 35000)
* **Solar Investment Proportion:** `x <= 0.2 * 50000`  (x <= 10000)
* **Non-negativity:** `x >= 0`,  `y >= 0`


```python
import gurobipy as gp
from gurobipy import GRB

# Create a new model
m = gp.Model("Investment_Optimization")

# Create decision variables
x = m.addVar(lb=0, name="solar_investment")
y = m.addVar(lb=0, name="wind_investment")

# Set objective function
m.setObjective(0.06 * x + 0.05 * y, GRB.MAXIMIZE)

# Add constraints
m.addConstr(x + y <= 50000, "total_investment")
m.addConstr(y >= 0.7 * 50000, "min_wind_investment")
m.addConstr(x <= 0.2 * 50000, "max_solar_investment")


# Optimize model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print(f"Optimal investment in solar: ${x.x}")
    print(f"Optimal investment in wind: ${y.x}")
    print(f"Optimal total return: ${m.objVal}")
elif m.status == GRB.INFEASIBLE:
    print("The model is infeasible.")
else:
    print(f"Optimization terminated with status {m.status}")

```
