Skip to content

Commit

Permalink
Finish adjusting multi period tests
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Jun 12, 2024
1 parent 28ae2bc commit 30fbd8c
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 92 deletions.
2 changes: 1 addition & 1 deletion src/oemof/solph/flows/_simple_flow_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
126 changes: 63 additions & 63 deletions tests/lp_files/fixed_costs_sources.lp
Original file line number Diff line number Diff line change
Expand Up @@ -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
56 changes: 28 additions & 28 deletions tests/lp_files/flow_reaching_lifetime_initial_age.lp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 30fbd8c

Please sign in to comment.