diff --git a/gtep/driver.py b/gtep/driver.py index e9d9ab1..15f7411 100644 --- a/gtep/driver.py +++ b/gtep/driver.py @@ -11,31 +11,31 @@ data_object.load_prescient(data_path) mod_object = ExpansionPlanningModel( - stages=4, + stages=6, data=data_object.md, num_reps=2, len_reps=1, - num_commit=12, + num_commit=24, num_dispatch=4, ) mod_object.create_model() 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) +# 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() +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("./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/") diff --git a/gtep/gtep_model.py b/gtep/gtep_model.py index 5f8367e..faadb86 100644 --- a/gtep/gtep_model.py +++ b/gtep/gtep_model.py @@ -25,6 +25,8 @@ # based on automatic pyomo unit transformations u.load_definitions_from_strings(["USD = [currency]"]) +rng = np.random.default_rng(seed=164324) + #################################### ########## New Work Here ########### #################################### @@ -617,10 +619,10 @@ def add_dispatch_constraints(b, disp_per): # repeats the load values for each period, which seems to always lead to # all generators always on (???) - rng = np.random.default_rng() + for key in m.loads.keys(): - m.loads[key] *= max(0, rng.normal(1.0, 0.5)) + m.loads[key] *= max(0, rng.normal(1.0, 0.1)) # JSC question: Will forcing uninvested lines to have no power flow (via # the flow limits) cause infeasibility? Driving idea is: do we need to @@ -941,7 +943,6 @@ def operatingCostCommitment(b): for gen in m.thermalGenerators ) ## FIXME: how do we do assign fixed operating costs to renewables; flat per location or per MW - ## FIXME: @John + sum( m.fixedOperatingCost[gen] # * m.renewableCapacity[gen] diff --git a/gtep/gtep_solution.py b/gtep/gtep_solution.py index ccaade8..071f077 100644 --- a/gtep/gtep_solution.py +++ b/gtep/gtep_solution.py @@ -691,17 +691,19 @@ def _level_plot_workhorse( pretty_title=this_pretty_title, save_dir=save_dir,) - # [HACK] put this back one intent level when done + # [HACK] put this back one indent level when done + ## tab this back and forth to do the things + # plot it - self._level_relationship_df_to_plot( - level_key, - this_df_of_interest, - tmp_koi, - tmp_voi, - parent_key_string, - pretty_title=this_pretty_title, - save_dir=save_dir, - plot_bounds=plot_bounds) + self._level_relationship_df_to_plot( + level_key, + this_df_of_interest, + tmp_koi, + tmp_voi, + parent_key_string, + pretty_title=this_pretty_title, + save_dir=save_dir, + plot_bounds=plot_bounds) def _plot_graph_workhorse(self,