Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constraint tests for CHP investment #35

Merged
merged 7 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions tests/_files/lp_files/backpressure_investment_brown_field.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
\* Source Pyomo model name=Model *\

min
objective:
+50 InvestmentFlow_invest(backpressure_electricity)
+0.59999999999999998 flow(fuel_backpressure_0)
+0.59999999999999998 flow(fuel_backpressure_1)
+0.59999999999999998 flow(fuel_backpressure_2)

s.t.

c_e_Bus_balance(electricity_0)_:
+1 flow(backpressure_electricity_0)
= 0

c_e_Bus_balance(electricity_1)_:
+1 flow(backpressure_electricity_1)
= 0

c_e_Bus_balance(electricity_2)_:
+1 flow(backpressure_electricity_2)
= 0

c_e_Bus_balance(fuel_0)_:
+1 flow(fuel_backpressure_0)
= 0

c_e_Bus_balance(fuel_1)_:
+1 flow(fuel_backpressure_1)
= 0

c_e_Bus_balance(fuel_2)_:
+1 flow(fuel_backpressure_2)
= 0

c_e_Bus_balance(heat_0)_:
+1 flow(backpressure_heat_0)
= 0

c_e_Bus_balance(heat_1)_:
+1 flow(backpressure_heat_1)
= 0

c_e_Bus_balance(heat_2)_:
+1 flow(backpressure_heat_2)
= 0

c_e_Transformer_relation(backpressure_fuel_electricity_0)_:
-1 flow(backpressure_electricity_0)
+0.40000000000000002 flow(fuel_backpressure_0)
= 0

c_e_Transformer_relation(backpressure_fuel_electricity_1)_:
-1 flow(backpressure_electricity_1)
+0.40000000000000002 flow(fuel_backpressure_1)
= 0

c_e_Transformer_relation(backpressure_fuel_electricity_2)_:
-1 flow(backpressure_electricity_2)
+0.40000000000000002 flow(fuel_backpressure_2)
= 0

c_e_Transformer_relation(backpressure_fuel_heat_0)_:
-1 flow(backpressure_heat_0)
+0.34999999999999998 flow(fuel_backpressure_0)
= 0

c_e_Transformer_relation(backpressure_fuel_heat_1)_:
-1 flow(backpressure_heat_1)
+0.34999999999999998 flow(fuel_backpressure_1)
= 0

c_e_Transformer_relation(backpressure_fuel_heat_2)_:
-1 flow(backpressure_heat_2)
+0.34999999999999998 flow(fuel_backpressure_2)
= 0

c_u_InvestmentFlow_max(backpressure_electricity_0)_:
-1 InvestmentFlow_invest(backpressure_electricity)
+1 flow(backpressure_electricity_0)
<= 1000

c_u_InvestmentFlow_max(backpressure_electricity_1)_:
-1 InvestmentFlow_invest(backpressure_electricity)
+1 flow(backpressure_electricity_1)
<= 1000

c_u_InvestmentFlow_max(backpressure_electricity_2)_:
-1 InvestmentFlow_invest(backpressure_electricity)
+1 flow(backpressure_electricity_2)
<= 1000

c_e_ONE_VAR_CONSTANT:
ONE_VAR_CONSTANT = 1.0

bounds
0 <= flow(backpressure_electricity_0) <= +inf
0 <= flow(backpressure_electricity_1) <= +inf
0 <= flow(backpressure_electricity_2) <= +inf
0 <= flow(backpressure_heat_0) <= +inf
0 <= flow(backpressure_heat_1) <= +inf
0 <= flow(backpressure_heat_2) <= +inf
0 <= flow(fuel_backpressure_0) <= +inf
0 <= flow(fuel_backpressure_1) <= +inf
0 <= flow(fuel_backpressure_2) <= +inf
0 <= InvestmentFlow_invest(backpressure_electricity) <= +inf
end
107 changes: 107 additions & 0 deletions tests/_files/lp_files/backpressure_investment_green_field.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
\* Source Pyomo model name=Model *\

