From 554b55ff3d643bf9f0a262741de7fb3e9b0caddb Mon Sep 17 00:00:00 2001 From: lisazeyen <35347358+lisazeyen@users.noreply.github.com> Date: Tue, 13 Jul 2021 08:50:15 +0200 Subject: [PATCH] Update solve_network.py fix bug in pipe retroftting constraint --- scripts/solve_network.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 21cfea59..82b451dd 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -165,10 +165,10 @@ def add_pipe_retrofit_constraint(n): # according to hydrogen backbone strategy (April, 2020) p.15 # https://gasforclimate2050.eu/wp-content/uploads/2020/07/2020_European-Hydrogen-Backbone_Report.pdf # 60% of original natural gas capacity could be used in cost-optimal case as H2 capacity - lhs = linexpr((1, link_p_nom.loc[h2_retrofitted_i].rename(index=lambda x: x.replace("H2 pipeline retrofitted", "Gas pipeline"))), - (-0.6, link_p_nom.loc[gas_pipes_i])) + lhs = linexpr((1/0.6, link_p_nom.loc[h2_retrofitted_i].rename(index=lambda x: x.replace("H2 pipeline retrofitted", "Gas pipeline"))), + (1, link_p_nom.loc[gas_pipes_i])) - define_constraints(n, lhs, "=", 0., 'Link', 'pipe_retrofit') + define_constraints(n, lhs, "=", pipe_capacity, 'Link', 'pipe_retrofit') def extra_functionality(n, snapshots):