Fix EQ constraint in case no hydro exist
This commit is contained in:
parent
bc8ac24c33
commit
9e61e30ff4
@ -216,18 +216,21 @@ def add_EQ_constraints(n, o, scaling=1e-1):
|
|||||||
.T.groupby(ggrouper, axis=1)
|
.T.groupby(ggrouper, axis=1)
|
||||||
.apply(join_exprs)
|
.apply(join_exprs)
|
||||||
)
|
)
|
||||||
lhs_spill = (
|
if not n.storage_units_t.inflow.empty:
|
||||||
linexpr(
|
lhs_spill = (
|
||||||
(
|
linexpr(
|
||||||
-n.snapshot_weightings.stores * scaling,
|
(
|
||||||
get_var(n, "StorageUnit", "spill").T,
|
-n.snapshot_weightings.stores * scaling,
|
||||||
|
get_var(n, "StorageUnit", "spill").T,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
.T.groupby(sgrouper, axis=1)
|
||||||
|
.apply(join_exprs)
|
||||||
)
|
)
|
||||||
.T.groupby(sgrouper, axis=1)
|
lhs_spill = lhs_spill.reindex(lhs_gen.index).fillna("")
|
||||||
.apply(join_exprs)
|
lhs = lhs_gen + lhs_spill
|
||||||
)
|
else:
|
||||||
lhs_spill = lhs_spill.reindex(lhs_gen.index).fillna("")
|
lhs = lhs_gen
|
||||||
lhs = lhs_gen + lhs_spill
|
|
||||||
define_constraints(n, lhs, ">=", rhs, "equity", "min")
|
define_constraints(n, lhs, ">=", rhs, "equity", "min")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user