Merge pull request #452 from PyPSA/pz-max-patch-2
Fix EQ constraint in case no hydro exist
This commit is contained in:
commit
d2f2634bae
@ -12,6 +12,8 @@ Upcoming Release
|
||||
|
||||
* Carriers of generators can now be excluded from aggregation in clustering network and simplify network.
|
||||
|
||||
* Fix EQ constraint for the case no hydro inflow is available
|
||||
|
||||
* Bugfix in the reserve constraint will increase demand related reserve requirements
|
||||
|
||||
PyPSA-Eur 0.6.1 (20th September 2022)
|
||||
|
@ -216,18 +216,21 @@ def add_EQ_constraints(n, o, scaling=1e-1):
|
||||
.T.groupby(ggrouper, axis=1)
|
||||
.apply(join_exprs)
|
||||
)
|
||||
lhs_spill = (
|
||||
linexpr(
|
||||
(
|
||||
-n.snapshot_weightings.stores * scaling,
|
||||
get_var(n, "StorageUnit", "spill").T,
|
||||
if not n.storage_units_t.inflow.empty:
|
||||
lhs_spill = (
|
||||
linexpr(
|
||||
(
|
||||
-n.snapshot_weightings.stores * scaling,
|
||||
get_var(n, "StorageUnit", "spill").T,
|
||||
)
|
||||
)
|
||||
.T.groupby(sgrouper, axis=1)
|
||||
.apply(join_exprs)
|
||||
)
|
||||
.T.groupby(sgrouper, axis=1)
|
||||
.apply(join_exprs)
|
||||
)
|
||||
lhs_spill = lhs_spill.reindex(lhs_gen.index).fillna("")
|
||||
lhs = lhs_gen + lhs_spill
|
||||
lhs_spill = lhs_spill.reindex(lhs_gen.index).fillna("")
|
||||
lhs = lhs_gen + lhs_spill
|
||||
else:
|
||||
lhs = lhs_gen
|
||||
define_constraints(n, lhs, ">=", rhs, "equity", "min")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user