Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,7 +130,7 @@ def optimize_energy_system(city_code, solar_cost, onshore_wind_cost, offshore_wi
|
|
| 130 |
battery_discharge_values = [battery_discharge[t].varValue for t in time_steps]
|
| 131 |
battery_charge_values = [-battery_charge[t].varValue for t in time_steps]
|
| 132 |
SOC_values = [SOC[t].varValue for t in time_steps]
|
| 133 |
-
curtailment_values = [curtailment[(r, t)].varValue for r in regions for t in time_steps]
|
| 134 |
|
| 135 |
# Calculate price per hour based on demand and generation (simplified example)
|
| 136 |
price_per_hour = [100 + 0.05 * demand[t] for t in time_steps]
|
|
@@ -148,7 +148,7 @@ def optimize_energy_system(city_code, solar_cost, onshore_wind_cost, offshore_wi
|
|
| 148 |
fig_energy.add_trace(go.Scatter(x=data['Time'], y=battery_discharge_values, mode='lines', stackgroup='one', name='Battery Discharge', fill='tonexty', line=dict(color='#6A3D9A', width=0)))
|
| 149 |
fig_energy.add_trace(go.Scatter(x=data['Time'], y=battery_charge_values, mode='lines', stackgroup='two', name='Battery Charge', fill='tonexty', line=dict(color='#6A3D9A', width=0)))
|
| 150 |
fig_energy.add_trace(go.Scatter(x=data['Time'], y=-demand, mode='lines', stackgroup='two', name='Demand', line=dict(color='black', width=0)))
|
| 151 |
-
fig_energy.add_trace(go.Scatter(x=data['Time'], y
|
| 152 |
|
| 153 |
# Layout settings for energy dispatch plot
|
| 154 |
fig_energy.update_layout(
|
|
|
|
| 130 |
battery_discharge_values = [battery_discharge[t].varValue for t in time_steps]
|
| 131 |
battery_charge_values = [-battery_charge[t].varValue for t in time_steps]
|
| 132 |
SOC_values = [SOC[t].varValue for t in time_steps]
|
| 133 |
+
curtailment_values = [-curtailment[(r, t)].varValue for r in regions for t in time_steps]
|
| 134 |
|
| 135 |
# Calculate price per hour based on demand and generation (simplified example)
|
| 136 |
price_per_hour = [100 + 0.05 * demand[t] for t in time_steps]
|
|
|
|
| 148 |
fig_energy.add_trace(go.Scatter(x=data['Time'], y=battery_discharge_values, mode='lines', stackgroup='one', name='Battery Discharge', fill='tonexty', line=dict(color='#6A3D9A', width=0)))
|
| 149 |
fig_energy.add_trace(go.Scatter(x=data['Time'], y=battery_charge_values, mode='lines', stackgroup='two', name='Battery Charge', fill='tonexty', line=dict(color='#6A3D9A', width=0)))
|
| 150 |
fig_energy.add_trace(go.Scatter(x=data['Time'], y=-demand, mode='lines', stackgroup='two', name='Demand', line=dict(color='black', width=0)))
|
| 151 |
+
fig_energy.add_trace(go.Scatter(x=data['Time'], y=curtailment_values, mode='lines', stackgroup='two', name='Curtailment', line=dict(color='#aaaaaa', width=0)))
|
| 152 |
|
| 153 |
# Layout settings for energy dispatch plot
|
| 154 |
fig_energy.update_layout(
|