Update solve_network.py

fix bug in pipe retroftting constraint
This commit is contained in:
lisazeyen 2021-07-13 08:50:15 +02:00 committed by GitHub
parent 81b009e062
commit 554b55ff3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):