min
objective:
+50 InvestmentFlow_invest(backpressure_electricity)
+0.59999999999999998 flow(fuel_backpressure_0)
+0.59999999999999998 flow(fuel_backpressure_1)
+0.59999999999999998 flow(fuel_backpressure_2)

s.t.

c_e_Bus_balance(electricity_0)_:
+1 flow(backpressure_electricity_0)
= 0

c_e_Bus_balance(electricity_1)_:
+1 flow(backpressure_electricity_1)
= 0

c_e_Bus_balance(electricity_2)_:
+1 flow(backpressure_electricity_2)
= 0

c_e_Bus_balance(fuel_0)_:
+1 flow(fuel_backpressure_0)
= 0

c_e_Bus_balance(fuel_1)_:
+1 flow(fuel_backpressure_1)
= 0

c_e_Bus_balance(fuel_2)_:
+1 flow(fuel_backpressure_2)
= 0

c_e_Bus_balance(heat_0)_:
+1 flow(backpressure_heat_0)
= 0

c_e_Bus_balance(heat_1)_:
+1 flow(backpressure_heat_1)
= 0

c_e_Bus_balance(heat_2)_:
+1 flow(backpressure_heat_2)
= 0

c_e_Transformer_relation(backpressure_fuel_electricity_0)_:
-1 flow(backpressure_electricity_0)
+0.40000000000000002 flow(fuel_backpressure_0)
= 0

c_e_Transformer_relation(backpressure_fuel_electricity_1)_:
-1 flow(backpressure_electricity_1)
+0.40000000000000002 flow(fuel_backpressure_1)
= 0

c_e_Transformer_relation(backpressure_fuel_electricity_2)_:
-1 flow(backpressure_electricity_2)
+0.40000000000000002 flow(fuel_backpressure_2)
= 0

c_e_Transformer_relation(backpressure_fuel_heat_0)_:
-1 flow(backpressure_heat_0)
+0.34999999999999998 flow(fuel_backpressure_0)
= 0

c_e_Transformer_relation(backpressure_fuel_heat_1)_:
-1 flow(backpressure_heat_1)
+0.34999999999999998 flow(fuel_backpressure_1)
= 0

c_e_Transformer_relation(backpressure_fuel_heat_2)_:
-1 flow(backpressure_heat_2)
+0.34999999999999998 flow(fuel_backpressure_2)
= 0

c_u_InvestmentFlow_max(backpressure_electricity_0)_:
-1 InvestmentFlow_invest(backpressure_electricity)
+1 flow(backpressure_electricity_0)
<= 0

c_u_InvestmentFlow_max(backpressure_electricity_1)_:
-1 InvestmentFlow_invest(backpressure_electricity)
+1 flow(backpressure_electricity_1)
<= 0

c_u_InvestmentFlow_max(backpressure_electricity_2)_:
-1 InvestmentFlow_invest(backpressure_electricity)
+1 flow(backpressure_electricity_2)
<= 0

c_e_ONE_VAR_CONSTANT:
ONE_VAR_CONSTANT = 1.0

bounds
0 <= flow(backpressure_electricity_0) <= +inf
0 <= flow(backpressure_electricity_1) <= +inf
0 <= flow(backpressure_electricity_2) <= +inf
0 <= flow(backpressure_heat_0) <= +inf
0 <= flow(backpressure_heat_1) <= +inf
0 <= flow(backpressure_heat_2) <= +inf
0 <= flow(fuel_backpressure_0) <= +inf
0 <= flow(fuel_backpressure_1) <= +inf
0 <= flow(fuel_backpressure_2) <= +inf
0 <= InvestmentFlow_invest(backpressure_electricity) <= +inf
end
110 changes: 110 additions & 0 deletions tests/_files/lp_files/extraction_investment_brown_field.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
\* Source Pyomo model name=Model *\

