Merge pull request #796 from PyPSA/district_heating_share_0

district heating bugfix when no progress is assumed
This commit is contained in:
Fabian Neumann 2023-12-11 14:01:57 +01:00 committed by GitHub
commit 8d509f4606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2003,7 +2003,11 @@ def add_heat(n, costs):
space_heat_demand = demand * w_space[sec][node]
# normed time profile of space heat demand 'space_pu' (values between 0-1),
# p_max_pu/p_min_pu of retrofitting generators
space_pu = (space_heat_demand / space_heat_demand.max()).to_frame(name=node)
space_pu = (
(space_heat_demand / space_heat_demand.max())
.to_frame(name=node)
.fillna(0)
)
# minimum heat demand 'dE' after retrofitting in units of original heat demand (values between 0-1)
dE = retro_data.loc[(ct, sec), ("dE")]
@ -2015,6 +2019,9 @@ def add_heat(n, costs):
* floor_area_node
/ ((1 - dE) * space_heat_demand.max())
)
if space_heat_demand.max() == 0:
capital_cost = capital_cost.apply(lambda b: 0 if b == np.inf else b)
# number of possible retrofitting measures 'strengths' (set in list at config.yaml 'l_strength')
# given in additional insulation thickness [m]
# for each measure, a retrofitting generator is added at the node