From a213d2ea17c5dab6932df4dd5d1bf15f87ea67dc Mon Sep 17 00:00:00 2001 From: Johannes Kochems Date: Fri, 4 Aug 2023 18:13:39 +0200 Subject: [PATCH 1/5] Explicitly define storage level for very first time step of optimization run --- src/oemof/solph/components/_generic_storage.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/oemof/solph/components/_generic_storage.py b/src/oemof/solph/components/_generic_storage.py index f9c5aa8b2..1c34269ad 100644 --- a/src/oemof/solph/components/_generic_storage.py +++ b/src/oemof/solph/components/_generic_storage.py @@ -1312,6 +1312,22 @@ def _old_storage_capacity_rule(block): self.old_rule_build = BuildAction(rule=_old_storage_capacity_rule) + def _initially_empty_rule(block): + """Ensure storage to be empty initially""" + for n in self.INVESTSTORAGES: + for t in m.TIMESTEPS: + if t == 0: + expr = self.storage_content[n, 0] == 0 + self.initially_empty.add((n, t), expr) + + self.initially_empty = Constraint( + self.INVESTSTORAGES, m.TIMESTEPS, noruleinit=True + ) + + self.initially_empty_build = BuildAction( + rule=_initially_empty_rule + ) + # Standard storage implementation for discrete time points else: From 0db730b5ddcb858045e545ecbcceb9f31ae042ae Mon Sep 17 00:00:00 2001 From: Johannes Kochems Date: Fri, 4 Aug 2023 18:27:23 +0200 Subject: [PATCH 2/5] Adjust multi-period constraint tests --- .../connect_investment_multi_period.lp | 380 +++++++++--------- tests/lp_files/periodical_investment_limit.lp | 202 +++++----- .../lp_files/storage_invest_1_multi_period.lp | 8 +- .../lp_files/storage_invest_2_multi_period.lp | 8 +- .../lp_files/storage_invest_3_multi_period.lp | 176 ++++---- .../lp_files/storage_invest_4_multi_period.lp | 8 +- .../lp_files/storage_invest_5_multi_period.lp | 172 ++++---- .../lp_files/storage_invest_6_multi_period.lp | 8 +- ...orage_invest_all_nonconvex_multi_period.lp | 244 +++++------ .../storage_invest_minimum_multi_period.lp | 8 +- tests/lp_files/storage_invest_multi_period.lp | 8 +- ...storage_invest_with_offset_multi_period.lp | 8 +- ...rage_invest_without_offset_multi_period.lp | 8 +- 13 files changed, 641 insertions(+), 597 deletions(-) diff --git a/tests/lp_files/connect_investment_multi_period.lp b/tests/lp_files/connect_investment_multi_period.lp index 9fb2ea73f..cc22c48bc 100644 --- a/tests/lp_files/connect_investment_multi_period.lp +++ b/tests/lp_files/connect_investment_multi_period.lp @@ -2,12 +2,12 @@ min objective: -+520.1320088877258 InvestmentFlowBlock_invest(Bus1_Sink_0) -+509.93334204678996 InvestmentFlowBlock_invest(Bus1_Sink_1) -+499.9346490654803 InvestmentFlowBlock_invest(Bus1_Sink_2) +127.95247418638057 InvestmentFlowBlock_invest(Source_Bus1_0) +125.44360214351036 InvestmentFlowBlock_invest(Source_Bus1_1) +122.9839236701082 InvestmentFlowBlock_invest(Source_Bus1_2) ++520.1320088877258 InvestmentFlowBlock_invest(Bus1_Sink_0) ++509.93334204678996 InvestmentFlowBlock_invest(Bus1_Sink_1) ++499.9346490654803 InvestmentFlowBlock_invest(Bus1_Sink_2) +150.83828257744048 GenericInvestmentStorageBlock_invest(storage_0) +147.8806691935691 GenericInvestmentStorageBlock_invest(storage_1) +144.9810482289893 GenericInvestmentStorageBlock_invest(storage_2) @@ -15,8 +15,8 @@ objective: s.t. c_e__equate_InvestmentFlowBlock_invest(Source_Bus1_0)_InvestmentFlowBlock_invest(Bus1_Sink_0)__: --1 InvestmentFlowBlock_invest(Bus1_Sink_0) +2 InvestmentFlowBlock_invest(Source_Bus1_0) +-1 InvestmentFlowBlock_invest(Bus1_Sink_0) = 0 c_e__equate_InvestmentFlowBlock_invest(Source_Bus1_0)_GenericInvestmentStorageBlock_invest(storage_0)__: @@ -25,85 +25,47 @@ c_e__equate_InvestmentFlowBlock_invest(Source_Bus1_0)_GenericInvestmentStorageBl = 0 c_e_BusBlock_balance(Bus1_0_0)_: -+1 flow(Source_Bus1_0_0) +1 flow(storage_Bus1_0_0) ++1 flow(Source_Bus1_0_0) -1 flow(Bus1_storage_0_0) -1 flow(Bus1_Sink_0_0) = 0 c_e_BusBlock_balance(Bus1_0_1)_: -+1 flow(Source_Bus1_0_1) +1 flow(storage_Bus1_0_1) ++1 flow(Source_Bus1_0_1) -1 flow(Bus1_storage_0_1) -1 flow(Bus1_Sink_0_1) = 0 c_e_BusBlock_balance(Bus1_1_2)_: -+1 flow(Source_Bus1_1_2) +1 flow(storage_Bus1_1_2) ++1 flow(Source_Bus1_1_2) -1 flow(Bus1_storage_1_2) -1 flow(Bus1_Sink_1_2) = 0 c_e_BusBlock_balance(Bus1_1_3)_: -+1 flow(Source_Bus1_1_3) +1 flow(storage_Bus1_1_3) ++1 flow(Source_Bus1_1_3) -1 flow(Bus1_storage_1_3) -1 flow(Bus1_Sink_1_3) = 0 c_e_BusBlock_balance(Bus1_2_4)_: -+1 flow(Source_Bus1_2_4) +1 flow(storage_Bus1_2_4) ++1 flow(Source_Bus1_2_4) -1 flow(Bus1_storage_2_4) -1 flow(Bus1_Sink_2_4) = 0 c_e_BusBlock_balance(Bus1_2_5)_: -+1 flow(Source_Bus1_2_5) +1 flow(storage_Bus1_2_5) ++1 flow(Source_Bus1_2_5) -1 flow(Bus1_storage_2_5) -1 flow(Bus1_Sink_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(storage_Bus1_0)_: -+1 InvestmentFlowBlock_total(storage_Bus1_0) --1 InvestmentFlowBlock_invest(storage_Bus1_0) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage_Bus1_1)_: --1 InvestmentFlowBlock_total(storage_Bus1_0) -+1 InvestmentFlowBlock_total(storage_Bus1_1) --1 InvestmentFlowBlock_invest(storage_Bus1_1) -+1 InvestmentFlowBlock_old(storage_Bus1_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage_Bus1_2)_: --1 InvestmentFlowBlock_total(storage_Bus1_1) -+1 InvestmentFlowBlock_total(storage_Bus1_2) --1 InvestmentFlowBlock_invest(storage_Bus1_2) -+1 InvestmentFlowBlock_old(storage_Bus1_2) -= 0 - -c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_0)_: --1 InvestmentFlowBlock_invest(Bus1_Sink_0) -+1 InvestmentFlowBlock_total(Bus1_Sink_0) -= 0 - -c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_1)_: --1 InvestmentFlowBlock_invest(Bus1_Sink_1) --1 InvestmentFlowBlock_total(Bus1_Sink_0) -+1 InvestmentFlowBlock_total(Bus1_Sink_1) -+1 InvestmentFlowBlock_old(Bus1_Sink_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_2)_: --1 InvestmentFlowBlock_invest(Bus1_Sink_2) --1 InvestmentFlowBlock_total(Bus1_Sink_1) -+1 InvestmentFlowBlock_total(Bus1_Sink_2) -+1 InvestmentFlowBlock_old(Bus1_Sink_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(Source_Bus1_0)_: -1 InvestmentFlowBlock_invest(Source_Bus1_0) +1 InvestmentFlowBlock_total(Source_Bus1_0) @@ -142,28 +104,42 @@ c_e_InvestmentFlowBlock_total_rule(Bus1_storage_2)_: +1 InvestmentFlowBlock_old(Bus1_storage_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_Bus1_0)_: -+1 InvestmentFlowBlock_old_end(storage_Bus1_0) +c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_0)_: +-1 InvestmentFlowBlock_invest(Bus1_Sink_0) ++1 InvestmentFlowBlock_total(Bus1_Sink_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_Bus1_1)_: -+1 InvestmentFlowBlock_old_end(storage_Bus1_1) +c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_1)_: +-1 InvestmentFlowBlock_invest(Bus1_Sink_1) +-1 InvestmentFlowBlock_total(Bus1_Sink_0) ++1 InvestmentFlowBlock_total(Bus1_Sink_1) ++1 InvestmentFlowBlock_old(Bus1_Sink_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_Bus1_2)_: -+1 InvestmentFlowBlock_old_end(storage_Bus1_2) +c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_2)_: +-1 InvestmentFlowBlock_invest(Bus1_Sink_2) +-1 InvestmentFlowBlock_total(Bus1_Sink_1) ++1 InvestmentFlowBlock_total(Bus1_Sink_2) ++1 InvestmentFlowBlock_old(Bus1_Sink_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_0)_: -+1 InvestmentFlowBlock_old_end(Bus1_Sink_0) +c_e_InvestmentFlowBlock_total_rule(storage_Bus1_0)_: ++1 InvestmentFlowBlock_total(storage_Bus1_0) +-1 InvestmentFlowBlock_invest(storage_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_1)_: -+1 InvestmentFlowBlock_old_end(Bus1_Sink_1) +c_e_InvestmentFlowBlock_total_rule(storage_Bus1_1)_: +-1 InvestmentFlowBlock_total(storage_Bus1_0) ++1 InvestmentFlowBlock_total(storage_Bus1_1) +-1 InvestmentFlowBlock_invest(storage_Bus1_1) ++1 InvestmentFlowBlock_old(storage_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_2)_: -+1 InvestmentFlowBlock_old_end(Bus1_Sink_2) +c_e_InvestmentFlowBlock_total_rule(storage_Bus1_2)_: +-1 InvestmentFlowBlock_total(storage_Bus1_1) ++1 InvestmentFlowBlock_total(storage_Bus1_2) +-1 InvestmentFlowBlock_invest(storage_Bus1_2) ++1 InvestmentFlowBlock_old(storage_Bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_0)_: @@ -190,28 +166,28 @@ c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_2)_: +1 InvestmentFlowBlock_old_end(Bus1_storage_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_Bus1_0)_: -+1 InvestmentFlowBlock_old_exo(storage_Bus1_0) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_0)_: ++1 InvestmentFlowBlock_old_end(Bus1_Sink_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_Bus1_1)_: -+1 InvestmentFlowBlock_old_exo(storage_Bus1_1) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_1)_: ++1 InvestmentFlowBlock_old_end(Bus1_Sink_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_Bus1_2)_: -+1 InvestmentFlowBlock_old_exo(storage_Bus1_2) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_2)_: ++1 InvestmentFlowBlock_old_end(Bus1_Sink_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_0)_: -+1 InvestmentFlowBlock_old_exo(Bus1_Sink_0) +c_e_InvestmentFlowBlock_old_rule_end(storage_Bus1_0)_: ++1 InvestmentFlowBlock_old_end(storage_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_1)_: -+1 InvestmentFlowBlock_old_exo(Bus1_Sink_1) +c_e_InvestmentFlowBlock_old_rule_end(storage_Bus1_1)_: ++1 InvestmentFlowBlock_old_end(storage_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_2)_: -+1 InvestmentFlowBlock_old_exo(Bus1_Sink_2) +c_e_InvestmentFlowBlock_old_rule_end(storage_Bus1_2)_: ++1 InvestmentFlowBlock_old_end(storage_Bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_0)_: @@ -238,40 +214,28 @@ c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_2)_: +1 InvestmentFlowBlock_old_exo(Bus1_storage_2) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_Bus1_0)_: --1 InvestmentFlowBlock_old_end(storage_Bus1_0) --1 InvestmentFlowBlock_old_exo(storage_Bus1_0) -+1 InvestmentFlowBlock_old(storage_Bus1_0) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_0)_: ++1 InvestmentFlowBlock_old_exo(Bus1_Sink_0) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_Bus1_1)_: -+1 InvestmentFlowBlock_old(storage_Bus1_1) --1 InvestmentFlowBlock_old_end(storage_Bus1_1) --1 InvestmentFlowBlock_old_exo(storage_Bus1_1) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_1)_: ++1 InvestmentFlowBlock_old_exo(Bus1_Sink_1) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_Bus1_2)_: -+1 InvestmentFlowBlock_old(storage_Bus1_2) --1 InvestmentFlowBlock_old_end(storage_Bus1_2) --1 InvestmentFlowBlock_old_exo(storage_Bus1_2) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_2)_: ++1 InvestmentFlowBlock_old_exo(Bus1_Sink_2) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_0)_: --1 InvestmentFlowBlock_old_end(Bus1_Sink_0) --1 InvestmentFlowBlock_old_exo(Bus1_Sink_0) -+1 InvestmentFlowBlock_old(Bus1_Sink_0) +c_e_InvestmentFlowBlock_old_rule_exo(storage_Bus1_0)_: ++1 InvestmentFlowBlock_old_exo(storage_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_1)_: -+1 InvestmentFlowBlock_old(Bus1_Sink_1) --1 InvestmentFlowBlock_old_end(Bus1_Sink_1) --1 InvestmentFlowBlock_old_exo(Bus1_Sink_1) +c_e_InvestmentFlowBlock_old_rule_exo(storage_Bus1_1)_: ++1 InvestmentFlowBlock_old_exo(storage_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_2)_: -+1 InvestmentFlowBlock_old(Bus1_Sink_2) --1 InvestmentFlowBlock_old_end(Bus1_Sink_2) --1 InvestmentFlowBlock_old_exo(Bus1_Sink_2) +c_e_InvestmentFlowBlock_old_rule_exo(storage_Bus1_2)_: ++1 InvestmentFlowBlock_old_exo(storage_Bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule(Source_Bus1_0)_: @@ -310,65 +274,41 @@ c_e_InvestmentFlowBlock_old_rule(Bus1_storage_2)_: -1 InvestmentFlowBlock_old_exo(Bus1_storage_2) = 0 -c_u_InvestmentFlowBlock_max(storage_Bus1_0_0)_: -+1 flow(storage_Bus1_0_0) --1 InvestmentFlowBlock_total(storage_Bus1_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_Bus1_0_1)_: -+1 flow(storage_Bus1_0_1) --1 InvestmentFlowBlock_total(storage_Bus1_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_Bus1_1_2)_: -+1 flow(storage_Bus1_1_2) --1 InvestmentFlowBlock_total(storage_Bus1_1) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_Bus1_1_3)_: -+1 flow(storage_Bus1_1_3) --1 InvestmentFlowBlock_total(storage_Bus1_1) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_Bus1_2_4)_: -+1 flow(storage_Bus1_2_4) --1 InvestmentFlowBlock_total(storage_Bus1_2) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_Bus1_2_5)_: -+1 flow(storage_Bus1_2_5) --1 InvestmentFlowBlock_total(storage_Bus1_2) -<= 0 - -c_u_InvestmentFlowBlock_max(Bus1_Sink_0_0)_: -+1 flow(Bus1_Sink_0_0) --1 InvestmentFlowBlock_total(Bus1_Sink_0) -<= 0 +c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_0)_: +-1 InvestmentFlowBlock_old_end(Bus1_Sink_0) +-1 InvestmentFlowBlock_old_exo(Bus1_Sink_0) ++1 InvestmentFlowBlock_old(Bus1_Sink_0) += 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_0_1)_: -+1 flow(Bus1_Sink_0_1) --1 InvestmentFlowBlock_total(Bus1_Sink_0) -<= 0 +c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_1)_: ++1 InvestmentFlowBlock_old(Bus1_Sink_1) +-1 InvestmentFlowBlock_old_end(Bus1_Sink_1) +-1 InvestmentFlowBlock_old_exo(Bus1_Sink_1) += 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_1_2)_: -+1 flow(Bus1_Sink_1_2) --1 InvestmentFlowBlock_total(Bus1_Sink_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_2)_: ++1 InvestmentFlowBlock_old(Bus1_Sink_2) +-1 InvestmentFlowBlock_old_end(Bus1_Sink_2) +-1 InvestmentFlowBlock_old_exo(Bus1_Sink_2) += 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_1_3)_: -+1 flow(Bus1_Sink_1_3) --1 InvestmentFlowBlock_total(Bus1_Sink_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_Bus1_0)_: +-1 InvestmentFlowBlock_old_end(storage_Bus1_0) +-1 InvestmentFlowBlock_old_exo(storage_Bus1_0) ++1 InvestmentFlowBlock_old(storage_Bus1_0) += 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_2_4)_: -+1 flow(Bus1_Sink_2_4) --1 InvestmentFlowBlock_total(Bus1_Sink_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_Bus1_1)_: ++1 InvestmentFlowBlock_old(storage_Bus1_1) +-1 InvestmentFlowBlock_old_end(storage_Bus1_1) +-1 InvestmentFlowBlock_old_exo(storage_Bus1_1) += 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_2_5)_: -+1 flow(Bus1_Sink_2_5) --1 InvestmentFlowBlock_total(Bus1_Sink_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_Bus1_2)_: ++1 InvestmentFlowBlock_old(storage_Bus1_2) +-1 InvestmentFlowBlock_old_end(storage_Bus1_2) +-1 InvestmentFlowBlock_old_exo(storage_Bus1_2) += 0 c_u_InvestmentFlowBlock_max(Source_Bus1_0_0)_: +1 flow(Source_Bus1_0_0) @@ -430,6 +370,66 @@ c_u_InvestmentFlowBlock_max(Bus1_storage_2_5)_: -1 InvestmentFlowBlock_total(Bus1_storage_2) <= 0 +c_u_InvestmentFlowBlock_max(Bus1_Sink_0_0)_: ++1 flow(Bus1_Sink_0_0) +-1 InvestmentFlowBlock_total(Bus1_Sink_0) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_Sink_0_1)_: ++1 flow(Bus1_Sink_0_1) +-1 InvestmentFlowBlock_total(Bus1_Sink_0) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_Sink_1_2)_: ++1 flow(Bus1_Sink_1_2) +-1 InvestmentFlowBlock_total(Bus1_Sink_1) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_Sink_1_3)_: ++1 flow(Bus1_Sink_1_3) +-1 InvestmentFlowBlock_total(Bus1_Sink_1) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_Sink_2_4)_: ++1 flow(Bus1_Sink_2_4) +-1 InvestmentFlowBlock_total(Bus1_Sink_2) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_Sink_2_5)_: ++1 flow(Bus1_Sink_2_5) +-1 InvestmentFlowBlock_total(Bus1_Sink_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_Bus1_0_0)_: ++1 flow(storage_Bus1_0_0) +-1 InvestmentFlowBlock_total(storage_Bus1_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_Bus1_0_1)_: ++1 flow(storage_Bus1_0_1) +-1 InvestmentFlowBlock_total(storage_Bus1_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_Bus1_1_2)_: ++1 flow(storage_Bus1_1_2) +-1 InvestmentFlowBlock_total(storage_Bus1_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_Bus1_1_3)_: ++1 flow(storage_Bus1_1_3) +-1 InvestmentFlowBlock_total(storage_Bus1_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_Bus1_2_4)_: ++1 flow(storage_Bus1_2_4) +-1 InvestmentFlowBlock_total(storage_Bus1_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_Bus1_2_5)_: ++1 flow(storage_Bus1_2_5) +-1 InvestmentFlowBlock_total(storage_Bus1_2) +<= 0 + c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_0)_: -1 GenericInvestmentStorageBlock_invest(storage_0) +1 GenericInvestmentStorageBlock_total(storage_0) @@ -491,11 +491,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage_0_1)_: +1 flow(storage_Bus1_0_1) -1 flow(Bus1_storage_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage_1) -1 GenericInvestmentStorageBlock_storage_content(storage_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage_1_2)_: @@ -587,52 +591,39 @@ c_u_GenericInvestmentStorageBlock_max_storage_content(storage_2_5)_: <= 0 bounds - 0 <= InvestmentFlowBlock_invest(Bus1_Sink_0) <= +inf - 0 <= InvestmentFlowBlock_invest(Bus1_Sink_1) <= +inf - 0 <= InvestmentFlowBlock_invest(Bus1_Sink_2) <= +inf 0 <= InvestmentFlowBlock_invest(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_invest(Source_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_invest(Source_Bus1_2) <= +inf + 0 <= InvestmentFlowBlock_invest(Bus1_Sink_0) <= +inf + 0 <= InvestmentFlowBlock_invest(Bus1_Sink_1) <= +inf + 0 <= InvestmentFlowBlock_invest(Bus1_Sink_2) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage_0) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage_1) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage_2) <= +inf - 0 <= flow(Source_Bus1_0_0) <= +inf 0 <= flow(storage_Bus1_0_0) <= +inf + 0 <= flow(Source_Bus1_0_0) <= +inf 0 <= flow(Bus1_storage_0_0) <= +inf 0 <= flow(Bus1_Sink_0_0) <= +inf - 0 <= flow(Source_Bus1_0_1) <= +inf 0 <= flow(storage_Bus1_0_1) <= +inf + 0 <= flow(Source_Bus1_0_1) <= +inf 0 <= flow(Bus1_storage_0_1) <= +inf 0 <= flow(Bus1_Sink_0_1) <= +inf - 0 <= flow(Source_Bus1_1_2) <= +inf 0 <= flow(storage_Bus1_1_2) <= +inf + 0 <= flow(Source_Bus1_1_2) <= +inf 0 <= flow(Bus1_storage_1_2) <= +inf 0 <= flow(Bus1_Sink_1_2) <= +inf - 0 <= flow(Source_Bus1_1_3) <= +inf 0 <= flow(storage_Bus1_1_3) <= +inf + 0 <= flow(Source_Bus1_1_3) <= +inf 0 <= flow(Bus1_storage_1_3) <= +inf 0 <= flow(Bus1_Sink_1_3) <= +inf - 0 <= flow(Source_Bus1_2_4) <= +inf 0 <= flow(storage_Bus1_2_4) <= +inf + 0 <= flow(Source_Bus1_2_4) <= +inf 0 <= flow(Bus1_storage_2_4) <= +inf 0 <= flow(Bus1_Sink_2_4) <= +inf - 0 <= flow(Source_Bus1_2_5) <= +inf 0 <= flow(storage_Bus1_2_5) <= +inf + 0 <= flow(Source_Bus1_2_5) <= +inf 0 <= flow(Bus1_storage_2_5) <= +inf 0 <= flow(Bus1_Sink_2_5) <= +inf - 0 <= InvestmentFlowBlock_total(storage_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_total(storage_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old(storage_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_total(storage_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_Sink_0) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_Sink_1) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_Sink_1) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_Sink_2) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_Sink_2) <= +inf 0 <= InvestmentFlowBlock_total(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_total(Source_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old(Source_Bus1_1) <= +inf @@ -646,34 +637,47 @@ bounds 0 <= InvestmentFlowBlock_total(Bus1_storage_2) <= +inf 0 <= InvestmentFlowBlock_invest(Bus1_storage_2) <= +inf 0 <= InvestmentFlowBlock_old(Bus1_storage_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_Sink_0) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_Sink_1) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_Sink_1) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_total(storage_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_total(storage_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old(storage_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_total(storage_Bus1_2) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_Bus1_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_end(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_end(Source_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_end(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_storage_0) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_storage_1) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_storage_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_Sink_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old(Bus1_storage_0) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_Sink_0) <= +inf + 0 <= InvestmentFlowBlock_old(storage_Bus1_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_1) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_1) <= +inf @@ -686,8 +690,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_4) <= +inf diff --git a/tests/lp_files/periodical_investment_limit.lp b/tests/lp_files/periodical_investment_limit.lp index 99a8eb737..b6c76060f 100644 --- a/tests/lp_files/periodical_investment_limit.lp +++ b/tests/lp_files/periodical_investment_limit.lp @@ -27,60 +27,41 @@ c_u_investment_limit_per_period(2)_: <= 300 c_e_BusBlock_balance(Bus1_0_0)_: -+1 flow(Source_Bus1_0_0) +1 flow(storage_invest_limit_Bus1_0_0) ++1 flow(Source_Bus1_0_0) -1 flow(Bus1_storage_invest_limit_0_0) = 0 c_e_BusBlock_balance(Bus1_0_1)_: -+1 flow(Source_Bus1_0_1) +1 flow(storage_invest_limit_Bus1_0_1) ++1 flow(Source_Bus1_0_1) -1 flow(Bus1_storage_invest_limit_0_1) = 0 c_e_BusBlock_balance(Bus1_1_2)_: -+1 flow(Source_Bus1_1_2) +1 flow(storage_invest_limit_Bus1_1_2) ++1 flow(Source_Bus1_1_2) -1 flow(Bus1_storage_invest_limit_1_2) = 0 c_e_BusBlock_balance(Bus1_1_3)_: -+1 flow(Source_Bus1_1_3) +1 flow(storage_invest_limit_Bus1_1_3) ++1 flow(Source_Bus1_1_3) -1 flow(Bus1_storage_invest_limit_1_3) = 0 c_e_BusBlock_balance(Bus1_2_4)_: -+1 flow(Source_Bus1_2_4) +1 flow(storage_invest_limit_Bus1_2_4) ++1 flow(Source_Bus1_2_4) -1 flow(Bus1_storage_invest_limit_2_4) = 0 c_e_BusBlock_balance(Bus1_2_5)_: -+1 flow(Source_Bus1_2_5) +1 flow(storage_invest_limit_Bus1_2_5) ++1 flow(Source_Bus1_2_5) -1 flow(Bus1_storage_invest_limit_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(Bus1_storage_invest_limit_0)_: -+1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) --1 InvestmentFlowBlock_invest(Bus1_storage_invest_limit_0) -= 0 - -c_e_InvestmentFlowBlock_total_rule(Bus1_storage_invest_limit_1)_: --1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) -+1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) --1 InvestmentFlowBlock_invest(Bus1_storage_invest_limit_1) -+1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(Bus1_storage_invest_limit_2)_: --1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) -+1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) --1 InvestmentFlowBlock_invest(Bus1_storage_invest_limit_2) -+1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(storage_invest_limit_Bus1_0)_: +1 InvestmentFlowBlock_total(storage_invest_limit_Bus1_0) -1 InvestmentFlowBlock_invest(storage_invest_limit_Bus1_0) @@ -119,16 +100,23 @@ c_e_InvestmentFlowBlock_total_rule(Source_Bus1_2)_: +1 InvestmentFlowBlock_old(Source_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_invest_limit_0)_: -+1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_0) +c_e_InvestmentFlowBlock_total_rule(Bus1_storage_invest_limit_0)_: ++1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) +-1 InvestmentFlowBlock_invest(Bus1_storage_invest_limit_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_invest_limit_1)_: -+1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_1) +c_e_InvestmentFlowBlock_total_rule(Bus1_storage_invest_limit_1)_: +-1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) ++1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) +-1 InvestmentFlowBlock_invest(Bus1_storage_invest_limit_1) ++1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_invest_limit_2)_: -+1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_2) +c_e_InvestmentFlowBlock_total_rule(Bus1_storage_invest_limit_2)_: +-1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) ++1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) +-1 InvestmentFlowBlock_invest(Bus1_storage_invest_limit_2) ++1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(storage_invest_limit_Bus1_0)_: @@ -155,16 +143,16 @@ c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_2)_: +1 InvestmentFlowBlock_old_end(Source_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_invest_limit_0)_: -+1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_0) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_invest_limit_0)_: ++1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_invest_limit_1)_: -+1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_1) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_invest_limit_1)_: ++1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_invest_limit_2)_: -+1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_invest_limit_2)_: ++1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(storage_invest_limit_Bus1_0)_: @@ -191,22 +179,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_2)_: +1 InvestmentFlowBlock_old_exo(Source_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_storage_invest_limit_0)_: --1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_0) --1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_0) -+1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_0) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_invest_limit_0)_: ++1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_0) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_storage_invest_limit_1)_: -+1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_1) --1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_1) --1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_1) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_invest_limit_1)_: ++1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_1) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_storage_invest_limit_2)_: -+1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_2) --1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_2) --1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_invest_limit_2)_: ++1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) = 0 c_e_InvestmentFlowBlock_old_rule(storage_invest_limit_Bus1_0)_: @@ -245,35 +227,23 @@ c_e_InvestmentFlowBlock_old_rule(Source_Bus1_2)_: -1 InvestmentFlowBlock_old_exo(Source_Bus1_2) = 0 -c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_0_0)_: -+1 flow(Bus1_storage_invest_limit_0_0) --1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) -<= 0 - -c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_0_1)_: -+1 flow(Bus1_storage_invest_limit_0_1) --1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) -<= 0 - -c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_1_2)_: -+1 flow(Bus1_storage_invest_limit_1_2) --1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) -<= 0 - -c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_1_3)_: -+1 flow(Bus1_storage_invest_limit_1_3) --1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(Bus1_storage_invest_limit_0)_: +-1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_0) +-1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_0) ++1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_0) += 0 -c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_2_4)_: -+1 flow(Bus1_storage_invest_limit_2_4) --1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(Bus1_storage_invest_limit_1)_: ++1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_1) +-1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_1) +-1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_1) += 0 -c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_2_5)_: -+1 flow(Bus1_storage_invest_limit_2_5) --1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(Bus1_storage_invest_limit_2)_: ++1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_2) +-1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_2) +-1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) += 0 c_u_InvestmentFlowBlock_max(storage_invest_limit_Bus1_0_0)_: +1 flow(storage_invest_limit_Bus1_0_0) @@ -335,6 +305,36 @@ c_u_InvestmentFlowBlock_max(Source_Bus1_2_5)_: -1 InvestmentFlowBlock_total(Source_Bus1_2) <= 0 +c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_0_0)_: ++1 flow(Bus1_storage_invest_limit_0_0) +-1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_0_1)_: ++1 flow(Bus1_storage_invest_limit_0_1) +-1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_1_2)_: ++1 flow(Bus1_storage_invest_limit_1_2) +-1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_1_3)_: ++1 flow(Bus1_storage_invest_limit_1_3) +-1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_2_4)_: ++1 flow(Bus1_storage_invest_limit_2_4) +-1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) +<= 0 + +c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_2_5)_: ++1 flow(Bus1_storage_invest_limit_2_5) +-1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) +<= 0 + c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_invest_limit_0)_: -1 GenericInvestmentStorageBlock_invest(storage_invest_limit_0) +1 GenericInvestmentStorageBlock_total(storage_invest_limit_0) @@ -396,11 +396,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage_invest_limit_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage_invest_limit_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage_invest_limit_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage_invest_limit_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage_invest_limit_0_1)_: +1 flow(storage_invest_limit_Bus1_0_1) -1 flow(Bus1_storage_invest_limit_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage_invest_limit_1) -1 GenericInvestmentStorageBlock_storage_content(storage_invest_limit_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_invest_limit_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage_invest_limit_1_2)_: @@ -498,32 +502,24 @@ bounds 0 <= GenericInvestmentStorageBlock_invest(storage_invest_limit_0) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage_invest_limit_1) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage_invest_limit_2) <= +inf - 0 <= flow(Source_Bus1_0_0) <= +inf 0 <= flow(storage_invest_limit_Bus1_0_0) <= +inf + 0 <= flow(Source_Bus1_0_0) <= +inf 0 <= flow(Bus1_storage_invest_limit_0_0) <= +inf - 0 <= flow(Source_Bus1_0_1) <= +inf 0 <= flow(storage_invest_limit_Bus1_0_1) <= +inf + 0 <= flow(Source_Bus1_0_1) <= +inf 0 <= flow(Bus1_storage_invest_limit_0_1) <= +inf - 0 <= flow(Source_Bus1_1_2) <= +inf 0 <= flow(storage_invest_limit_Bus1_1_2) <= +inf + 0 <= flow(Source_Bus1_1_2) <= +inf 0 <= flow(Bus1_storage_invest_limit_1_2) <= +inf - 0 <= flow(Source_Bus1_1_3) <= +inf 0 <= flow(storage_invest_limit_Bus1_1_3) <= +inf + 0 <= flow(Source_Bus1_1_3) <= +inf 0 <= flow(Bus1_storage_invest_limit_1_3) <= +inf - 0 <= flow(Source_Bus1_2_4) <= +inf 0 <= flow(storage_invest_limit_Bus1_2_4) <= +inf + 0 <= flow(Source_Bus1_2_4) <= +inf 0 <= flow(Bus1_storage_invest_limit_2_4) <= +inf - 0 <= flow(Source_Bus1_2_5) <= +inf 0 <= flow(storage_invest_limit_Bus1_2_5) <= +inf + 0 <= flow(Source_Bus1_2_5) <= +inf 0 <= flow(Bus1_storage_invest_limit_2_5) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) <= +inf - 0 <= InvestmentFlowBlock_invest(Bus1_storage_invest_limit_0) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) <= +inf - 0 <= InvestmentFlowBlock_invest(Bus1_storage_invest_limit_1) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_storage_invest_limit_1) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) <= +inf - 0 <= InvestmentFlowBlock_invest(Bus1_storage_invest_limit_2) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_storage_invest_limit_2) <= +inf 0 <= InvestmentFlowBlock_total(storage_invest_limit_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_invest(storage_invest_limit_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_total(storage_invest_limit_Bus1_1) <= +inf @@ -537,27 +533,35 @@ bounds 0 <= InvestmentFlowBlock_old(Source_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_total(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old(Source_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_2) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) <= +inf + 0 <= InvestmentFlowBlock_invest(Bus1_storage_invest_limit_0) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) <= +inf + 0 <= InvestmentFlowBlock_invest(Bus1_storage_invest_limit_1) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_storage_invest_limit_1) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) <= +inf + 0 <= InvestmentFlowBlock_invest(Bus1_storage_invest_limit_2) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_storage_invest_limit_2) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_end(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_end(Source_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_end(Source_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_storage_invest_limit_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) <= +inf 0 <= InvestmentFlowBlock_old(storage_invest_limit_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old(Source_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_storage_invest_limit_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_invest_limit_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_invest_limit_1) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_invest_limit_1) <= +inf @@ -570,8 +574,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage_invest_limit_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage_invest_limit_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_invest_limit_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage_invest_limit_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_invest_limit_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_invest_limit_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_invest_limit_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_invest_limit_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_invest_limit_4) <= +inf diff --git a/tests/lp_files/storage_invest_1_multi_period.lp b/tests/lp_files/storage_invest_1_multi_period.lp index ec9897a28..35c7ff688 100644 --- a/tests/lp_files/storage_invest_1_multi_period.lp +++ b/tests/lp_files/storage_invest_1_multi_period.lp @@ -293,11 +293,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage1_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage1_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage1_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage1_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage1_0_1)_: -0.97 flow(electricityBus_storage1_0_1) +1.1627906976744187 flow(storage1_electricityBus_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage1_1) -0.87 GenericInvestmentStorageBlock_storage_content(storage1_0) ++1 GenericInvestmentStorageBlock_storage_content(storage1_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage1_1_2)_: @@ -492,8 +496,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage1_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage1_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_4) <= +inf diff --git a/tests/lp_files/storage_invest_2_multi_period.lp b/tests/lp_files/storage_invest_2_multi_period.lp index 3c1e1d058..2331318ef 100644 --- a/tests/lp_files/storage_invest_2_multi_period.lp +++ b/tests/lp_files/storage_invest_2_multi_period.lp @@ -287,11 +287,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage2_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage2_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage2_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage2_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage2_0_1)_: +1 flow(storage2_electricityBus_0_1) -1 flow(electricityBus_storage2_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage2_1) -1 GenericInvestmentStorageBlock_storage_content(storage2_0) ++1 GenericInvestmentStorageBlock_storage_content(storage2_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage2_1_2)_: @@ -410,8 +414,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage2_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage2_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage2_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage2_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage2_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage2_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage2_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage2_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage2_4) <= +inf diff --git a/tests/lp_files/storage_invest_3_multi_period.lp b/tests/lp_files/storage_invest_3_multi_period.lp index 51410232d..2fc9750d0 100644 --- a/tests/lp_files/storage_invest_3_multi_period.lp +++ b/tests/lp_files/storage_invest_3_multi_period.lp @@ -2,12 +2,12 @@ min objective: -+11.00820926255226 InvestmentFlowBlock_invest(storage3_electricityBus_0) -+10.792362022110058 InvestmentFlowBlock_invest(storage3_electricityBus_1) -+10.580747080500057 InvestmentFlowBlock_invest(storage3_electricityBus_2) +101.97980198019803 InvestmentFlowBlock_invest(electricityBus_storage3_0) +99.98019801980199 InvestmentFlowBlock_invest(electricityBus_storage3_1) +98.01980198019803 InvestmentFlowBlock_invest(electricityBus_storage3_2) ++11.00820926255226 InvestmentFlowBlock_invest(storage3_electricityBus_0) ++10.792362022110058 InvestmentFlowBlock_invest(storage3_electricityBus_1) ++10.580747080500057 InvestmentFlowBlock_invest(storage3_electricityBus_2) s.t. @@ -41,25 +41,6 @@ c_e_BusBlock_balance(electricityBus_2_5)_: -1 flow(electricityBus_storage3_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(storage3_electricityBus_0)_: --1 InvestmentFlowBlock_invest(storage3_electricityBus_0) -+1 InvestmentFlowBlock_total(storage3_electricityBus_0) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage3_electricityBus_1)_: --1 InvestmentFlowBlock_invest(storage3_electricityBus_1) --1 InvestmentFlowBlock_total(storage3_electricityBus_0) -+1 InvestmentFlowBlock_total(storage3_electricityBus_1) -+1 InvestmentFlowBlock_old(storage3_electricityBus_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage3_electricityBus_2)_: --1 InvestmentFlowBlock_invest(storage3_electricityBus_2) --1 InvestmentFlowBlock_total(storage3_electricityBus_1) -+1 InvestmentFlowBlock_total(storage3_electricityBus_2) -+1 InvestmentFlowBlock_old(storage3_electricityBus_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(electricityBus_storage3_0)_: -1 InvestmentFlowBlock_invest(electricityBus_storage3_0) +1 InvestmentFlowBlock_total(electricityBus_storage3_0) @@ -79,16 +60,23 @@ c_e_InvestmentFlowBlock_total_rule(electricityBus_storage3_2)_: +1 InvestmentFlowBlock_old(electricityBus_storage3_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage3_electricityBus_0)_: -+1 InvestmentFlowBlock_old_end(storage3_electricityBus_0) +c_e_InvestmentFlowBlock_total_rule(storage3_electricityBus_0)_: +-1 InvestmentFlowBlock_invest(storage3_electricityBus_0) ++1 InvestmentFlowBlock_total(storage3_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage3_electricityBus_1)_: -+1 InvestmentFlowBlock_old_end(storage3_electricityBus_1) +c_e_InvestmentFlowBlock_total_rule(storage3_electricityBus_1)_: +-1 InvestmentFlowBlock_invest(storage3_electricityBus_1) +-1 InvestmentFlowBlock_total(storage3_electricityBus_0) ++1 InvestmentFlowBlock_total(storage3_electricityBus_1) ++1 InvestmentFlowBlock_old(storage3_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage3_electricityBus_2)_: -+1 InvestmentFlowBlock_old_end(storage3_electricityBus_2) +c_e_InvestmentFlowBlock_total_rule(storage3_electricityBus_2)_: +-1 InvestmentFlowBlock_invest(storage3_electricityBus_2) +-1 InvestmentFlowBlock_total(storage3_electricityBus_1) ++1 InvestmentFlowBlock_total(storage3_electricityBus_2) ++1 InvestmentFlowBlock_old(storage3_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage3_0)_: @@ -104,16 +92,16 @@ c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage3_2)_: +1 InvestmentFlowBlock_old_end(electricityBus_storage3_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage3_electricityBus_0)_: -+1 InvestmentFlowBlock_old_exo(storage3_electricityBus_0) +c_e_InvestmentFlowBlock_old_rule_end(storage3_electricityBus_0)_: ++1 InvestmentFlowBlock_old_end(storage3_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage3_electricityBus_1)_: -+1 InvestmentFlowBlock_old_exo(storage3_electricityBus_1) +c_e_InvestmentFlowBlock_old_rule_end(storage3_electricityBus_1)_: ++1 InvestmentFlowBlock_old_end(storage3_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage3_electricityBus_2)_: -+1 InvestmentFlowBlock_old_exo(storage3_electricityBus_2) +c_e_InvestmentFlowBlock_old_rule_end(storage3_electricityBus_2)_: ++1 InvestmentFlowBlock_old_end(storage3_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage3_0)_: @@ -128,22 +116,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage3_2)_: +1 InvestmentFlowBlock_old_exo(electricityBus_storage3_2) = 0 -c_e_InvestmentFlowBlock_old_rule(storage3_electricityBus_0)_: --1 InvestmentFlowBlock_old_end(storage3_electricityBus_0) --1 InvestmentFlowBlock_old_exo(storage3_electricityBus_0) -+1 InvestmentFlowBlock_old(storage3_electricityBus_0) +c_e_InvestmentFlowBlock_old_rule_exo(storage3_electricityBus_0)_: ++1 InvestmentFlowBlock_old_exo(storage3_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule(storage3_electricityBus_1)_: -+1 InvestmentFlowBlock_old(storage3_electricityBus_1) --1 InvestmentFlowBlock_old_end(storage3_electricityBus_1) --1 InvestmentFlowBlock_old_exo(storage3_electricityBus_1) +c_e_InvestmentFlowBlock_old_rule_exo(storage3_electricityBus_1)_: ++1 InvestmentFlowBlock_old_exo(storage3_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule(storage3_electricityBus_2)_: -+1 InvestmentFlowBlock_old(storage3_electricityBus_2) --1 InvestmentFlowBlock_old_end(storage3_electricityBus_2) --1 InvestmentFlowBlock_old_exo(storage3_electricityBus_2) +c_e_InvestmentFlowBlock_old_rule_exo(storage3_electricityBus_2)_: ++1 InvestmentFlowBlock_old_exo(storage3_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule(electricityBus_storage3_0)_: @@ -164,35 +146,23 @@ c_e_InvestmentFlowBlock_old_rule(electricityBus_storage3_2)_: -1 InvestmentFlowBlock_old_exo(electricityBus_storage3_2) = 0 -c_u_InvestmentFlowBlock_max(storage3_electricityBus_0_0)_: -+1 flow(storage3_electricityBus_0_0) --1 InvestmentFlowBlock_total(storage3_electricityBus_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage3_electricityBus_0_1)_: -+1 flow(storage3_electricityBus_0_1) --1 InvestmentFlowBlock_total(storage3_electricityBus_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage3_electricityBus_1_2)_: -+1 flow(storage3_electricityBus_1_2) --1 InvestmentFlowBlock_total(storage3_electricityBus_1) -<= 0 - -c_u_InvestmentFlowBlock_max(storage3_electricityBus_1_3)_: -+1 flow(storage3_electricityBus_1_3) --1 InvestmentFlowBlock_total(storage3_electricityBus_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage3_electricityBus_0)_: +-1 InvestmentFlowBlock_old_end(storage3_electricityBus_0) +-1 InvestmentFlowBlock_old_exo(storage3_electricityBus_0) ++1 InvestmentFlowBlock_old(storage3_electricityBus_0) += 0 -c_u_InvestmentFlowBlock_max(storage3_electricityBus_2_4)_: -+1 flow(storage3_electricityBus_2_4) --1 InvestmentFlowBlock_total(storage3_electricityBus_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage3_electricityBus_1)_: ++1 InvestmentFlowBlock_old(storage3_electricityBus_1) +-1 InvestmentFlowBlock_old_end(storage3_electricityBus_1) +-1 InvestmentFlowBlock_old_exo(storage3_electricityBus_1) += 0 -c_u_InvestmentFlowBlock_max(storage3_electricityBus_2_5)_: -+1 flow(storage3_electricityBus_2_5) --1 InvestmentFlowBlock_total(storage3_electricityBus_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage3_electricityBus_2)_: ++1 InvestmentFlowBlock_old(storage3_electricityBus_2) +-1 InvestmentFlowBlock_old_end(storage3_electricityBus_2) +-1 InvestmentFlowBlock_old_exo(storage3_electricityBus_2) += 0 c_u_InvestmentFlowBlock_max(electricityBus_storage3_0_0)_: +1 flow(electricityBus_storage3_0_0) @@ -224,6 +194,36 @@ c_u_InvestmentFlowBlock_max(electricityBus_storage3_2_5)_: -1 InvestmentFlowBlock_total(electricityBus_storage3_2) <= 0 +c_u_InvestmentFlowBlock_max(storage3_electricityBus_0_0)_: ++1 flow(storage3_electricityBus_0_0) +-1 InvestmentFlowBlock_total(storage3_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage3_electricityBus_0_1)_: ++1 flow(storage3_electricityBus_0_1) +-1 InvestmentFlowBlock_total(storage3_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage3_electricityBus_1_2)_: ++1 flow(storage3_electricityBus_1_2) +-1 InvestmentFlowBlock_total(storage3_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage3_electricityBus_1_3)_: ++1 flow(storage3_electricityBus_1_3) +-1 InvestmentFlowBlock_total(storage3_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage3_electricityBus_2_4)_: ++1 flow(storage3_electricityBus_2_4) +-1 InvestmentFlowBlock_total(storage3_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage3_electricityBus_2_5)_: ++1 flow(storage3_electricityBus_2_5) +-1 InvestmentFlowBlock_total(storage3_electricityBus_2) +<= 0 + c_e_GenericStorageBlock_balance(storage3_0_0)_: +1 flow(storage3_electricityBus_0_0) -1 flow(electricityBus_storage3_0_0) @@ -272,12 +272,12 @@ c_e_GenericStorageBlock_balanced_cstr(storage3)_: = 0 bounds - 0 <= InvestmentFlowBlock_invest(storage3_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_invest(storage3_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_invest(storage3_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_invest(electricityBus_storage3_0) <= +inf 0 <= InvestmentFlowBlock_invest(electricityBus_storage3_1) <= +inf 0 <= InvestmentFlowBlock_invest(electricityBus_storage3_2) <= +inf + 0 <= InvestmentFlowBlock_invest(storage3_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_invest(storage3_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_invest(storage3_electricityBus_2) <= +inf 0 <= flow(storage3_electricityBus_0_0) <= +inf 0 <= flow(electricityBus_storage3_0_0) <= +inf 0 <= flow(storage3_electricityBus_0_1) <= +inf @@ -290,30 +290,30 @@ bounds 0 <= flow(electricityBus_storage3_2_4) <= +inf 0 <= flow(storage3_electricityBus_2_5) <= +inf 0 <= flow(electricityBus_storage3_2_5) <= +inf - 0 <= InvestmentFlowBlock_total(storage3_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_total(storage3_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old(storage3_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_total(storage3_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage3_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_total(electricityBus_storage3_0) <= +inf 0 <= InvestmentFlowBlock_total(electricityBus_storage3_1) <= +inf 0 <= InvestmentFlowBlock_old(electricityBus_storage3_1) <= +inf 0 <= InvestmentFlowBlock_total(electricityBus_storage3_2) <= +inf 0 <= InvestmentFlowBlock_old(electricityBus_storage3_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage3_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage3_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage3_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_total(storage3_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_total(storage3_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old(storage3_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_total(storage3_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage3_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage3_0) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage3_1) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage3_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage3_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage3_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage3_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage3_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage3_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage3_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage3_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage3_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage3_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage3_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage3_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage3_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage3_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old(electricityBus_storage3_0) <= +inf + 0 <= InvestmentFlowBlock_old(storage3_electricityBus_0) <= +inf 0 <= GenericStorageBlock_storage_content(storage3_1) <= 5000 0 <= GenericStorageBlock_storage_content(storage3_0) <= 5000 0 <= GenericStorageBlock_storage_content(storage3_2) <= 5000 diff --git a/tests/lp_files/storage_invest_4_multi_period.lp b/tests/lp_files/storage_invest_4_multi_period.lp index 75b419e4f..c391c9b46 100644 --- a/tests/lp_files/storage_invest_4_multi_period.lp +++ b/tests/lp_files/storage_invest_4_multi_period.lp @@ -100,11 +100,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage4_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage4_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage4_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage4_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage4_0_1)_: +1 flow(storage4_electricityBus_0_1) -1 flow(electricityBus_storage4_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage4_1) -1 GenericInvestmentStorageBlock_storage_content(storage4_0) ++1 GenericInvestmentStorageBlock_storage_content(storage4_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage4_1_2)_: @@ -193,8 +197,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage4_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage4_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage4_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage4_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage4_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage4_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage4_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage4_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage4_4) <= +inf diff --git a/tests/lp_files/storage_invest_5_multi_period.lp b/tests/lp_files/storage_invest_5_multi_period.lp index ec6eebef5..db88b35f0 100644 --- a/tests/lp_files/storage_invest_5_multi_period.lp +++ b/tests/lp_files/storage_invest_5_multi_period.lp @@ -38,25 +38,6 @@ c_e_BusBlock_balance(electricityBus_2_5)_: -1 flow(electricityBus_storage5_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(storage5_electricityBus_0)_: -+1 InvestmentFlowBlock_total(storage5_electricityBus_0) --1 InvestmentFlowBlock_invest(storage5_electricityBus_0) -= 100 - -c_e_InvestmentFlowBlock_total_rule(storage5_electricityBus_1)_: --1 InvestmentFlowBlock_total(storage5_electricityBus_0) -+1 InvestmentFlowBlock_total(storage5_electricityBus_1) --1 InvestmentFlowBlock_invest(storage5_electricityBus_1) -+1 InvestmentFlowBlock_old(storage5_electricityBus_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage5_electricityBus_2)_: --1 InvestmentFlowBlock_total(storage5_electricityBus_1) -+1 InvestmentFlowBlock_total(storage5_electricityBus_2) --1 InvestmentFlowBlock_invest(storage5_electricityBus_2) -+1 InvestmentFlowBlock_old(storage5_electricityBus_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(electricityBus_storage5_0)_: -1 InvestmentFlowBlock_invest(electricityBus_storage5_0) +1 InvestmentFlowBlock_total(electricityBus_storage5_0) @@ -76,16 +57,23 @@ c_e_InvestmentFlowBlock_total_rule(electricityBus_storage5_2)_: +1 InvestmentFlowBlock_old(electricityBus_storage5_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage5_electricityBus_0)_: -+1 InvestmentFlowBlock_old_end(storage5_electricityBus_0) -= 0 +c_e_InvestmentFlowBlock_total_rule(storage5_electricityBus_0)_: ++1 InvestmentFlowBlock_total(storage5_electricityBus_0) +-1 InvestmentFlowBlock_invest(storage5_electricityBus_0) += 100 -c_e_InvestmentFlowBlock_old_rule_end(storage5_electricityBus_1)_: -+1 InvestmentFlowBlock_old_end(storage5_electricityBus_1) +c_e_InvestmentFlowBlock_total_rule(storage5_electricityBus_1)_: +-1 InvestmentFlowBlock_total(storage5_electricityBus_0) ++1 InvestmentFlowBlock_total(storage5_electricityBus_1) +-1 InvestmentFlowBlock_invest(storage5_electricityBus_1) ++1 InvestmentFlowBlock_old(storage5_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage5_electricityBus_2)_: -+1 InvestmentFlowBlock_old_end(storage5_electricityBus_2) +c_e_InvestmentFlowBlock_total_rule(storage5_electricityBus_2)_: +-1 InvestmentFlowBlock_total(storage5_electricityBus_1) ++1 InvestmentFlowBlock_total(storage5_electricityBus_2) +-1 InvestmentFlowBlock_invest(storage5_electricityBus_2) ++1 InvestmentFlowBlock_old(storage5_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage5_0)_: @@ -100,16 +88,16 @@ c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage5_2)_: +1 InvestmentFlowBlock_old_end(electricityBus_storage5_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage5_electricityBus_0)_: -+1 InvestmentFlowBlock_old_exo(storage5_electricityBus_0) +c_e_InvestmentFlowBlock_old_rule_end(storage5_electricityBus_0)_: ++1 InvestmentFlowBlock_old_end(storage5_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage5_electricityBus_1)_: -+1 InvestmentFlowBlock_old_exo(storage5_electricityBus_1) +c_e_InvestmentFlowBlock_old_rule_end(storage5_electricityBus_1)_: ++1 InvestmentFlowBlock_old_end(storage5_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage5_electricityBus_2)_: -+1 InvestmentFlowBlock_old_exo(storage5_electricityBus_2) +c_e_InvestmentFlowBlock_old_rule_end(storage5_electricityBus_2)_: ++1 InvestmentFlowBlock_old_end(storage5_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage5_0)_: @@ -124,22 +112,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage5_2)_: +1 InvestmentFlowBlock_old_exo(electricityBus_storage5_2) = 0 -c_e_InvestmentFlowBlock_old_rule(storage5_electricityBus_0)_: --1 InvestmentFlowBlock_old_end(storage5_electricityBus_0) --1 InvestmentFlowBlock_old_exo(storage5_electricityBus_0) -+1 InvestmentFlowBlock_old(storage5_electricityBus_0) +c_e_InvestmentFlowBlock_old_rule_exo(storage5_electricityBus_0)_: ++1 InvestmentFlowBlock_old_exo(storage5_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule(storage5_electricityBus_1)_: -+1 InvestmentFlowBlock_old(storage5_electricityBus_1) --1 InvestmentFlowBlock_old_end(storage5_electricityBus_1) --1 InvestmentFlowBlock_old_exo(storage5_electricityBus_1) +c_e_InvestmentFlowBlock_old_rule_exo(storage5_electricityBus_1)_: ++1 InvestmentFlowBlock_old_exo(storage5_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule(storage5_electricityBus_2)_: -+1 InvestmentFlowBlock_old(storage5_electricityBus_2) --1 InvestmentFlowBlock_old_end(storage5_electricityBus_2) --1 InvestmentFlowBlock_old_exo(storage5_electricityBus_2) +c_e_InvestmentFlowBlock_old_rule_exo(storage5_electricityBus_2)_: ++1 InvestmentFlowBlock_old_exo(storage5_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule(electricityBus_storage5_0)_: @@ -160,35 +142,23 @@ c_e_InvestmentFlowBlock_old_rule(electricityBus_storage5_2)_: -1 InvestmentFlowBlock_old_exo(electricityBus_storage5_2) = 0 -c_u_InvestmentFlowBlock_max(storage5_electricityBus_0_0)_: -+1 flow(storage5_electricityBus_0_0) --1 InvestmentFlowBlock_total(storage5_electricityBus_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage5_electricityBus_0_1)_: -+1 flow(storage5_electricityBus_0_1) --1 InvestmentFlowBlock_total(storage5_electricityBus_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage5_electricityBus_1_2)_: -+1 flow(storage5_electricityBus_1_2) --1 InvestmentFlowBlock_total(storage5_electricityBus_1) -<= 0 - -c_u_InvestmentFlowBlock_max(storage5_electricityBus_1_3)_: -+1 flow(storage5_electricityBus_1_3) --1 InvestmentFlowBlock_total(storage5_electricityBus_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage5_electricityBus_0)_: +-1 InvestmentFlowBlock_old_end(storage5_electricityBus_0) +-1 InvestmentFlowBlock_old_exo(storage5_electricityBus_0) ++1 InvestmentFlowBlock_old(storage5_electricityBus_0) += 0 -c_u_InvestmentFlowBlock_max(storage5_electricityBus_2_4)_: -+1 flow(storage5_electricityBus_2_4) --1 InvestmentFlowBlock_total(storage5_electricityBus_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage5_electricityBus_1)_: ++1 InvestmentFlowBlock_old(storage5_electricityBus_1) +-1 InvestmentFlowBlock_old_end(storage5_electricityBus_1) +-1 InvestmentFlowBlock_old_exo(storage5_electricityBus_1) += 0 -c_u_InvestmentFlowBlock_max(storage5_electricityBus_2_5)_: -+1 flow(storage5_electricityBus_2_5) --1 InvestmentFlowBlock_total(storage5_electricityBus_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage5_electricityBus_2)_: ++1 InvestmentFlowBlock_old(storage5_electricityBus_2) +-1 InvestmentFlowBlock_old_end(storage5_electricityBus_2) +-1 InvestmentFlowBlock_old_exo(storage5_electricityBus_2) += 0 c_u_InvestmentFlowBlock_max(electricityBus_storage5_0_0)_: +1 flow(electricityBus_storage5_0_0) @@ -220,6 +190,36 @@ c_u_InvestmentFlowBlock_max(electricityBus_storage5_2_5)_: -1 InvestmentFlowBlock_total(electricityBus_storage5_2) <= 0 +c_u_InvestmentFlowBlock_max(storage5_electricityBus_0_0)_: ++1 flow(storage5_electricityBus_0_0) +-1 InvestmentFlowBlock_total(storage5_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage5_electricityBus_0_1)_: ++1 flow(storage5_electricityBus_0_1) +-1 InvestmentFlowBlock_total(storage5_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage5_electricityBus_1_2)_: ++1 flow(storage5_electricityBus_1_2) +-1 InvestmentFlowBlock_total(storage5_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage5_electricityBus_1_3)_: ++1 flow(storage5_electricityBus_1_3) +-1 InvestmentFlowBlock_total(storage5_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage5_electricityBus_2_4)_: ++1 flow(storage5_electricityBus_2_4) +-1 InvestmentFlowBlock_total(storage5_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage5_electricityBus_2_5)_: ++1 flow(storage5_electricityBus_2_5) +-1 InvestmentFlowBlock_total(storage5_electricityBus_2) +<= 0 + c_e_GenericStorageBlock_balance(storage5_0_0)_: +1 flow(storage5_electricityBus_0_0) -1 flow(electricityBus_storage5_0_0) @@ -268,18 +268,18 @@ c_e_GenericStorageBlock_balanced_cstr(storage5)_: = 0 c_e_GenericStorageBlock_power_coupled(storage5_0)_: -+1.1 InvestmentFlowBlock_total(storage5_electricityBus_0) -1 InvestmentFlowBlock_total(electricityBus_storage5_0) ++1.1 InvestmentFlowBlock_total(storage5_electricityBus_0) = 0 c_e_GenericStorageBlock_power_coupled(storage5_1)_: -+1.1 InvestmentFlowBlock_total(storage5_electricityBus_1) -1 InvestmentFlowBlock_total(electricityBus_storage5_1) ++1.1 InvestmentFlowBlock_total(storage5_electricityBus_1) = 0 c_e_GenericStorageBlock_power_coupled(storage5_2)_: -+1.1 InvestmentFlowBlock_total(storage5_electricityBus_2) -1 InvestmentFlowBlock_total(electricityBus_storage5_2) ++1.1 InvestmentFlowBlock_total(storage5_electricityBus_2) = 0 bounds @@ -298,6 +298,11 @@ bounds 0 <= flow(electricityBus_storage5_2_4) <= +inf 0 <= flow(storage5_electricityBus_2_5) <= +inf 0 <= flow(electricityBus_storage5_2_5) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage5_0) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage5_1) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage5_1) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage5_2) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage5_2) <= +inf 0 <= InvestmentFlowBlock_total(storage5_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_invest(storage5_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_total(storage5_electricityBus_1) <= +inf @@ -306,25 +311,20 @@ bounds 0 <= InvestmentFlowBlock_total(storage5_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_invest(storage5_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old(storage5_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage5_0) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage5_1) <= +inf - 0 <= InvestmentFlowBlock_old(electricityBus_storage5_1) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage5_2) <= +inf - 0 <= InvestmentFlowBlock_old(electricityBus_storage5_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_0) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_1) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage5_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old(electricityBus_storage5_0) <= +inf + 0 <= InvestmentFlowBlock_old(storage5_electricityBus_0) <= +inf 0 <= GenericStorageBlock_storage_content(storage5_1) <= 10000 0 <= GenericStorageBlock_storage_content(storage5_0) <= 10000 0 <= GenericStorageBlock_storage_content(storage5_2) <= 10000 diff --git a/tests/lp_files/storage_invest_6_multi_period.lp b/tests/lp_files/storage_invest_6_multi_period.lp index 24c767b33..8ad4b9f42 100644 --- a/tests/lp_files/storage_invest_6_multi_period.lp +++ b/tests/lp_files/storage_invest_6_multi_period.lp @@ -284,11 +284,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage6_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage6_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage6_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage6_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage6_0_1)_: +1 flow(storage6_electricityBus_0_1) -1 flow(electricityBus_storage6_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage6_1) -1 GenericInvestmentStorageBlock_storage_content(storage6_0) ++1 GenericInvestmentStorageBlock_storage_content(storage6_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage6_1_2)_: @@ -422,8 +426,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage6_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage6_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage6_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage6_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage6_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage6_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage6_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage6_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage6_4) <= +inf diff --git a/tests/lp_files/storage_invest_all_nonconvex_multi_period.lp b/tests/lp_files/storage_invest_all_nonconvex_multi_period.lp index 84eabdec1..68765fd78 100644 --- a/tests/lp_files/storage_invest_all_nonconvex_multi_period.lp +++ b/tests/lp_files/storage_invest_all_nonconvex_multi_period.lp @@ -2,18 +2,18 @@ min objective: -+12.231343625058066 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) -+15 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) -+11.991513357900065 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) -+14.705882352941176 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) -+11.756385645000064 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) -+14.41753171856978 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) +12.231343625058066 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) +10 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) +11.991513357900065 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) +9.80392156862745 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) +11.756385645000064 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) +9.611687812379854 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) ++12.231343625058066 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) ++15 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) ++11.991513357900065 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) ++14.705882352941176 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) ++11.756385645000064 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) ++14.41753171856978 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) +24.462687250116133 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_0) +30 GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_0) +23.98302671580013 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_1) @@ -53,21 +53,6 @@ c_e_BusBlock_balance(bus1_2_5)_: -1 flow(bus1_storage_all_nonconvex_2_5) = 0 -c_u_InvestmentFlowBlock_minimum_rule(storage_all_nonconvex_bus1_0)_: --1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) -+8 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) -<= 0 - -c_u_InvestmentFlowBlock_minimum_rule(storage_all_nonconvex_bus1_1)_: --1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) -+8 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) -<= 0 - -c_u_InvestmentFlowBlock_minimum_rule(storage_all_nonconvex_bus1_2)_: --1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) -+8 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) -<= 0 - c_u_InvestmentFlowBlock_minimum_rule(bus1_storage_all_nonconvex_0)_: -1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) +5 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) @@ -83,19 +68,19 @@ c_u_InvestmentFlowBlock_minimum_rule(bus1_storage_all_nonconvex_2)_: +5 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) <= 0 -c_u_InvestmentFlowBlock_maximum_rule(storage_all_nonconvex_bus1_0)_: -+1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) --20 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) +c_u_InvestmentFlowBlock_minimum_rule(storage_all_nonconvex_bus1_0)_: +-1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) ++8 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) <= 0 -c_u_InvestmentFlowBlock_maximum_rule(storage_all_nonconvex_bus1_1)_: -+1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) --20 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) +c_u_InvestmentFlowBlock_minimum_rule(storage_all_nonconvex_bus1_1)_: +-1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) ++8 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) <= 0 -c_u_InvestmentFlowBlock_maximum_rule(storage_all_nonconvex_bus1_2)_: -+1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) --20 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) +c_u_InvestmentFlowBlock_minimum_rule(storage_all_nonconvex_bus1_2)_: +-1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) ++8 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) <= 0 c_u_InvestmentFlowBlock_maximum_rule(bus1_storage_all_nonconvex_0)_: @@ -113,24 +98,20 @@ c_u_InvestmentFlowBlock_maximum_rule(bus1_storage_all_nonconvex_2)_: -30 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) <= 0 -c_e_InvestmentFlowBlock_total_rule(storage_all_nonconvex_bus1_0)_: --1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) -+1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) -= 0 +c_u_InvestmentFlowBlock_maximum_rule(storage_all_nonconvex_bus1_0)_: ++1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) +-20 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) +<= 0 -c_e_InvestmentFlowBlock_total_rule(storage_all_nonconvex_bus1_1)_: --1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) --1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) -+1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) -+1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_1) -= 0 +c_u_InvestmentFlowBlock_maximum_rule(storage_all_nonconvex_bus1_1)_: ++1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) +-20 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) +<= 0 -c_e_InvestmentFlowBlock_total_rule(storage_all_nonconvex_bus1_2)_: --1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) --1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) -+1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) -+1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_2) -= 0 +c_u_InvestmentFlowBlock_maximum_rule(storage_all_nonconvex_bus1_2)_: ++1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) +-20 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) +<= 0 c_e_InvestmentFlowBlock_total_rule(bus1_storage_all_nonconvex_0)_: -1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) @@ -151,16 +132,23 @@ c_e_InvestmentFlowBlock_total_rule(bus1_storage_all_nonconvex_2)_: +1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_all_nonconvex_bus1_0)_: -+1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_0) +c_e_InvestmentFlowBlock_total_rule(storage_all_nonconvex_bus1_0)_: +-1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) ++1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_all_nonconvex_bus1_1)_: -+1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_1) +c_e_InvestmentFlowBlock_total_rule(storage_all_nonconvex_bus1_1)_: +-1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) +-1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) ++1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) ++1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_all_nonconvex_bus1_2)_: -+1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_2) +c_e_InvestmentFlowBlock_total_rule(storage_all_nonconvex_bus1_2)_: +-1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) +-1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) ++1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) ++1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(bus1_storage_all_nonconvex_0)_: @@ -175,16 +163,16 @@ c_e_InvestmentFlowBlock_old_rule_end(bus1_storage_all_nonconvex_2)_: +1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_all_nonconvex_bus1_0)_: -+1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_0) +c_e_InvestmentFlowBlock_old_rule_end(storage_all_nonconvex_bus1_0)_: ++1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_all_nonconvex_bus1_1)_: -+1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_1) +c_e_InvestmentFlowBlock_old_rule_end(storage_all_nonconvex_bus1_1)_: ++1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_all_nonconvex_bus1_2)_: -+1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) +c_e_InvestmentFlowBlock_old_rule_end(storage_all_nonconvex_bus1_2)_: ++1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(bus1_storage_all_nonconvex_0)_: @@ -199,22 +187,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(bus1_storage_all_nonconvex_2)_: +1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_all_nonconvex_bus1_0)_: --1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_0) --1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_0) -+1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_0) +c_e_InvestmentFlowBlock_old_rule_exo(storage_all_nonconvex_bus1_0)_: ++1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_all_nonconvex_bus1_1)_: -+1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_1) --1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_1) --1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_1) +c_e_InvestmentFlowBlock_old_rule_exo(storage_all_nonconvex_bus1_1)_: ++1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_all_nonconvex_bus1_2)_: -+1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_2) --1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_2) --1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) +c_e_InvestmentFlowBlock_old_rule_exo(storage_all_nonconvex_bus1_2)_: ++1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule(bus1_storage_all_nonconvex_0)_: @@ -235,35 +217,23 @@ c_e_InvestmentFlowBlock_old_rule(bus1_storage_all_nonconvex_2)_: -1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) = 0 -c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_0_0)_: -+1 flow(storage_all_nonconvex_bus1_0_0) --1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_0_1)_: -+1 flow(storage_all_nonconvex_bus1_0_1) --1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_1_2)_: -+1 flow(storage_all_nonconvex_bus1_1_2) --1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_1_3)_: -+1 flow(storage_all_nonconvex_bus1_1_3) --1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_all_nonconvex_bus1_0)_: +-1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_0) +-1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_0) ++1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_0) += 0 -c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_2_4)_: -+1 flow(storage_all_nonconvex_bus1_2_4) --1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_all_nonconvex_bus1_1)_: ++1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_1) +-1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_1) +-1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_1) += 0 -c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_2_5)_: -+1 flow(storage_all_nonconvex_bus1_2_5) --1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_all_nonconvex_bus1_2)_: ++1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_2) +-1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_2) +-1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) += 0 c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_0_0)_: +1 flow(bus1_storage_all_nonconvex_0_0) @@ -295,6 +265,36 @@ c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_2_5)_: -1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) <= 0 +c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_0_0)_: ++1 flow(storage_all_nonconvex_bus1_0_0) +-1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_0_1)_: ++1 flow(storage_all_nonconvex_bus1_0_1) +-1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_1_2)_: ++1 flow(storage_all_nonconvex_bus1_1_2) +-1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_1_3)_: ++1 flow(storage_all_nonconvex_bus1_1_3) +-1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_2_4)_: ++1 flow(storage_all_nonconvex_bus1_2_4) +-1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_2_5)_: ++1 flow(storage_all_nonconvex_bus1_2_5) +-1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) +<= 0 + c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_all_nonconvex_0)_: -1 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_0) +1 GenericInvestmentStorageBlock_total(storage_all_nonconvex_0) @@ -356,11 +356,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage_all_nonconvex_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage_all_nonconvex_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage_all_nonconvex_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage_all_nonconvex_0_1)_: +1 flow(storage_all_nonconvex_bus1_0_1) -1 flow(bus1_storage_all_nonconvex_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_1) -1 GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage_all_nonconvex_1_2)_: @@ -452,18 +456,18 @@ c_l_GenericInvestmentStorageBlock_limit_min(storage_all_nonconvex_2)_: >= 0 bounds - 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) <= 20 - 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) <= 1 - 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) <= 20 - 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) <= 1 - 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) <= 20 - 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) <= 1 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) <= 30 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) <= 1 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) <= 30 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) <= 1 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) <= 30 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) <= 1 + 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) <= 20 + 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) <= 1 + 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) <= 20 + 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) <= 1 + 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) <= 20 + 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) <= 1 0 <= GenericInvestmentStorageBlock_invest(storage_all_nonconvex_0) <= 100 0 <= GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_0) <= 1 0 <= GenericInvestmentStorageBlock_invest(storage_all_nonconvex_1) <= 100 @@ -482,30 +486,30 @@ bounds 0 <= flow(bus1_storage_all_nonconvex_2_4) <= +inf 0 <= flow(storage_all_nonconvex_bus1_2_5) <= +inf 0 <= flow(bus1_storage_all_nonconvex_2_5) <= +inf - 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) <= +inf - 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_1) <= +inf - 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_2) <= +inf 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) <= +inf 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) <= +inf 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_1) <= +inf 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) <= +inf 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_2) <= +inf + 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) <= +inf + 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_1) <= +inf + 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_0) <= +inf 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_1) <= +inf 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) <= +inf 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_0) <= +inf + 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_all_nonconvex_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_all_nonconvex_1) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_all_nonconvex_1) <= +inf @@ -518,19 +522,19 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage_all_nonconvex_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage_all_nonconvex_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_all_nonconvex_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_4) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_5) <= +inf binary - InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) - InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) - InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) + InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) + InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) + InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_0) GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_1) GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_2) diff --git a/tests/lp_files/storage_invest_minimum_multi_period.lp b/tests/lp_files/storage_invest_minimum_multi_period.lp index 25e1482b3..76e8aa662 100644 --- a/tests/lp_files/storage_invest_minimum_multi_period.lp +++ b/tests/lp_files/storage_invest_minimum_multi_period.lp @@ -99,11 +99,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage1_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage1_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage1_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage1_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage1_0_1)_: +1 flow(storage1_electricityBus_0_1) -1 flow(electricityBus_storage1_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage1_1) -1 GenericInvestmentStorageBlock_storage_content(storage1_0) ++1 GenericInvestmentStorageBlock_storage_content(storage1_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage1_1_2)_: @@ -192,8 +196,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage1_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage1_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_4) <= +inf diff --git a/tests/lp_files/storage_invest_multi_period.lp b/tests/lp_files/storage_invest_multi_period.lp index 983ada947..228aadf96 100644 --- a/tests/lp_files/storage_invest_multi_period.lp +++ b/tests/lp_files/storage_invest_multi_period.lp @@ -100,11 +100,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage1_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage1_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage1_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage1_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage1_0_1)_: +1 flow(storage1_electricityBus_0_1) -1 flow(electricityBus_storage1_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage1_1) -1 GenericInvestmentStorageBlock_storage_content(storage1_0) ++1 GenericInvestmentStorageBlock_storage_content(storage1_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage1_1_2)_: @@ -210,8 +214,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage1_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage1_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage1_4) <= +inf diff --git a/tests/lp_files/storage_invest_with_offset_multi_period.lp b/tests/lp_files/storage_invest_with_offset_multi_period.lp index 9686a957f..9fb9d7680 100644 --- a/tests/lp_files/storage_invest_with_offset_multi_period.lp +++ b/tests/lp_files/storage_invest_with_offset_multi_period.lp @@ -296,11 +296,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage_non_convex_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_0_1)_: -0.97 flow(electricityBus_storage_non_convex_0_1) +1.1627906976744187 flow(storage_non_convex_electricityBus_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) -0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_1_2)_: @@ -512,8 +516,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) <= +inf diff --git a/tests/lp_files/storage_invest_without_offset_multi_period.lp b/tests/lp_files/storage_invest_without_offset_multi_period.lp index 327b74c93..3e98a271f 100644 --- a/tests/lp_files/storage_invest_without_offset_multi_period.lp +++ b/tests/lp_files/storage_invest_without_offset_multi_period.lp @@ -293,11 +293,15 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage_non_convex_2)_: -1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) = 0 +c_e_GenericInvestmentStorageBlock_initially_empty(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) += 0 + c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_0_1)_: -0.97 flow(electricityBus_storage_non_convex_0_1) +1.1627906976744187 flow(storage_non_convex_electricityBus_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) -0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_1_2)_: @@ -506,8 +510,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_1) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) <= +inf From 670ccbdc9091cc03126879ae7a4e72dde5984d0b Mon Sep 17 00:00:00 2001 From: Johannes Kochems Date: Mon, 7 Aug 2023 15:51:57 +0200 Subject: [PATCH 3/5] Add improvements from code review --- .../solph/components/_generic_storage.py | 21 ++++++++----------- tests/multi_period_constraint_tests.py | 13 +++++------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/oemof/solph/components/_generic_storage.py b/src/oemof/solph/components/_generic_storage.py index 1c34269ad..05a492216 100644 --- a/src/oemof/solph/components/_generic_storage.py +++ b/src/oemof/solph/components/_generic_storage.py @@ -1032,21 +1032,20 @@ def _create(self, group=None): # ########################## CHECKS ################################### if m.es.periods is not None: for n in group: - error = ( + error_fixed_absolute_losses = ( "For a multi-period investment model, fixed absolute" " losses are not supported. Please remove parameter." ) if n.fixed_losses_absolute.default != 0: - raise ValueError(error) - warning = ( + raise ValueError(error_fixed_absolute_losses) + error_initial_storage_level = ( "For a multi-period model, initial_storage_level is" - " not supported.\nIt is suggested to remove that" - " parameter since it has no effect.\nstorage_content" - " will be zero, until there is some usable storage " - " capacity installed." + " not supported.\nIt needs to be removed since it" + " has no effect.\nstorage_content will be zero," + " until there is some usable storage capacity installed." ) if n.initial_storage_level is not None: - warn(warning, debugging.SuspiciousUsageWarning) + raise ValueError(error_initial_storage_level) # ########################## SETS ##################################### @@ -1315,10 +1314,8 @@ def _old_storage_capacity_rule(block): def _initially_empty_rule(block): """Ensure storage to be empty initially""" for n in self.INVESTSTORAGES: - for t in m.TIMESTEPS: - if t == 0: - expr = self.storage_content[n, 0] == 0 - self.initially_empty.add((n, t), expr) + expr = self.storage_content[n, 0] == 0 + self.initially_empty.add((n, 0), expr) self.initially_empty = Constraint( self.INVESTSTORAGES, m.TIMESTEPS, noruleinit=True diff --git a/tests/multi_period_constraint_tests.py b/tests/multi_period_constraint_tests.py index ac776fc93..974e65e10 100644 --- a/tests/multi_period_constraint_tests.py +++ b/tests/multi_period_constraint_tests.py @@ -385,7 +385,6 @@ def test_storage_invest_2(self): investment=solph.Investment( ep_costs=145, lifetime=20, existing=20, age=19 ), - initial_storage_level=0.5, ) self.energysystem.add(bel, storage) self.compare_lp_files("storage_invest_2_multi_period.lp") @@ -612,7 +611,7 @@ def test_storage_invest_1_fixed_losses(self): self.get_om() def test_storage_invest_1_initial_storage_level(self): - """Test warning for initial storage level + """Test error for initial storage level with multi-period investments""" bel = solph.buses.Bus(label="electricityBus") storage = solph.components.GenericStorage( @@ -642,14 +641,12 @@ def test_storage_invest_1_initial_storage_level(self): self.energysystem.add(bel, storage) msg = ( "For a multi-period model, initial_storage_level is" - " not supported.\nIt is suggested to remove that" - " parameter since it has no effect.\nstorage_content" - " will be zero, until there is some usable storage " - " capacity installed." + " not supported.\nIt needs to be removed since it" + " has no effect.\nstorage_content will be zero," + " until there is some usable storage capacity installed." ) - with warnings.catch_warnings(record=True) as w: + with pytest.raises(ValueError, match=msg): self.get_om() - assert msg in str(w[1].message) def test_storage_invest_1_missing_lifetime(self): """Test error thrown if storage misses necessary lifetime""" From 863ade7c785bcaeccbee422d9b8aee3a7305f407 Mon Sep 17 00:00:00 2001 From: Johannes Kochems Date: Mon, 7 Aug 2023 15:54:19 +0200 Subject: [PATCH 4/5] Remove unused import --- tests/multi_period_constraint_tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/multi_period_constraint_tests.py b/tests/multi_period_constraint_tests.py index 974e65e10..2f2694ad1 100644 --- a/tests/multi_period_constraint_tests.py +++ b/tests/multi_period_constraint_tests.py @@ -11,7 +11,6 @@ import logging import re -import warnings from os import path as ospath import pandas as pd From 2260d270beec1872c5303b9dcb36835b05e64d6e Mon Sep 17 00:00:00 2001 From: Johannes Kochems Date: Mon, 7 Aug 2023 16:25:22 +0200 Subject: [PATCH 5/5] Fix failing test --- .../test_multi_period_investment_model.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_scripts/test_solph/test_multi_period_model/test_multi_period_investment_model.py b/tests/test_scripts/test_solph/test_multi_period_model/test_multi_period_investment_model.py index e0a8e6ca7..d5714275f 100644 --- a/tests/test_scripts/test_solph/test_multi_period_model/test_multi_period_investment_model.py +++ b/tests/test_scripts/test_solph/test_multi_period_model/test_multi_period_investment_model.py @@ -242,7 +242,6 @@ def test_multi_period_investment_model(solver="cbc"): ) }, loss_rate=0, - initial_storage_level=0, max_storage_level=1, min_storage_level=0, inflow_conversion_factor=1,