Merge pull request #1076 from koen-vg/transmission-limit-fix
Fix disabling transmission limit for volume limit type
This commit is contained in:
commit
1fff76b244
@ -132,22 +132,20 @@ def disable_grid_expansion_if_limit_hit(n):
|
||||
minimum and extendable is turned off; the corresponding global
|
||||
constraint is then dropped.
|
||||
"""
|
||||
cols = {"cost": "capital_cost", "volume": "length"}
|
||||
for limit_type in ["cost", "volume"]:
|
||||
glcs = n.global_constraints.query(
|
||||
f"type == 'transmission_expansion_{limit_type}_limit'"
|
||||
)
|
||||
types = {"expansion_cost": "capital_cost", "volume_expansion": "length"}
|
||||
for limit_type in types:
|
||||
glcs = n.global_constraints.query(f"type == 'transmission_{limit_type}_limit'")
|
||||
|
||||
for name, glc in glcs.iterrows():
|
||||
total_expansion = (
|
||||
(
|
||||
n.lines.query("s_nom_extendable")
|
||||
.eval(f"s_nom_min * {cols[limit_type]}")
|
||||
.eval(f"s_nom_min * {types[limit_type]}")
|
||||
.sum()
|
||||
)
|
||||
+ (
|
||||
n.links.query("carrier == 'DC' and p_nom_extendable")
|
||||
.eval(f"p_nom_min * {cols[limit_type]}")
|
||||
.eval(f"p_nom_min * {types[limit_type]}")
|
||||
.sum()
|
||||
)
|
||||
).sum()
|
||||
|
Loading…
Reference in New Issue
Block a user