diff --git a/src/oemof/solph/flows/_simple_flow_block.py b/src/oemof/solph/flows/_simple_flow_block.py index 469ec1311..7cf21bced 100644 --- a/src/oemof/solph/flows/_simple_flow_block.py +++ b/src/oemof/solph/flows/_simple_flow_block.py @@ -359,7 +359,7 @@ def _lifetime_age_output_rule(block): m.flows[inp, out].lifetime - m.flows[inp, out].age <= m.es.periods_years[p] ): - lhs = m.flow[inp, out, p, ts] + lhs = m.flow[inp, out, ts] rhs = 0 self.lifetime_age_output.add( (inp, out, p, ts), (lhs == rhs) diff --git a/tests/lp_files/fixed_costs_sources.lp b/tests/lp_files/fixed_costs_sources.lp index 8629b5295..20fdfeb81 100644 --- a/tests/lp_files/fixed_costs_sources.lp +++ b/tests/lp_files/fixed_costs_sources.lp @@ -2,90 +2,90 @@ min objective: -+235.90542099192618 ONE_VAR_CONSTANT -+25 flow(pv_forever_electricityBus_0_0) -+25 flow(pv_forever_electricityBus_0_1) -+24.509803921568626 flow(pv_forever_electricityBus_1_2) -+24.509803921568626 flow(pv_forever_electricityBus_1_3) -+24.029219530949632 flow(pv_forever_electricityBus_2_4) -+24.029219530949632 flow(pv_forever_electricityBus_2_5) -+25 flow(pv_with_lifetime_electricityBus_0_0) -+25 flow(pv_with_lifetime_electricityBus_0_1) -+24.509803921568626 flow(pv_with_lifetime_electricityBus_1_2) -+24.509803921568626 flow(pv_with_lifetime_electricityBus_1_3) -+24.029219530949632 flow(pv_with_lifetime_electricityBus_2_4) -+24.029219530949632 flow(pv_with_lifetime_electricityBus_2_5) -+25 flow(pv_with_lifetime_and_age_electricityBus_0_0) -+25 flow(pv_with_lifetime_and_age_electricityBus_0_1) -+24.509803921568626 flow(pv_with_lifetime_and_age_electricityBus_1_2) -+24.509803921568626 flow(pv_with_lifetime_and_age_electricityBus_1_3) -+24.029219530949632 flow(pv_with_lifetime_and_age_electricityBus_2_4) -+24.029219530949632 flow(pv_with_lifetime_and_age_electricityBus_2_5) ++235.90542099192615 ONE_VAR_CONSTANT ++25 flow(pv_forever_electricityBus_0) ++25 flow(pv_forever_electricityBus_1) ++24.509803921568626 flow(pv_forever_electricityBus_2) ++24.509803921568626 flow(pv_forever_electricityBus_3) ++24.029219530949632 flow(pv_forever_electricityBus_4) ++24.029219530949632 flow(pv_forever_electricityBus_5) ++25 flow(pv_with_lifetime_electricityBus_0) ++25 flow(pv_with_lifetime_electricityBus_1) ++24.509803921568626 flow(pv_with_lifetime_electricityBus_2) ++24.509803921568626 flow(pv_with_lifetime_electricityBus_3) ++24.029219530949632 flow(pv_with_lifetime_electricityBus_4) ++24.029219530949632 flow(pv_with_lifetime_electricityBus_5) ++25 flow(pv_with_lifetime_and_age_electricityBus_0) ++25 flow(pv_with_lifetime_and_age_electricityBus_1) ++24.509803921568626 flow(pv_with_lifetime_and_age_electricityBus_2) ++24.509803921568626 flow(pv_with_lifetime_and_age_electricityBus_3) ++24.029219530949632 flow(pv_with_lifetime_and_age_electricityBus_4) ++24.029219530949632 flow(pv_with_lifetime_and_age_electricityBus_5) s.t. -c_e_BusBlock_balance(electricityBus_0_0)_: -+1 flow(pv_forever_electricityBus_0_0) -+1 flow(pv_with_lifetime_electricityBus_0_0) -+1 flow(pv_with_lifetime_and_age_electricityBus_0_0) +c_e_BusBlock_balance(electricityBus_0)_: ++1 flow(pv_forever_electricityBus_0) ++1 flow(pv_with_lifetime_electricityBus_0) ++1 flow(pv_with_lifetime_and_age_electricityBus_0) = 0 -c_e_BusBlock_balance(electricityBus_0_1)_: -+1 flow(pv_forever_electricityBus_0_1) -+1 flow(pv_with_lifetime_electricityBus_0_1) -+1 flow(pv_with_lifetime_and_age_electricityBus_0_1) +c_e_BusBlock_balance(electricityBus_1)_: ++1 flow(pv_forever_electricityBus_1) ++1 flow(pv_with_lifetime_electricityBus_1) ++1 flow(pv_with_lifetime_and_age_electricityBus_1) = 0 -c_e_BusBlock_balance(electricityBus_1_2)_: -+1 flow(pv_forever_electricityBus_1_2) -+1 flow(pv_with_lifetime_electricityBus_1_2) -+1 flow(pv_with_lifetime_and_age_electricityBus_1_2) +c_e_BusBlock_balance(electricityBus_2)_: ++1 flow(pv_forever_electricityBus_2) ++1 flow(pv_with_lifetime_electricityBus_2) ++1 flow(pv_with_lifetime_and_age_electricityBus_2) = 0 -c_e_BusBlock_balance(electricityBus_1_3)_: -+1 flow(pv_forever_electricityBus_1_3) -+1 flow(pv_with_lifetime_electricityBus_1_3) -+1 flow(pv_with_lifetime_and_age_electricityBus_1_3) +c_e_BusBlock_balance(electricityBus_3)_: ++1 flow(pv_forever_electricityBus_3) ++1 flow(pv_with_lifetime_electricityBus_3) ++1 flow(pv_with_lifetime_and_age_electricityBus_3) = 0 -c_e_BusBlock_balance(electricityBus_2_4)_: -+1 flow(pv_forever_electricityBus_2_4) -+1 flow(pv_with_lifetime_electricityBus_2_4) -+1 flow(pv_with_lifetime_and_age_electricityBus_2_4) +c_e_BusBlock_balance(electricityBus_4)_: ++1 flow(pv_forever_electricityBus_4) ++1 flow(pv_with_lifetime_electricityBus_4) ++1 flow(pv_with_lifetime_and_age_electricityBus_4) = 0 -c_e_BusBlock_balance(electricityBus_2_5)_: -+1 flow(pv_forever_electricityBus_2_5) -+1 flow(pv_with_lifetime_electricityBus_2_5) -+1 flow(pv_with_lifetime_and_age_electricityBus_2_5) +c_e_BusBlock_balance(electricityBus_5)_: ++1 flow(pv_forever_electricityBus_5) ++1 flow(pv_with_lifetime_electricityBus_5) ++1 flow(pv_with_lifetime_and_age_electricityBus_5) = 0 c_e_SimpleFlowBlock_lifetime_age_output(pv_with_lifetime_and_age_electricityBus_2_4)_: -+1 flow(pv_with_lifetime_and_age_electricityBus_2_4) ++1 flow(pv_with_lifetime_and_age_electricityBus_4) = 0 c_e_SimpleFlowBlock_lifetime_age_output(pv_with_lifetime_and_age_electricityBus_2_5)_: -+1 flow(pv_with_lifetime_and_age_electricityBus_2_5) ++1 flow(pv_with_lifetime_and_age_electricityBus_5) = 0 bounds 1 <= ONE_VAR_CONSTANT <= 1 - 0 <= flow(pv_forever_electricityBus_0_0) <= 8.0 - 0 <= flow(pv_forever_electricityBus_0_1) <= 8.0 - 0 <= flow(pv_forever_electricityBus_1_2) <= 8.0 - 0 <= flow(pv_forever_electricityBus_1_3) <= 8.0 - 0 <= flow(pv_forever_electricityBus_2_4) <= 8.0 - 0 <= flow(pv_forever_electricityBus_2_5) <= 8.0 - 0 <= flow(pv_with_lifetime_electricityBus_0_0) <= 8.0 - 0 <= flow(pv_with_lifetime_electricityBus_0_1) <= 8.0 - 0 <= flow(pv_with_lifetime_electricityBus_1_2) <= 8.0 - 0 <= flow(pv_with_lifetime_electricityBus_1_3) <= 8.0 - 0 <= flow(pv_with_lifetime_electricityBus_2_4) <= 8.0 - 0 <= flow(pv_with_lifetime_electricityBus_2_5) <= 8.0 - 0 <= flow(pv_with_lifetime_and_age_electricityBus_0_0) <= 8.0 - 0 <= flow(pv_with_lifetime_and_age_electricityBus_0_1) <= 8.0 - 0 <= flow(pv_with_lifetime_and_age_electricityBus_1_2) <= 8.0 - 0 <= flow(pv_with_lifetime_and_age_electricityBus_1_3) <= 8.0 - 0 <= flow(pv_with_lifetime_and_age_electricityBus_2_4) <= 8.0 - 0 <= flow(pv_with_lifetime_and_age_electricityBus_2_5) <= 8.0 + 0 <= flow(pv_forever_electricityBus_0) <= 8.0 + 0 <= flow(pv_forever_electricityBus_1) <= 8.0 + 0 <= flow(pv_forever_electricityBus_2) <= 8.0 + 0 <= flow(pv_forever_electricityBus_3) <= 8.0 + 0 <= flow(pv_forever_electricityBus_4) <= 8.0 + 0 <= flow(pv_forever_electricityBus_5) <= 8.0 + 0 <= flow(pv_with_lifetime_electricityBus_0) <= 8.0 + 0 <= flow(pv_with_lifetime_electricityBus_1) <= 8.0 + 0 <= flow(pv_with_lifetime_electricityBus_2) <= 8.0 + 0 <= flow(pv_with_lifetime_electricityBus_3) <= 8.0 + 0 <= flow(pv_with_lifetime_electricityBus_4) <= 8.0 + 0 <= flow(pv_with_lifetime_electricityBus_5) <= 8.0 + 0 <= flow(pv_with_lifetime_and_age_electricityBus_0) <= 8.0 + 0 <= flow(pv_with_lifetime_and_age_electricityBus_1) <= 8.0 + 0 <= flow(pv_with_lifetime_and_age_electricityBus_2) <= 8.0 + 0 <= flow(pv_with_lifetime_and_age_electricityBus_3) <= 8.0 + 0 <= flow(pv_with_lifetime_and_age_electricityBus_4) <= 8.0 + 0 <= flow(pv_with_lifetime_and_age_electricityBus_5) <= 8.0 end diff --git a/tests/lp_files/flow_reaching_lifetime_initial_age.lp b/tests/lp_files/flow_reaching_lifetime_initial_age.lp index 61f0a0a7a..e1f5c8da4 100644 --- a/tests/lp_files/flow_reaching_lifetime_initial_age.lp +++ b/tests/lp_files/flow_reaching_lifetime_initial_age.lp @@ -2,60 +2,60 @@ min objective: -+25 flow(electricityBus_excess_0_0) -+25 flow(electricityBus_excess_0_1) -+24.509803921568626 flow(electricityBus_excess_1_2) -+24.509803921568626 flow(electricityBus_excess_1_3) -+24.029219530949632 flow(electricityBus_excess_2_4) -+24.029219530949632 flow(electricityBus_excess_2_5) ++25 flow(electricityBus_excess_0) ++25 flow(electricityBus_excess_1) ++24.509803921568626 flow(electricityBus_excess_2) ++24.509803921568626 flow(electricityBus_excess_3) ++24.029219530949632 flow(electricityBus_excess_4) ++24.029219530949632 flow(electricityBus_excess_5) s.t. -c_e_BusBlock_balance(electricityBus_0_0)_: -+1 flow(electricityBus_excess_0_0) +c_e_BusBlock_balance(electricityBus_0)_: ++1 flow(electricityBus_excess_0) = 0 -c_e_BusBlock_balance(electricityBus_0_1)_: -+1 flow(electricityBus_excess_0_1) +c_e_BusBlock_balance(electricityBus_1)_: ++1 flow(electricityBus_excess_1) = 0 -c_e_BusBlock_balance(electricityBus_1_2)_: -+1 flow(electricityBus_excess_1_2) +c_e_BusBlock_balance(electricityBus_2)_: ++1 flow(electricityBus_excess_2) = 0 -c_e_BusBlock_balance(electricityBus_1_3)_: -+1 flow(electricityBus_excess_1_3) +c_e_BusBlock_balance(electricityBus_3)_: ++1 flow(electricityBus_excess_3) = 0 -c_e_BusBlock_balance(electricityBus_2_4)_: -+1 flow(electricityBus_excess_2_4) +c_e_BusBlock_balance(electricityBus_4)_: ++1 flow(electricityBus_excess_4) = 0 -c_e_BusBlock_balance(electricityBus_2_5)_: -+1 flow(electricityBus_excess_2_5) +c_e_BusBlock_balance(electricityBus_5)_: ++1 flow(electricityBus_excess_5) = 0 c_e_SimpleFlowBlock_lifetime_age_output(electricityBus_excess_1_2)_: -+1 flow(electricityBus_excess_1_2) ++1 flow(electricityBus_excess_2) = 0 c_e_SimpleFlowBlock_lifetime_age_output(electricityBus_excess_1_3)_: -+1 flow(electricityBus_excess_1_3) ++1 flow(electricityBus_excess_3) = 0 c_e_SimpleFlowBlock_lifetime_age_output(electricityBus_excess_2_4)_: -+1 flow(electricityBus_excess_2_4) ++1 flow(electricityBus_excess_4) = 0 c_e_SimpleFlowBlock_lifetime_age_output(electricityBus_excess_2_5)_: -+1 flow(electricityBus_excess_2_5) ++1 flow(electricityBus_excess_5) = 0 bounds - 0 <= flow(electricityBus_excess_0_0) <= 8.0 - 0 <= flow(electricityBus_excess_0_1) <= 8.0 - 0 <= flow(electricityBus_excess_1_2) <= 8.0 - 0 <= flow(electricityBus_excess_1_3) <= 8.0 - 0 <= flow(electricityBus_excess_2_4) <= 8.0 - 0 <= flow(electricityBus_excess_2_5) <= 8.0 + 0 <= flow(electricityBus_excess_0) <= 8.0 + 0 <= flow(electricityBus_excess_1) <= 8.0 + 0 <= flow(electricityBus_excess_2) <= 8.0 + 0 <= flow(electricityBus_excess_3) <= 8.0 + 0 <= flow(electricityBus_excess_4) <= 8.0 + 0 <= flow(electricityBus_excess_5) <= 8.0 end