From 31c0e92f32c8b92037b5a524b5d5f8654d459424 Mon Sep 17 00:00:00 2001 From: Johannes Kochems Date: Fri, 13 Oct 2023 11:27:18 +0200 Subject: [PATCH] Add bug fix --- src/oemof/solph/components/_generic_storage.py | 2 +- src/oemof/solph/components/experimental/_sink_dsm.py | 6 +++--- src/oemof/solph/flows/_simple_flow_block.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/oemof/solph/components/_generic_storage.py b/src/oemof/solph/components/_generic_storage.py index 143ca9e78..802d1703d 100644 --- a/src/oemof/solph/components/_generic_storage.py +++ b/src/oemof/solph/components/_generic_storage.py @@ -602,7 +602,7 @@ def _objective_expression(self): if m.es.periods is not None: for n in self.STORAGES: if n.fixed_costs[0] is not None: - fixed_costs += ( + fixed_costs += sum( n.nominal_storage_capacity * n.fixed_costs[pp] * ((1 + m.discount_rate) ** (-pp)) diff --git a/src/oemof/solph/components/experimental/_sink_dsm.py b/src/oemof/solph/components/experimental/_sink_dsm.py index a66b4fa2c..8734f597e 100644 --- a/src/oemof/solph/components/experimental/_sink_dsm.py +++ b/src/oemof/solph/components/experimental/_sink_dsm.py @@ -703,7 +703,7 @@ def _objective_expression(self): ) if g.fixed_costs[0] is not None: - fixed_costs += ( + fixed_costs += sum( max(g.max_capacity_up, g.max_capacity_down) * g.fixed_costs[pp] * ((1 + m.discount_rate) ** (-pp)) @@ -2105,7 +2105,7 @@ def _objective_expression(self): ) if g.fixed_costs[0] is not None: - fixed_costs += ( + fixed_costs += sum( max(g.max_capacity_up, g.max_capacity_down) * g.fixed_costs[pp] * ((1 + m.discount_rate) ** (-pp)) @@ -4205,7 +4205,7 @@ def _objective_expression(self): ) if g.fixed_costs[0] is not None: - fixed_costs += ( + fixed_costs += sum( max(g.max_capacity_up, g.max_capacity_down) * g.fixed_costs[pp] * ((1 + m.discount_rate) ** (-pp)) diff --git a/src/oemof/solph/flows/_simple_flow_block.py b/src/oemof/solph/flows/_simple_flow_block.py index b72abe114..32ba487d4 100644 --- a/src/oemof/solph/flows/_simple_flow_block.py +++ b/src/oemof/solph/flows/_simple_flow_block.py @@ -487,7 +487,7 @@ def _objective_expression(self): and (i, o) not in self.LIFETIME_FLOWS and (i, o) not in self.LIFETIME_AGE_FLOWS ): - fixed_costs += ( + fixed_costs += sum( m.flows[i, o].nominal_value * m.flows[i, o].fixed_costs[pp] * ((1 + m.discount_rate) ** (-pp))