From ecf8984c00f3c1567b42b587ce0da9d713363b4f Mon Sep 17 00:00:00 2001 From: hannesdiedrich Date: Fri, 16 Jan 2026 13:37:03 +0100 Subject: [PATCH 1/4] GSYE-900: Re-add temperature limits for the condenser temperature in the PCM tank --- .../strategy/state/heatpump_tank_states/pcm_tank_state.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gsy_e/models/strategy/state/heatpump_tank_states/pcm_tank_state.py b/src/gsy_e/models/strategy/state/heatpump_tank_states/pcm_tank_state.py index 874972e56..82f8071f1 100644 --- a/src/gsy_e/models/strategy/state/heatpump_tank_states/pcm_tank_state.py +++ b/src/gsy_e/models/strategy/state/heatpump_tank_states/pcm_tank_state.py @@ -141,6 +141,7 @@ def _limit_condenser_temp(self, condenser_temp_C: float) -> float: self._params.min_temp_htf_C, round(condenser_temp_C, 2), ) + return self._params.min_temp_htf_C if (condenser_temp_C - self._params.max_temp_htf_C) > FLOATING_POINT_TOLERANCE: log.warning( "The PCM storage tank reached it's maximum (%s), charging " @@ -148,6 +149,7 @@ def _limit_condenser_temp(self, condenser_temp_C: float) -> float: self._params.max_temp_htf_C, round(condenser_temp_C, 2), ) + return self._params.max_temp_htf_C return condenser_temp_C def increase_tank_temp_from_heat_energy(self, heat_energy_kWh: float, time_slot: DateTime): From 87f2c7bebbe7cba90b99ea173658115d0350b8d2 Mon Sep 17 00:00:00 2001 From: hannesdiedrich Date: Fri, 16 Jan 2026 13:38:33 +0100 Subject: [PATCH 2/4] GSYE-900: Call the COP model even if there was no trading in the heaet pump energy parameters. --- .../energy_parameters/heatpump/heat_pump.py | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/gsy_e/models/strategy/energy_parameters/heatpump/heat_pump.py b/src/gsy_e/models/strategy/energy_parameters/heatpump/heat_pump.py index 229286eeb..ac53213df 100644 --- a/src/gsy_e/models/strategy/energy_parameters/heatpump/heat_pump.py +++ b/src/gsy_e/models/strategy/energy_parameters/heatpump/heat_pump.py @@ -264,15 +264,12 @@ def update_cop_after_dis_charging( bought_energy_kWh: float, ): """Update the COP of the heat pump in its state class.""" - if bought_energy_kWh < FLOATING_POINT_TOLERANCE: - cop = self._hp_state.get_cop(last_time_slot) - else: - cop = self._calc_cop( - heat_energy_kJ=None, - source_temp_C=source_temp_C, - time_slot=last_time_slot, - electrical_energy_kWh=bought_energy_kWh, - ) + cop = self._calc_cop( + heat_energy_kJ=None, + source_temp_C=source_temp_C, + time_slot=last_time_slot, + electrical_energy_kWh=bought_energy_kWh, + ) # Set the calculated COP on both the last and the current time slot to use in calculations self._hp_state.set_cop(last_time_slot, cop) @@ -685,13 +682,10 @@ def _update_cop_after_dis_charging( bought_energy_kWh: float, ): """Update the COP of the heat pump in its state class.""" - if bought_energy_kWh < FLOATING_POINT_TOLERANCE: - cop = self._state.get_cop(last_time_slot) - else: - cop = self._calc_cop( - time_slot=last_time_slot, - electrical_energy_kWh=bought_energy_kWh, - ) + cop = self._calc_cop( + time_slot=last_time_slot, + electrical_energy_kWh=bought_energy_kWh, + ) # Set the calculated COP on both the last and the current time slot to use in calculations self.state.set_cop(last_time_slot, cop) From 68b9940e2ca660c350492dbfe42429686ef7e977 Mon Sep 17 00:00:00 2001 From: hannesdiedrich Date: Mon, 19 Jan 2026 07:36:18 +0100 Subject: [PATCH 3/4] GSYE-900: Fix tests --- .../state/heatpump_tank_states/test_pcm_tank_state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/strategies/state/heatpump_tank_states/test_pcm_tank_state.py b/tests/strategies/state/heatpump_tank_states/test_pcm_tank_state.py index 721ec2da6..8ddc3036a 100644 --- a/tests/strategies/state/heatpump_tank_states/test_pcm_tank_state.py +++ b/tests/strategies/state/heatpump_tank_states/test_pcm_tank_state.py @@ -49,7 +49,7 @@ def test_increase_tank_temp_from_heat_energy_correctly_updates_storage_temp_and_ assert pcm_tank._htf_temps_C[NEXT_MARKET_SLOT] == [40] * 5 assert pcm_tank._pcm_temps_C[NEXT_MARKET_SLOT] == [39] * 5 assert pcm_tank._soc.get(NEXT_MARKET_SLOT) == 0.6 - assert pcm_tank._condenser_temp_C.get(NEXT_MARKET_SLOT) == 45 + assert pcm_tank._condenser_temp_C.get(NEXT_MARKET_SLOT) == 42 def test_decrease_tank_temp_from_heat_energy_correctly_updates_storage_temp_and_soc( self, pcm_tank From 17f625b4de8c262391bf13b7712f54a20a7bb86a Mon Sep 17 00:00:00 2001 From: hannesdiedrich Date: Mon, 19 Jan 2026 07:45:08 +0100 Subject: [PATCH 4/4] GSYE-900: Add inline comment in the cop model call for better understanding --- .../strategy/energy_parameters/heatpump/cop_models/cop_models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gsy_e/models/strategy/energy_parameters/heatpump/cop_models/cop_models.py b/src/gsy_e/models/strategy/energy_parameters/heatpump/cop_models/cop_models.py index 0b5f8f3c2..8f518cb9a 100644 --- a/src/gsy_e/models/strategy/energy_parameters/heatpump/cop_models/cop_models.py +++ b/src/gsy_e/models/strategy/energy_parameters/heatpump/cop_models/cop_models.py @@ -199,6 +199,7 @@ def calc_cop( if electrical_demand_kW: # estimate the heat demand by using the median COP of the model fitting data + # this is only for heaving an initial value for the model call heat_demand_kW = electrical_demand_kW * self._model["COP_med"] heat_demand_kW = self._limit_heat_demand_kW(heat_demand_kW)