-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from IDAES/dev
Merge dev into main
- Loading branch information
Showing
10 changed files
with
1,235 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
from pyomo.common.config import ( | ||
ConfigBlock, | ||
ConfigDict, | ||
ConfigList, | ||
ConfigValue, | ||
In, | ||
NonNegativeFloat, | ||
NonNegativeInt, | ||
PositiveInt, | ||
Bool, | ||
) | ||
from pyomo.common.deprecation import deprecation_warning | ||
|
||
_supported_flows = { | ||
"DC": ("gtep.dcopf", "DC power flow approximation"), | ||
"CP": ("gtep.cp", "Copper plate power flow approximation"), | ||
} | ||
|
||
|
||
def _get_model_config(): | ||
CONFIG = ConfigBlock("GTEPModelConfig") | ||
CONFIG.declare( | ||
"flow_model", | ||
ConfigValue( | ||
default="DC", | ||
domain=In(_supported_flows), | ||
description="Power flow approximation to use.", | ||
), | ||
) | ||
CONFIG.declare( | ||
"time_period_dict", | ||
ConfigDict( | ||
description="Time period dict, specified as \{(investment period #, length): \{(commitment period #, length): \{dispatch period #: length\}\}\}" | ||
), | ||
) | ||
CONFIG.declare( | ||
"dispatch_randomizations", | ||
ConfigValue( | ||
default=True, | ||
domain=Bool, | ||
description="Introduces random dispatch information rather than having fixed values per-commitment period.", | ||
), | ||
) | ||
return CONFIG | ||
|
||
|
||
def _add_common_configs(CONFIG): | ||
pass | ||
|
||
|
||
def _add_investment_configs(CONFIG): | ||
CONFIG.declare( | ||
"thermal_generation", | ||
ConfigValue( | ||
default=False, | ||
domain=Bool, | ||
description="Include thermal generation investment options", | ||
), | ||
) | ||
CONFIG.declare( | ||
"renewable_generation", | ||
ConfigValue( | ||
default=False, | ||
domain=Bool, | ||
description="Include renewable generation investment options", | ||
), | ||
) | ||
CONFIG.declare( | ||
"storage", | ||
ConfigValue( | ||
default=False, domain=Bool, description="Include storage investment options" | ||
), | ||
) | ||
CONFIG.declare( | ||
"transmission", | ||
ConfigValue( | ||
default=False, | ||
domain=Bool, | ||
description="Include transmission investment options", | ||
), | ||
) | ||
pass | ||
|
||
|
||
def _add_solver_configs(CONFIG): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
GEN UID,Bus ID,Unit Type,Fuel,MW Inj,MVAR Inj,V Setpoint p.u.,PMax MW,PMin MW,QMax MVAR,QMin MVAR,Min Down Time Hr,Min Up Time Hr,Ramp Rate MW/Min,Start Time Cold Hr,Start Time Warm Hr,Start Time Hot Hr,Start Heat Cold MBTU,Start Heat Warm MBTU,Start Heat Hot MBTU,Non Fuel Start Cost $,Fuel Price $/MMBTU,Output_pct_0,Output_pct_1,Output_pct_2,Output_pct_3,Output_pct_4,HR_avg_0,HR_incr_1,HR_incr_2,HR_incr_3,HR_incr_4 | ||
3_CT,3,CT,G,0,0,1,20,8,20,-20,1,1,3,,,1,,,51.75,0,0.75,0.4,0.6,0.8,1,,135722.5,97862.5,98072.5,107135, | ||
10_STEAM,10,STEAM,C,0,0,1,76,30,76,-76,4,8,2,12,10,4,11383.41,10488.35,7355.42,0,1,0.394736842,0.596052632,0.798684211,1,,30166.66667,14402.61434,17182.46753,18283.66017, | ||
4_CC,4,CC,G,0,0,1,100,10,55,-55,3,3,3.7,,,3,,,5665.23,0,0.5,0.4,0.6,0.8,1,,51019.54545,26818.18182,29550.90909,30308.18182, | ||
4_CC-c,4,CC,G,0,0,1,100,10,55,-55,3,3,3.7,,,3,,,5665.23,0,0.5,0.4,0.6,0.8,1,,51019.54545,26818.18182,29550.90909,30308.18182, | ||
4_STEAM,4,STEAM,O,0,0,1,12,5,12,-12,2,4,1,12,4,2,703.76,455.37,393.28,0,1.5,0.416666667,0.608333333,0.808333333,1,,179457.9999,124504.3483,125050,133643.478, | ||
10_PV,10,PV,S,0,0,1,25.9,0,0,0,,,,,,,,,,0,,,,,,,,,,, | ||
2_RTPV,2,RTPV,S,0,0,1,9.3,0,0,0,,,,,,,,,,0,,,,,,,,,,, | ||
1_HYDRO,1,HYDRO,H,0,0,1,50,0,16,-10,,,,,,,,,,0,,,,,,,,,,, | ||
4_WIND-c,4,WIND,W,0,0,1,120,0,0,0,,,,,,,,,,0,,,,,,,,,,, | ||
4_WIND,4,WIND,W,0,0,1,120,0,0,0,,,,,,,,,,0,,,,,,,,,,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
from gtep.gtep_model import ExpansionPlanningModel | ||
from gtep.gtep_data import ExpansionPlanningData | ||
from gtep.gtep_solution import ExpansionPlanningSolution | ||
from pyomo.core import TransformationFactory | ||
from pyomo.contrib.appsi.solvers.highs import Highs | ||
from pyomo.contrib.appsi.solvers.gurobi import Gurobi | ||
from icecream import ic | ||
|
||
|
||
data_path = "./gtep/data/5bus" | ||
data_object = ExpansionPlanningData() | ||
data_object.load_prescient(data_path) | ||
|
||
|
||
|
||
mod_object = ExpansionPlanningModel( | ||
stages=1, | ||
data=data_object.md, | ||
num_reps=1, | ||
len_reps=1, | ||
num_commit=24, | ||
num_dispatch=4, | ||
) | ||
|
||
for k,v in mod_object.config.items(): | ||
ic(k,v) | ||
|
||
quit() | ||
|
||
mod_object.create_model() | ||
|
||
ic(mod_object) | ||
|
||
|
||
quit() | ||
TransformationFactory("gdp.bound_pretransformation").apply_to(mod_object.model) | ||
TransformationFactory("gdp.bigm").apply_to(mod_object.model) | ||
# opt = SolverFactory("gurobi") | ||
opt = Gurobi() | ||
# opt = Highs() | ||
# # mod_object.results = opt.solve(mod_object.model, tee=True) | ||
mod_object.results = opt.solve(mod_object.model) | ||
|
||
sol_object = ExpansionPlanningSolution() | ||
sol_object.load_from_model(mod_object) | ||
sol_object.dump_json("./gtep_solution.json") | ||
|
||
sol_object.import_data_object(data_object) | ||
|
||
# sol_object.read_json("./gtep_lots_of_buses_solution.json") # "./gtep/data/WECC_USAEE" | ||
# sol_object.read_json("./gtep_11bus_solution.json") # "./gtep/data/WECC_Reduced_USAEE" | ||
# sol_object.read_json("./gtep_solution.json") | ||
# sol_object.read_json("./updated_gtep_solution_test.json") | ||
# sol_object.read_json("./gtep_wiggles.json") | ||
sol_object.plot_levels(save_dir="./plots/") | ||
|
||
# save_numerical_results = False | ||
# if save_numerical_results: | ||
|
||
# sol_object = ExpansionPlanningSolution() | ||
|
||
# sol_object.load_from_model(mod_object) | ||
# sol_object.dump_json() | ||
# load_numerical_results = False | ||
# if load_numerical_results: | ||
# # sol_object.read_json("./gtep_solution.json") | ||
# sol_object.read_json("./bigger_longer_wigglier_gtep_solution.json") | ||
# plot_results = False | ||
# if plot_results: | ||
# sol_object.plot_levels(save_dir="./plots/") | ||
|
||
|
||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.