Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4c0f7be
feat: remove heat pump nominal efficiency and reallocate link buses a…
amos-schledorn Jul 9, 2025
1395da5
Merge remote-tracking branch 'origin/master' into feat-allocate-heat-…
amos-schledorn Jul 9, 2025
147f963
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 9, 2025
a6de7d6
Update scripts/prepare_sector_network.py
amos-schledorn Jul 9, 2025
d19e68c
Update scripts/prepare_sector_network.py
amos-schledorn Jul 9, 2025
0173b9b
Update scripts/prepare_sector_network.py
amos-schledorn Jul 9, 2025
ed0ea40
Update scripts/prepare_sector_network.py
amos-schledorn Jul 9, 2025
57ba638
doc:update release notes
amos-schledorn Jul 9, 2025
62b8463
fix: adjust efficiency calculations in add_heat function to prevent d…
amos-schledorn Jul 9, 2025
a491e98
fix: remove redundant parameters in add_heat function
amos-schledorn Jul 9, 2025
5d2293c
fix: increase non-zero COP limits to avoid small matrix coefficients
amos-schledorn Jul 9, 2025
007fbca
Merge branch 'master' into feat-allocate-heat-pump-capex-on-heat-bus
amos-schledorn Jul 10, 2025
89d8b9f
Merge branch 'master' into feat-allocate-heat-pump-capex-on-heat-bus
amos-schledorn Jul 15, 2025
f6ce6a8
fix: correct bus parameter order and adjust efficiency calculation in…
amos-schledorn Jul 17, 2025
d2c90d2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 17, 2025
9a5d0a7
fix: correct cop clipping
amos-schledorn Jul 21, 2025
1f3b126
feat: improve cop clipping
amos-schledorn Jul 21, 2025
200cbdc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 21, 2025
7777b59
fix: set default power limits in add_heating_capacities_installed_bef…
amos-schledorn Jul 21, 2025
58273d0
fix: correct capital cost calculation in add_heating_capacities_insta…
amos-schledorn Jul 21, 2025
de91634
fix: update p_min_pu calculation in heating capacity to prevent opera…
amos-schledorn Jul 22, 2025
0192fb0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 22, 2025
51e7a48
fix: update efficiency calculations in add_heat function to handle ed…
amos-schledorn Jul 22, 2025
e9cc423
fix: adjust efficiency calculation in add_heat function to handle edg…
amos-schledorn Jul 22, 2025
39d3a0c
fix: use negative efficiencies instead of negative p_min_pu
amos-schledorn Jul 22, 2025
1a75edc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 22, 2025
d2a47a0
feat:replace clip_p_max_pu with rounding
amos-schledorn Jul 23, 2025
e088aaf
cycle back to positive efficiencies, negative p
amos-schledorn Jul 23, 2025
17c7517
fix typo
amos-schledorn Jul 23, 2025
7364c69
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 23, 2025
b2f779f
Revert "feat:replace clip_p_max_pu with rounding"
amos-schledorn Jul 23, 2025
5367391
fix: use absolute value for clipping p_min_max
amos-schledorn Jul 23, 2025
c10e74b
Merge remote-tracking branch 'origin/master' into feat-allocate-heat-…
amos-schledorn Jul 23, 2025
c2f1b4f
fix multi-link heat pumps
amos-schledorn Jul 23, 2025
2ee79e0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 23, 2025
bb5e53b
fix efficiency2 in multi-link HPs
amos-schledorn Jul 23, 2025
6b6a2d0
fix typo
amos-schledorn Jul 23, 2025
bb8b5f7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 23, 2025
1646191
fix heat pump capacity limits in add_heat function
amos-schledorn Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Release Notes
Upcoming Release
================

* Fix: Allocate heat pump CAPEX on heat instead of electricity bus instead and remove nominal efficiency from CAPEX calculation

* Fix: Configsettings for `heat_pump_cop_approximation` are now correctly passed to `CentralHeatingCopApproximator.py`

