Skip to content

Commit

Permalink
Merge pull request #759 from openego/fixes/negative-load-shedding-ev
Browse files Browse the repository at this point in the history
Add option for negative load shedding at e-Mobility buses
  • Loading branch information
birgits authored Aug 23, 2024
2 parents b4af09f + 86e2d8f commit 57744fc
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion etrago/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,12 @@ def connected_transformer(network, busids):
return network.transformers[mask]


def load_shedding(self, temporal_disaggregation=False, **kwargs):
def load_shedding(
self,
temporal_disaggregation=False,
negative_load_shedding_ev=True,
**kwargs,
):
"""Implement load shedding in existing network to identify
feasibility problems
Expand Down Expand Up @@ -682,6 +687,31 @@ def load_shedding(self, temporal_disaggregation=False, **kwargs):
"Generator",
)

if negative_load_shedding_ev:
# 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,
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 57744fc

Please sign in to comment.