diff --git a/src/oemof/solph/components/_offset_converter.py b/src/oemof/solph/components/_offset_converter.py index 606b0f3ad..8369d8ded 100644 --- a/src/oemof/solph/components/_offset_converter.py +++ b/src/oemof/solph/components/_offset_converter.py @@ -245,9 +245,7 @@ def _relation_rule(block): # `NonConvexFlow`. try: expr += ( - m.InvestNonConvexFlowBlock.status_nominal[ - n, o, t - ] + m.InvestNonConvexFlowBlock.status[n, o, t] * n.coefficients[0][t] ) # `KeyError` occurs when more than one @@ -262,9 +260,7 @@ def _relation_rule(block): # (inside the `try` block) does not exist. except (KeyError, AttributeError): expr += ( - m.NonConvexFlowBlock.status_nominal[ - n, o, t - ] + m.NonConvexFlowBlock.status[n, o, t] * n.coefficients[0][t] ) block.relation.add((n, i, o, p, t), (expr == 0)) diff --git a/tests/lp_files/offsetconverter.lp b/tests/lp_files/offsetconverter.lp index 59b7c425e..a241b80fd 100644 --- a/tests/lp_files/offsetconverter.lp +++ b/tests/lp_files/offsetconverter.lp @@ -47,32 +47,32 @@ c_e_NonConvexFlowBlock_status_nominal_constraint(gasBus_gasboiler_2)_: c_u_NonConvexFlowBlock_min(gasBus_gasboiler_0_0)_: -1 flow(gasBus_gasboiler_0_0) -+0.32 NonConvexFlowBlock_status_nominal(gasBus_gasboiler_0) ++0.32 NonConvexFlowBlock_status(gasBus_gasboiler_0) <= 0 c_u_NonConvexFlowBlock_min(gasBus_gasboiler_0_1)_: -1 flow(gasBus_gasboiler_0_1) -+0.32 NonConvexFlowBlock_status_nominal(gasBus_gasboiler_1) ++0.32 NonConvexFlowBlock_status(gasBus_gasboiler_1) <= 0 c_u_NonConvexFlowBlock_min(gasBus_gasboiler_0_2)_: -1 flow(gasBus_gasboiler_0_2) -+0.32 NonConvexFlowBlock_status_nominal(gasBus_gasboiler_2) ++0.32 NonConvexFlowBlock_status(gasBus_gasboiler_2) <= 0 c_u_NonConvexFlowBlock_max(gasBus_gasboiler_0_0)_: +1 flow(gasBus_gasboiler_0_0) --1 NonConvexFlowBlock_status_nominal(gasBus_gasboiler_0) +-1 NonConvexFlowBlock_status(gasBus_gasboiler_0) <= 0 c_u_NonConvexFlowBlock_max(gasBus_gasboiler_0_1)_: +1 flow(gasBus_gasboiler_0_1) --1 NonConvexFlowBlock_status_nominal(gasBus_gasboiler_1) +-1 NonConvexFlowBlock_status(gasBus_gasboiler_1) <= 0 c_u_NonConvexFlowBlock_max(gasBus_gasboiler_0_2)_: +1 flow(gasBus_gasboiler_0_2) --1 NonConvexFlowBlock_status_nominal(gasBus_gasboiler_2) +-1 NonConvexFlowBlock_status(gasBus_gasboiler_2) <= 0 c_e_OffsetConverterBlock_relation(gasboiler_0_0)_: diff --git a/tests/lp_files/offsetconverter_multi_period.lp b/tests/lp_files/offsetconverter_multi_period.lp index 2f29944f2..fd0789adc 100644 --- a/tests/lp_files/offsetconverter_multi_period.lp +++ b/tests/lp_files/offsetconverter_multi_period.lp @@ -147,37 +147,37 @@ c_u_NonConvexFlowBlock_max(gasboiler_thermalBus_2_5)_: c_e_OffsetConverterBlock_relation(gasboiler_gasBus_thermalBus_0_0)_: +0.9 flow(gasBus_gasboiler_0_0) -1 flow(gasboiler_thermalBus_0_0) --17 NonConvexFlowBlock_status_nominal(gasboiler_thermalBus_0) +-17 NonConvexFlowBlock_status(gasboiler_thermalBus_0) = 0 c_e_OffsetConverterBlock_relation(gasboiler_gasBus_thermalBus_0_1)_: +0.9 flow(gasBus_gasboiler_0_1) -1 flow(gasboiler_thermalBus_0_1) --17 NonConvexFlowBlock_status_nominal(gasboiler_thermalBus_1) +-17 NonConvexFlowBlock_status(gasboiler_thermalBus_1) = 0 c_e_OffsetConverterBlock_relation(gasboiler_gasBus_thermalBus_1_2)_: +0.9 flow(gasBus_gasboiler_1_2) -1 flow(gasboiler_thermalBus_1_2) --17 NonConvexFlowBlock_status_nominal(gasboiler_thermalBus_2) +-17 NonConvexFlowBlock_status(gasboiler_thermalBus_2) = 0 c_e_OffsetConverterBlock_relation(gasboiler_gasBus_thermalBus_1_3)_: +0.9 flow(gasBus_gasboiler_1_3) -1 flow(gasboiler_thermalBus_1_3) --17 NonConvexFlowBlock_status_nominal(gasboiler_thermalBus_3) +-17 NonConvexFlowBlock_status(gasboiler_thermalBus_3) = 0 c_e_OffsetConverterBlock_relation(gasboiler_gasBus_thermalBus_2_4)_: +0.9 flow(gasBus_gasboiler_2_4) -1 flow(gasboiler_thermalBus_2_4) --17 NonConvexFlowBlock_status_nominal(gasboiler_thermalBus_4) +-17 NonConvexFlowBlock_status(gasboiler_thermalBus_4) = 0 c_e_OffsetConverterBlock_relation(gasboiler_gasBus_thermalBus_2_5)_: +0.9 flow(gasBus_gasboiler_2_5) -1 flow(gasboiler_thermalBus_2_5) --17 NonConvexFlowBlock_status_nominal(gasboiler_thermalBus_5) +-17 NonConvexFlowBlock_status(gasboiler_thermalBus_5) = 0 bounds diff --git a/tests/lp_files/offsetconverter_nonconvex.lp b/tests/lp_files/offsetconverter_nonconvex.lp index 98ff1f1c0..d05b85060 100644 --- a/tests/lp_files/offsetconverter_nonconvex.lp +++ b/tests/lp_files/offsetconverter_nonconvex.lp @@ -78,19 +78,19 @@ c_u_NonConvexFlowBlock_max(diesel_genset_bus_electricity_0_2)_: c_e_OffsetConverterBlock_relation(diesel_genset_bus_diesel_bus_electricity_0_0)_: +0.5 flow(bus_diesel_diesel_genset_0_0) -1 flow(diesel_genset_bus_electricity_0_0) -+2.5 NonConvexFlowBlock_status_nominal(diesel_genset_bus_electricity_0) ++2.5 NonConvexFlowBlock_status(diesel_genset_bus_electricity_0) = 0 c_e_OffsetConverterBlock_relation(diesel_genset_bus_diesel_bus_electricity_0_1)_: +0.5 flow(bus_diesel_diesel_genset_0_1) -1 flow(diesel_genset_bus_electricity_0_1) -+2.5 NonConvexFlowBlock_status_nominal(diesel_genset_bus_electricity_1) ++2.5 NonConvexFlowBlock_status(diesel_genset_bus_electricity_1) = 0 c_e_OffsetConverterBlock_relation(diesel_genset_bus_diesel_bus_electricity_0_2)_: +0.5 flow(bus_diesel_diesel_genset_0_2) -1 flow(diesel_genset_bus_electricity_0_2) -+2.5 NonConvexFlowBlock_status_nominal(diesel_genset_bus_electricity_2) ++2.5 NonConvexFlowBlock_status(diesel_genset_bus_electricity_2) = 0 bounds diff --git a/tests/lp_files/offsetconverter_nonconvex_investment.lp b/tests/lp_files/offsetconverter_nonconvex_investment.lp index 4b9755dd5..aa845ed66 100644 --- a/tests/lp_files/offsetconverter_nonconvex_investment.lp +++ b/tests/lp_files/offsetconverter_nonconvex_investment.lp @@ -119,19 +119,19 @@ c_u_InvestNonConvexFlowBlock_invest_nc_three(diesel_genset_bus_electricity_0_2)_ c_e_OffsetConverterBlock_relation(diesel_genset_bus_diesel_bus_electricity_0_0)_: +0.5 flow(bus_diesel_diesel_genset_0_0) -1 flow(diesel_genset_bus_electricity_0_0) -+2.5 InvestNonConvexFlowBlock_status_nominal(diesel_genset_bus_electricity_0) ++2.5 InvestNonConvexFlowBlock_status(diesel_genset_bus_electricity_0) = 0 c_e_OffsetConverterBlock_relation(diesel_genset_bus_diesel_bus_electricity_0_1)_: +0.5 flow(bus_diesel_diesel_genset_0_1) -1 flow(diesel_genset_bus_electricity_0_1) -+2.5 InvestNonConvexFlowBlock_status_nominal(diesel_genset_bus_electricity_1) ++2.5 InvestNonConvexFlowBlock_status(diesel_genset_bus_electricity_1) = 0 c_e_OffsetConverterBlock_relation(diesel_genset_bus_diesel_bus_electricity_0_2)_: +0.5 flow(bus_diesel_diesel_genset_0_2) -1 flow(diesel_genset_bus_electricity_0_2) -+2.5 InvestNonConvexFlowBlock_status_nominal(diesel_genset_bus_electricity_2) ++2.5 InvestNonConvexFlowBlock_status(diesel_genset_bus_electricity_2) = 0 bounds