Skip to content

Commit

Permalink
call fuction get_switchable_as_dense before p_max_pu is modified
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosEpia committed Jun 25, 2024
1 parent 62d51f8 commit 44a646a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions etrago/execute/grid_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ def add_redispatch_generators(
)
].index

# this function is called here before p_max_pu is modified to set the
# dispatch values from the market optimization.
p_max_pu_all = self.network.get_switchable_as_dense(
"Generator", "p_max_pu"
).copy()

links_redispatch = self.network.links[
(
self.network.links.carrier.isin(["OCGT"])
Expand Down Expand Up @@ -428,9 +434,6 @@ def add_redispatch_generators(
# Set maximum feed-in limit for ramp up generators based on feed-in of
# (disaggregated) generators from the market optimization and potential
# feedin time series
p_max_pu_all = self.network.get_switchable_as_dense(
"Generator", "p_max_pu"
)

self.network.generators_t.p_max_pu.loc[:, gens_redispatch + " ramp_up"] = (
(
Expand Down

0 comments on commit 44a646a

Please sign in to comment.