Skip to content

Commit

Permalink
Try fixing infeasibility by adding negative load shedding at EV buses
Browse files Browse the repository at this point in the history
  • Loading branch information
birgits committed Aug 20, 2024
1 parent c661fbe commit 54bba03
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions etrago/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,40 @@ def load_shedding(self, temporal_disaggregation=False, **kwargs):
"Generator",
)

start = (
network.generators.index.to_series()
.str.rsplit(" ")
.str[0]
.astype(int)
.sort_values()
.max()
+ 1
)

# Add negative load shedding generators for e-Mobility buses
ev_buses = network.buses[network.buses.carrier == "Li_ion"].index
index_ev = list(
range(
start + len(network.buses.index),
start + len(network.buses.index) + len(ev_buses),
)
)
network.import_components_from_dataframe(
pd.DataFrame(
dict(
marginal_cost=-marginal_cost*2,
p_nom=p_nom,
p_min_pu=-1,
p_max_pu=0,
carrier="negative load shedding",
bus=ev_buses,
control="PQ",
),
index=index_ev,
),
"Generator",
)


def set_control_strategies(network):
"""Sets control strategies for AC generators and storage units
Expand Down

0 comments on commit 54bba03

Please sign in to comment.