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

Bidirectional tx builds #125

Open
wants to merge 4 commits into
base: next_release
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion examples/3zone_toy/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 2 additions & 0 deletions examples/3zone_toy/inputs/trans_build_predetermined.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TRANSMISSION_LINE,PERIOD,trans_predetermined_cap
C-S,2030,2.5
4 changes: 3 additions & 1 deletion examples/3zone_toy/inputs/transmission_lines.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
TRANSMISSION_LINE,trans_lz1,trans_lz2,trans_length_km,trans_efficiency,existing_trans_cap
TRANSMISSION_LINE,trans_lz_send,trans_lz_receive,trans_length_km,trans_efficiency,existing_trans_cap
N-C,North,Central,100,0.96,3
C-S,Central,South,200,0.94,6
Central-North,Central,North,100,0.96,3
South-Central,South,Central,200,0.94,6
2 changes: 1 addition & 1 deletion examples/3zone_toy/outputs/total_cost.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
134733088.429
134736088.426
6 changes: 3 additions & 3 deletions examples/3zone_toy_stochastic_PySP/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ lower bounds set in the core mathematical model, bounds can be added in a
configuration file which is named pha_bounds_cfg.py in this example. To run
progressive hedging with a linear solver such as glpk, use the following command:

>>>runph --model-location=. --instance-directory=inputs/pysp_inputs \
>>>runph --model-directory . --instance-directory=inputs/pysp_inputs \
--solver=glpk --default-rho=1000.0 --traceback \
--rho-cfgfile=rhosetter.py \
--solution-writer=pyomo.pysp.plugins.csvsolutionwriter \
Expand All @@ -178,9 +178,9 @@ decisions are similar, but slightly different.

Another equivalent way of solving this example is to run the command:

>>>runph --model-location=. --instance-directory=inputs/pysp_inputs \
>>>runph --model-directory . --instance-directory=inputs/pysp_inputs \
--solver=gurobi --default-rho=1000.0 --traceback \
--rho-cfgfile=rhosetter-FS-only.py \
--rho-cfgfile=rhosetter_FS_only.py \
--solution-writer=pyomo.pysp.plugins.csvsolutionwriter \
--output-scenario-tree-solution