min
objective:
+50 InvestmentFlow_invest(extraction_electricity)
+0.59999999999999998 flow(gas_extraction_0)
+0.59999999999999998 flow(gas_extraction_1)
+0.59999999999999998 flow(gas_extraction_2)

s.t.

c_e_Bus_balance(electricity_0)_:
+1 flow(extraction_electricity_0)
= 0

c_e_Bus_balance(electricity_1)_:
+1 flow(extraction_electricity_1)
= 0

c_e_Bus_balance(electricity_2)_:
+1 flow(extraction_electricity_2)
= 0

c_e_Bus_balance(gas_0)_:
+1 flow(gas_extraction_0)
= 0

c_e_Bus_balance(gas_1)_:
+1 flow(gas_extraction_1)
= 0

c_e_Bus_balance(gas_2)_:
+1 flow(gas_extraction_2)
= 0

c_e_Bus_balance(heat_0)_:
+1 flow(extraction_heat_0)
= 0

c_e_Bus_balance(heat_1)_:
+1 flow(extraction_heat_1)
= 0

c_e_Bus_balance(heat_2)_:
+1 flow(extraction_heat_2)
= 0

c_u_InvestmentFlow_max(extraction_electricity_0)_:
-1 InvestmentFlow_invest(extraction_electricity)
+1 flow(extraction_electricity_0)
<= 1000

c_u_InvestmentFlow_max(extraction_electricity_1)_:
-1 InvestmentFlow_invest(extraction_electricity)
+1 flow(extraction_electricity_1)
<= 1000

c_u_InvestmentFlow_max(extraction_electricity_2)_:
-1 InvestmentFlow_invest(extraction_electricity)
+1 flow(extraction_electricity_2)
<= 1000

c_e_ExtractionTurbineCHPBlock_input_output_relation(extraction_0)_:
-2 flow(extraction_electricity_0)
-0.57142857142857129 flow(extraction_heat_0)
+1 flow(gas_extraction_0)
= 0

c_e_ExtractionTurbineCHPBlock_input_output_relation(extraction_1)_:
-2 flow(extraction_electricity_1)
-0.57142857142857129 flow(extraction_heat_1)
+1 flow(gas_extraction_1)
= 0

c_e_ExtractionTurbineCHPBlock_input_output_relation(extraction_2)_:
-2 flow(extraction_electricity_2)
-0.57142857142857129 flow(extraction_heat_2)
+1 flow(gas_extraction_2)
= 0

c_u_ExtractionTurbineCHPBlock_out_flow_relation(extraction_0)_:
-1 flow(extraction_electricity_0)
+1.142857142857143 flow(extraction_heat_0)
<= 0

c_u_ExtractionTurbineCHPBlock_out_flow_relation(extraction_1)_:
-1 flow(extraction_electricity_1)
+1.142857142857143 flow(extraction_heat_1)
<= 0

c_u_ExtractionTurbineCHPBlock_out_flow_relation(extraction_2)_:
-1 flow(extraction_electricity_2)
+1.142857142857143 flow(extraction_heat_2)
<= 0

c_e_ONE_VAR_CONSTANT:
ONE_VAR_CONSTANT = 1.0

bounds
0 <= flow(extraction_electricity_0) <= +inf
0 <= flow(extraction_electricity_1) <= +inf
0 <= flow(extraction_electricity_2) <= +inf
0 <= flow(extraction_heat_0) <= +inf
0 <= flow(extraction_heat_1) <= +inf
0 <= flow(extraction_heat_2) <= +inf
0 <= flow(gas_extraction_0) <= +inf
0 <= flow(gas_extraction_1) <= +inf
0 <= flow(gas_extraction_2) <= +inf
0 <= InvestmentFlow_invest(extraction_electricity) <= +inf
end
Loading