Spaces:
Sleeping
Sleeping
Daniel Varga commited on
Commit ·
6f735ac
1
Parent(s): 9a842dc
charge of bess visualization working
Browse files
app.py
CHANGED
|
@@ -145,7 +145,6 @@ def simulator_with_solar(all_data, parameters):
|
|
| 145 |
consumption_from_bess = 0
|
| 146 |
consumption_from_network = 0
|
| 147 |
discarded_production = 0
|
| 148 |
-
charge_of_bess = 0
|
| 149 |
|
| 150 |
unsatisfied_demand = demand
|
| 151 |
remaining_production = production
|
|
@@ -191,7 +190,7 @@ def simulator_with_solar(all_data, parameters):
|
|
| 191 |
discharge = min(parameters.bess_discharge, discharge_of_bess)
|
| 192 |
consumption_from_bess = discharge
|
| 193 |
unsatisfied_demand -= consumption_from_bess
|
| 194 |
-
cap_of_battery -=consumption_from_bess * time_interval
|
| 195 |
soc = cap_of_battery / max_cap_of_battery
|
| 196 |
consumption_from_network = unsatisfied_demand
|
| 197 |
unsatisfied_demand = 0
|
|
@@ -224,7 +223,7 @@ def simulator_with_solar(all_data, parameters):
|
|
| 224 |
consumption_from_solar_series.append(consumption_from_solar)
|
| 225 |
consumption_from_network_series.append(consumption_from_network)
|
| 226 |
consumption_from_bess_series.append(consumption_from_bess)
|
| 227 |
-
charge_of_bess_series.append(
|
| 228 |
discarded_production_series.append(discarded_production)
|
| 229 |
|
| 230 |
soc_series = np.array(soc_series)
|
|
@@ -284,6 +283,7 @@ def plotly_visualize_simulation(results, date_range):
|
|
| 284 |
return fig'''
|
| 285 |
|
| 286 |
fig = plotly.subplots.make_subplots(specs=[[{"secondary_y": True}]])
|
|
|
|
| 287 |
|
| 288 |
fig.add_trace(go.Scatter(
|
| 289 |
x=results.index, y=results['consumption_from_network'],
|
|
@@ -313,7 +313,7 @@ def plotly_visualize_simulation(results, date_range):
|
|
| 313 |
x=results.index, y=results['charge_of_bess'],
|
| 314 |
hoverinfo='x+y',
|
| 315 |
mode='lines',
|
| 316 |
-
line=dict(width=
|
| 317 |
name='charge of BESS'),
|
| 318 |
secondary_y=True
|
| 319 |
)
|
|
|
|
| 145 |
consumption_from_bess = 0
|
| 146 |
consumption_from_network = 0
|
| 147 |
discarded_production = 0
|
|
|
|
| 148 |
|
| 149 |
unsatisfied_demand = demand
|
| 150 |
remaining_production = production
|
|
|
|
| 190 |
discharge = min(parameters.bess_discharge, discharge_of_bess)
|
| 191 |
consumption_from_bess = discharge
|
| 192 |
unsatisfied_demand -= consumption_from_bess
|
| 193 |
+
cap_of_battery -= consumption_from_bess * time_interval
|
| 194 |
soc = cap_of_battery / max_cap_of_battery
|
| 195 |
consumption_from_network = unsatisfied_demand
|
| 196 |
unsatisfied_demand = 0
|
|
|
|
| 223 |
consumption_from_solar_series.append(consumption_from_solar)
|
| 224 |
consumption_from_network_series.append(consumption_from_network)
|
| 225 |
consumption_from_bess_series.append(consumption_from_bess)
|
| 226 |
+
charge_of_bess_series.append(soc)
|
| 227 |
discarded_production_series.append(discarded_production)
|
| 228 |
|
| 229 |
soc_series = np.array(soc_series)
|
|
|
|
| 283 |
return fig'''
|
| 284 |
|
| 285 |
fig = plotly.subplots.make_subplots(specs=[[{"secondary_y": True}]])
|
| 286 |
+
fig.update_layout(yaxis2=dict(range=[0.0, 1.1]))
|
| 287 |
|
| 288 |
fig.add_trace(go.Scatter(
|
| 289 |
x=results.index, y=results['consumption_from_network'],
|
|
|
|
| 313 |
x=results.index, y=results['charge_of_bess'],
|
| 314 |
hoverinfo='x+y',
|
| 315 |
mode='lines',
|
| 316 |
+
line=dict(width=1.5, color='red'),
|
| 317 |
name='charge of BESS'),
|
| 318 |
secondary_y=True
|
| 319 |
)
|