Expand Down
54 changes: 32 additions & 22 deletions examples/3zone_toy_stochastic_PySP/inputs/pysp_inputs/RootNode.dat
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,26 @@ param interest_rate := 0.07;
param discount_rate := 0.05;
set LOAD_ZONES := North Central South;
param zone_demand_mw :=
North 1 5
North 2 4
North 1 5.0
North 2 4.0
North 3 4.5
North 4 4.2
North 5 4
North 6 6
North 7 6
North 5 4.0
North 6 6.0
North 7 6.0
Central 1 3.7
Central 2 3
Central 2 3.0
Central 3 3.6
Central 4 3.3
Central 5 3
Central 6 4
Central 5 3.0
Central 6 4.0
Central 7 4.6
South 1 6
South 2 7
South 1 6.0
South 2 7.0
South 3 6.5
South 4 7.2
South 5 8
South 6 10
South 5 8.0
South 6 10.0
South 7 10.5
;
set EXTERNAL_COINCIDENT_PEAK_DEMAND_ZONE_PERIODS := ('North', 2020) ('Central', 2020) ('South', 2020) ('North', 2030) ('Central', 2030) ('South', 2030);
Expand All @@ -86,18 +86,18 @@ param zone_expected_coincident_peak_demand :=
set NON_FUEL_ENERGY_SOURCES := Wind Solar Geothermal Water Electricity;
set FUELS := Coal ResidualFuelOil DistillateFuelOil NaturalGas Uranium BioSolid;
param f_co2_intensity :=
Coal 0.09552
Coal 0.09552000000000001
ResidualFuelOil 0.0788
DistillateFuelOil 0.07315
NaturalGas 0.05306
Uranium 0
Uranium 0.0
BioSolid 0.09435
;
param f_upstream_co2_intensity :=
Coal 0
ResidualFuelOil 0
DistillateFuelOil 0
NaturalGas 0
Coal 0.0
ResidualFuelOil 0.0
DistillateFuelOil 0.0
NaturalGas 0.0
BioSolid -0.09435
;
set GENERATION_PROJECTS := N-Geothermal N-Coal_IGCC N-Coal_IGCC_CCS N-Coal_ST N-NG_CC N-NG_CC_CCS N-NG_GT N-Nuclear N-Biomass_IGCC N-Biomass_IGCC_CCS N-Residential_PV N-Commercial_PV N-Central_PV-1 N-Central_PV-2 N-Wind-1 N-Wind-2 C-Coal_IGCC C-Coal_ST C-NG_CC C-NG_GT C-Nuclear C-Biomass_IGCC C-Residential_PV C-Commercial_PV C-Central_PV-1 C-Central_PV-2 C-Wind-1 C-Wind-2 S-Geothermal S-NG_CC S-NG_CC_CCS S-NG_GT S-Biomass_IGCC S-Biomass_IGCC_CCS S-Residential_PV S-Commercial_PV S-Central_PV-1 S-Central_PV-2;
Expand Down Expand Up @@ -471,7 +471,7 @@ param gen_full_load_heat_rate :=
param gen_variable_om :=
N-Geothermal 28.83
N-Coal_IGCC 6.0822
N-Coal_IGCC_CCS 9.858
N-Coal_IGCC_CCS 9.857999999999999
N-Coal_ST 3.4
N-NG_CC 3.4131
N-NG_CC_CCS 9.3
Expand Down Expand Up @@ -951,24 +951,34 @@ param fuel_cost :=
Central BioSolid 2030 7.5
South BioSolid 2030 7.5
;
set TRANSMISSION_LINES := N-C C-S;
param trans_lz1 :=
set TRANSMISSION_LINES := N-C C-S Central-North South-Central;
param trans_lz_send :=
N-C "North"
C-S "Central"
Central-North "Central"
South-Central "South"
;
param trans_lz2 :=
param trans_lz_receive :=
N-C "Central"
C-S "South"
Central-North "North"
South-Central "Central"
;
param trans_length_km :=
N-C 100
C-S 200
Central-North 100
South-Central 200
;
param trans_efficiency :=
N-C 0.96
C-S 0.94
Central-North 0.96
South-Central 0.94
;
param existing_trans_cap :=
N-C 3
C-S 6
Central-North 3
South-Central 6
;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
TRANSMISSION_LINE,trans_lz1,trans_lz2,trans_length_km,trans_efficiency,existing_trans_cap
TRANSMISSION_LINE,trans_lz_send,trans_lz_receive,trans_length_km,trans_efficiency,existing_trans_cap
N-C,North,Central,100,0.96,3
C-S,Central,South,200,0.94,6
Central-North,Central,North,100,0.96,3
South-Central,South,Central,200,0.94,6
2 changes: 1 addition & 1 deletion examples/carbon_cap/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
4 changes: 3 additions & 1 deletion examples/carbon_cap/inputs/transmission_lines.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
TRANSMISSION_LINE,trans_lz1,trans_lz2,trans_length_km,trans_efficiency,existing_trans_cap
TRANSMISSION_LINE,trans_lz_send,trans_lz_receive,trans_length_km,trans_efficiency,existing_trans_cap
N-C,North,Central,100,0.96,3
C-S,Central,South,200,0.94,6
Central-North,Central,North,100,0.96,3
South-Central,South,Central,200,0.94,6
2 changes: 1 addition & 1 deletion examples/ccs/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/copperplate0/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/copperplate1/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/custom_extension/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/discrete_build/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/dr_simple/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/hydro_simple/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/hydro_system/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/new_builds_only/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
4 changes: 3 additions & 1 deletion examples/planning_reserves/inputs/transmission_lines.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
TRANSMISSION_LINE,trans_lz1,trans_lz2,trans_length_km,trans_efficiency,existing_trans_cap
TRANSMISSION_LINE,trans_lz_send,trans_lz_receive,trans_length_km,trans_efficiency,existing_trans_cap
N-C,North,Central,100,0.96,3
C-S,Central,South,200,0.94,6
Central-North,Central,North,100,0.96,3
South-Central,South,Central,200,0.94,6
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion examples/rps_simple/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
4 changes: 3 additions & 1 deletion examples/rps_simple/inputs/transmission_lines.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
TRANSMISSION_LINE,trans_lz1,trans_lz2,trans_length_km,trans_efficiency,existing_trans_cap
TRANSMISSION_LINE,trans_lz_send,trans_lz_receive,trans_length_km,trans_efficiency,existing_trans_cap
N-C,North,Central,100,0.96,3
C-S,Central,South,200,0.94,6
Central-North,Central,North,100,0.96,3
South-Central,South,Central,200,0.94,6
2 changes: 1 addition & 1 deletion examples/storage/inputs/switch_inputs_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6dev1
2 changes: 1 addition & 1 deletion switch_model/reporting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def get_value(obj):

def save_total_cost_value(instance, outdir):
with open(os.path.join(outdir, 'total_cost.txt'), 'w') as fh:
fh.write('{}\n'.format(value(instance.SystemCost)))
fh.write('{:.3f}\n'.format(value(instance.SystemCost)))


def save_cost_components(m, outdir):
Expand Down
Loading