Skip to content

Commit

Permalink
Merge pull request #1684 from gridsingularity/bug/GSYE-631
Browse files Browse the repository at this point in the history
GSYE-631: Fix _calc_energy_to_buy_minimum in HP energy parameters
  • Loading branch information
hannesdiedrich authored Sep 15, 2023
2 parents 18cd2e7 + 3661752 commit b4f0e67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gsy_e/models/strategy/energy_parameters/heat_pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def _calc_energy_to_buy_maximum(self, time_slot: DateTime) -> float:
def _calc_energy_to_buy_minimum(self, time_slot: DateTime) -> float:
max_temp_decrease_allowed = (
self.state.get_storage_temp_C(time_slot) - self._min_temp_C)
temp_diff = self.state.get_temp_decrease_K(time_slot) - max_temp_decrease_allowed
if temp_diff < -FLOATING_POINT_TOLERANCE:
temp_diff = self.state.get_temp_decrease_K(time_slot)
if abs(temp_diff - max_temp_decrease_allowed) < -FLOATING_POINT_TOLERANCE:
return 0
min_energy_consumption = self._temp_diff_to_Q_kWh(temp_diff) / self._get_cop(time_slot)
return min(self._max_energy_consumption_kWh, min_energy_consumption)
Expand Down

0 comments on commit b4f0e67

Please sign in to comment.