Skip to content

Commit

Permalink
current status
Browse files Browse the repository at this point in the history
  • Loading branch information
rundxdi committed Jul 8, 2024
1 parent dec9f3b commit 961eb75
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
14 changes: 7 additions & 7 deletions gtep/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down
7 changes: 4 additions & 3 deletions gtep/gtep_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###########
####################################
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
22 changes: 12 additions & 10 deletions gtep/gtep_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 961eb75

Please sign in to comment.