* Introduce a new base network using TYNDP 2024 data (https://github.com/PyPSA/pypsa-eur/pull/1646). This base network can be used with `tyndp` as `base_network`. It models NTC transmission capacities between TYNDP bidding zones using unidirectional `links`. This implementation neglects KVL and is referred to as a transport model. This is consistent with the TYNDP 2024 methodology.

PyPSA-Eur v2025.07.0 (11th July 2025)
Expand Down
14 changes: 7 additions & 7 deletions scripts/add_existing_baseyear.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,17 +598,17 @@ def add_heating_capacities_installed_before_baseyear(
"Link",
nodes,
suffix=f" {heat_system} {heat_source} heat pump-{grouping_year}",
bus0=nodes_elec,
bus1=nodes + " " + heat_system.value + " heat",
bus0=nodes + " " + heat_system.value + " heat",
bus1=nodes_elec,
carrier=f"{heat_system} {heat_source} heat pump",
efficiency=efficiency,
capital_cost=costs.at[costs_name, "efficiency"]
* costs.at[costs_name, "capital_cost"],
efficiency=(1 / efficiency.clip(lower=0.001)).replace(1000, 0),
capital_cost=costs.at[costs_name, "capital_cost"],
p_nom=existing_capacities.loc[
nodes, (heat_system.value, f"{heat_source} heat pump")
]
* ratio
/ costs.at[costs_name, "efficiency"],
* ratio,
p_max_pu=0,
p_min_pu=-1 * efficiency / efficiency.clip(lower=0.001),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
p_min_pu=-1 * efficiency / efficiency.clip(lower=0.001),
p_min_pu=-1 * efficiency / efficiency.clip(lower=0.001).replace(1000, 0),

build_year=int(grouping_year),
lifetime=costs.at[costs_name, "lifetime"],
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/definitions/heat_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def heat_pump_costs_name(self, heat_source: str) -> str:
str
The name for the heat pump costs.
"""
if heat_source in ["ptes"]:
if heat_source in ["ptes", "geothermal"]:
return f"{self.central_or_decentral} excess-heat-sourced heat pump"
else:
return f"{self.central_or_decentral} {heat_source}-sourced heat pump"
Expand Down
47 changes: 27 additions & 20 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ def insert_electricity_distribution_grid(
n.links.loc[v2gs, "bus1"] += " low voltage"

hps = n.links.index[n.links.carrier.str.contains("heat pump")]
n.links.loc[hps, "bus0"] += " low voltage"
n.links.loc[hps, "bus1"] += " low voltage"

rh = n.links.index[n.links.carrier.str.contains("resistive heater")]
n.links.loc[rh, "bus0"] += " low voltage"
Expand Down Expand Up @@ -3228,16 +3228,18 @@ def add_heat(
"Link",
nodes,
suffix=f" {heat_system} {heat_source} heat pump",
bus0=nodes,
bus1=nodes + f" {heat_carrier}",
bus2=nodes + f" {heat_system} heat",
bus0=nodes + f" {heat_system} heat",
bus1=nodes,
bus2=nodes + f" {heat_carrier}",
carrier=f"{heat_system} {heat_source} heat pump",
efficiency=(-(cop_heat_pump - 1)).clip(upper=0),
efficiency2=cop_heat_pump,
capital_cost=costs.at[costs_name_heat_pump, "efficiency"]
* costs.at[costs_name_heat_pump, "capital_cost"]
efficiency=(1 / cop_heat_pump.clip(lower=0.001)).replace(1000, 0),
efficiency2=1
- (1 / cop_heat_pump.clip(lower=0.001)).replace(1000, 0),
capital_cost=costs.at[costs_name_heat_pump, "capital_cost"]
* overdim_factor,
p_nom_extendable=True,
p_min_pu=-cop_heat_pump / cop_heat_pump.clip(lower=0.001),
p_max_pu=0,
lifetime=costs.at[costs_name_heat_pump, "lifetime"],
)

Expand Down Expand Up @@ -3288,16 +3290,20 @@ def add_heat(
"Link",
nodes,
suffix=f" {heat_system} {heat_source} heat pump",
bus0=nodes,
bus1=nodes + f" {heat_system} water pits",
bus2=nodes + f" {heat_system} heat",
bus0=nodes + f" {heat_system} heat",
bus1=nodes,
bus2=nodes + f" {heat_system} water pits",
carrier=f"{heat_system} {heat_source} heat pump",
efficiency=(-(cop_heat_pump - 1)).clip(upper=0),
efficiency2=cop_heat_pump,
capital_cost=costs.at[costs_name_heat_pump, "efficiency"]
* costs.at[costs_name_heat_pump, "capital_cost"]
efficiency=(1 / (cop_heat_pump - 1).clip(lower=0.001)).replace(
1000, 0
),
efficiency2=1
- (1 / cop_heat_pump.clip(lower=0.001)).replace(1000, 0),
capital_cost=costs.at[costs_name_heat_pump, "capital_cost"]
* overdim_factor,
p_nom_extendable=True,
p_min_pu=-cop_heat_pump / cop_heat_pump.clip(lower=0.001),
p_max_pu=0,
lifetime=costs.at[costs_name_heat_pump, "lifetime"],
)

Expand All @@ -3306,13 +3312,14 @@ def add_heat(
"Link",
nodes,
suffix=f" {heat_system} {heat_source} heat pump",
bus0=nodes,
bus1=nodes + f" {heat_system} heat",
bus0=nodes + f" {heat_system} heat",
bus1=nodes,
carrier=f"{heat_system} {heat_source} heat pump",
efficiency=cop_heat_pump,
capital_cost=costs.at[costs_name_heat_pump, "efficiency"]
* costs.at[costs_name_heat_pump, "capital_cost"]
efficiency=(1 / cop_heat_pump.clip(lower=0.001)).replace(1000, 0),
capital_cost=costs.at[costs_name_heat_pump, "capital_cost"]
* overdim_factor,
p_min_pu=-cop_heat_pump / cop_heat_pump.clip(lower=0.001),
p_max_pu=0,
p_nom_extendable=True,
lifetime=costs.at[costs_name_heat_pump, "lifetime"],
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/solve_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def prepare_network(
n.links_t.p_min_pu,
n.storage_units_t.inflow,
):
df.where(df > solve_opts["clip_p_max_pu"], other=0.0, inplace=True)
df.where(df.abs() > solve_opts["clip_p_max_pu"], other=0.0, inplace=True)

if load_shedding := solve_opts.get("load_shedding"):
# intersect between macroeconomic and surveybased willingness to pay
Expand Down