Skip to content
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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-20171691804.79
-20171691798.19
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-20171691804.79
-20171691798.19
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-26966855745105.86
-26966855745114.64
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-26966855745105.86
-26966855745114.64
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-101086984772719.08
-101086984772727.86
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-26966855745105.86
-26966855745114.64
30 changes: 0 additions & 30 deletions examples/2periods_new_build_rps/results/summary_results.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
-26966855745105.86
-26966855745114.64
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-17323444870.08
-17323444876.67
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-17323445422.08
-17323445428.67
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-11133045900.18
-11133045900.19
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-6852354303.66
-6852354310.25
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2016-2023 Blue Marble Analytics LLC.
# Copyright 2016-2025 Blue Marble Analytics LLC.
# Copyright 2026 Sylvan Energy Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,9 +15,11 @@

""" """

# TODO: move this functionality to the optype modules

import os.path
import pandas as pd
from pyomo.environ import Param, PercentFraction, Constraint
from pyomo.environ import Param, NonNegativeReals, Constraint

from gridpath.auxiliary.auxiliary import get_required_subtype_modules
from gridpath.project.operations.common_functions import load_operational_type_modules
Expand Down Expand Up @@ -58,12 +61,17 @@ def generic_add_model_components(
# therefore limited by its ramp rate, e.g. if it can ramp up 60 MW an hour,
# then it will only be able to provide 10 MW of upward reserve for a
# reserve product with a 10-minute response requirement \
# Here, this derate param is specified as a fraction of generator capacity
# Defaults to 1 if not specified
# Here, this derate param is specified as a function of "online" generator
# capacity
# Defaults to infinity if not specified
setattr(
m,
reserve_provision_ramp_rate_limit_param,
Param(getattr(m, reserve_projects_set), within=PercentFraction, default=1),
Param(
getattr(m, reserve_projects_set),
within=NonNegativeReals,
default=float("inf"),
),
)

# Import needed operational modules
Expand Down Expand Up @@ -97,11 +105,14 @@ def reserve_provision_ramp_rate_limit_rule(mod, g, tmp):
else op_type.online_capacity_rule(mod, g, tmp)
)

return (
getattr(mod, reserve_provision_variable_name)[g, tmp]
<= getattr(mod, reserve_provision_ramp_rate_limit_param)[g]
* online_capacity
)
if getattr(mod, reserve_provision_ramp_rate_limit_param)[g] == float("inf"):
return Constraint.Skip
else:
return (
getattr(mod, reserve_provision_variable_name)[g, tmp]
<= getattr(mod, reserve_provision_ramp_rate_limit_param)[g]
* online_capacity
)

setattr(
m,
Expand Down Expand Up @@ -159,7 +170,7 @@ def generic_load_model_data(

# Import reserve provision ramp rate limit parameter only if
# column is present
# Otherwise, the ramp rate limit param goes to its default of 1
# Otherwise, the ramp rate limit param goes to its default of infinity
if ramp_rate_limit_column_name in projects_file_header:
columns_to_import += (ramp_rate_limit_column_name,)
params_to_import += (getattr(m, reserve_provision_ramp_rate_limit_param),)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ def test_data_loaded_correctly(self):
)
instance = m.create_instance(data)

# Param: frequency_response_ramp_rate_limit (defaults to 1 if not
# Param: frequency_response_ramp_rate_limit (defaults to infinity if not
# specified)
expected_rr_limit = OrderedDict(
sorted(
{
"Battery": 1,
"Battery_Binary": 1,
"Battery_Specified": 1,
"Battery_Specified": float("inf"),
"Gas_CCGT": 0.1,
"Gas_CCGT_New": 0.2,
"Gas_CCGT_New_Binary": 0.2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ def test_data_loaded_correctly(self):
)
instance = m.create_instance(data)

# Param: lf_reserves_down_ramp_rate_limit (defaults to 1 if not
# Param: lf_reserves_down_ramp_rate_limit (defaults to infinity if not
# specified)
expected_rr_limit = OrderedDict(
sorted(
{
"Battery": 1,
"Battery_Binary": 1,
"Battery_Specified": 1,
"Battery_Specified": float("inf"),
"Gas_CCGT": 0.1,
"Gas_CCGT_New": 0.2,
"Gas_CCGT_New_Binary": 0.2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ def test_data_loaded_correctly(self):
)
instance = m.create_instance(data)

# Param: lf_reserves_up_ramp_rate_limit (defaults to 1 if not
# Param: lf_reserves_up_ramp_rate_limit (defaults to infinity if not
# specified)
expected_rr_limit = OrderedDict(
sorted(
{
"Battery": 1,
"Battery_Binary": 1,
"Battery_Specified": 1,
"Battery_Specified": float("inf"),
"Gas_CCGT": 0.1,
"Gas_CCGT_New": 0.2,
"Gas_CCGT_New_Binary": 0.2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_data_loaded_correctly(self):
)
instance = m.create_instance(data)

# Param: regulation_down_ramp_rate_limit (defaults to 1 if not
# Param: regulation_down_ramp_rate_limit (defaults to infinity if not
# specified)
expected_rr_limit = OrderedDict(
sorted(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_data_loaded_correctly(self):
)
instance = m.create_instance(data)

# Param: regulation_up_ramp_rate_limit (defaults to 1 if not
# Param: regulation_up_ramp_rate_limit (defaults to infinity if not
# specified)
expected_rr_limit = OrderedDict(
sorted(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ def test_data_loaded_correctly(self):
)
instance = m.create_instance(data)

# Param: spinning_reserves_ramp_rate_limit (defaults to 1 if not
# Param: spinning_reserves_ramp_rate_limit (defaults to infinity if not
# specified)
expected_rr_limit = OrderedDict(
sorted(
{
"Battery": 1,
"Battery_Binary": 1,
"Battery_Specified": 1,
"Battery_Specified": float("inf"),
"Gas_CCGT": 0.1,
"Gas_CCGT_New": 0.2,
"Gas_CCGT_New_Binary": 0.2,
Expand Down
22 changes: 11 additions & 11 deletions tests/test_data/test_scenario_objective_function_values.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_aux_cons,"{('', '', '', 1): {1: -3664910801437.807}}","{('', '', '', 1): {1
2periods_gen_bin_econ_retirement,"{('', '', '', 1): {1: -75926182429562.45}}","{('', '', '', 1): {1: -75926182429562.45}}",,,
2periods_gen_lin_econ_retirement,"{('', '', '', 1): {1: -75926125638846.83}}","{('', '', '', 1): {1: -75926125638846.83}}",,,
2periods_new_build,"{('', '', '', 1): {1: -10085845900.191605}}","{('', '', '', 1): {1: -10085845900.191605}}",,,
2periods_new_build_2zones,"{('', '', '', 1): {1: -20171691804.789494}}","{('', '', '', 1): {1: -20171691804.789494}}",,,
2periods_new_build_2zones,"{('', '', '', 1): {1: -20171691798.19321}}","{('', '', '', 1): {1: -20171691798.19321}}",,,
2periods_new_build_2zones_new_build_transmission,"{('', '', '', 1): {1: -7028494941419.333}}","{('', '', '', 1): {1: -7028494941419.333}}",,,
2periods_new_build_2zones_singleBA,"{('', '', '', 1): {1: -20171691754.438328}}","{('', '', '', 1): {1: -20171691754.438328}}",,,
2periods_new_build_2zones_transmission,"{('', '', '', 1): {1: -220771078212311.7}}","{('', '', '', 1): {1: -220771078212311.7}}",,,
Expand All @@ -23,21 +23,21 @@ test_aux_cons,"{('', '', '', 1): {1: -3664910801437.807}}","{('', '', '', 1): {1
2periods_new_build_cumulative_and_vintage_min_max,"{('', '', '', 1): {1: -110384972580597.61}}","{('', '', '', 1): {1: -110384972580597.61}}",,,
2periods_new_build_cumulative_min_max,"{('', '', '', 1): {1: -27166044526940.195}}","{('', '', '', 1): {1: -27166044526940.195}}",,,
2periods_new_build_fin_lifetime,"{('', '', '', 1): {1: -10022366566.861605}}","{('', '', '', 1): {1: -10022366566.861605}}",,,
2periods_new_build_horizon_energy_target,"{('', '', '', 1): {1: -26966855745105.855}}","{('', '', '', 1): {1: -26966855745105.855}}",,,
2periods_new_build_horizon_energy_target_halfyear,"{('', '', '', 1): {1: -101086984772719.08}}","{('', '', '', 1): {1: -101086984772719.08}}",,,
2periods_new_build_horizon_energy_target,"{('', '', '', 1): {1: -26966855745114.637}}","{('', '', '', 1): {1: -26966855745114.637}}",,,
2periods_new_build_horizon_energy_target_halfyear,"{('', '', '', 1): {1: -101086984772727.86}}","{('', '', '', 1): {1: -101086984772727.86}}",,,
2periods_new_build_local_capacity,"{('', '', '', 1): {1: -10087189895.81292}}","{('', '', '', 1): {1: -10087189895.81292}}",,,
2periods_new_build_rps,"{('', '', '', 1): {1: -26966855745105.855}}","{('', '', '', 1): {1: -26966855745105.855}}",,,
2periods_new_build_rps_percent_target,"{('', '', '', 1): {1: -26966855745105.855}}","{('', '', '', 1): {1: -26966855745105.855}}",,,
2periods_new_build_rps,"{('', '', '', 1): {1: -26966855745114.637}}","{('', '', '', 1): {1: -26966855745114.637}}",,,
2periods_new_build_rps_percent_target,"{('', '', '', 1): {1: -26966855745114.637}}","{('', '', '', 1): {1: -26966855745114.637}}",,,
2periods_new_build_rps_variable_reserves,"{('', '', '', 1): {1: -4980266823.194146}}","{('', '', '', 1): {1: -4980266823.194146}}",,,
2periods_new_build_rps_variable_reserves_subhourly_adj,"{('', '', '', 1): {1: -4980266823.194146}}","{('', '', '', 1): {1: -4980266823.194146}}",,,
2periods_new_build_rps_w_rps_eligible_storage,"{('', '', '', 1): {1: -26966830249911.2}}","{('', '', '', 1): {1: -26966830249911.2}}",,,
2periods_new_build_rps_w_rps_ineligible_storage,"{('', '', '', 1): {1: -16980455713585.201}}","{('', '', '', 1): {1: -16980455713585.201}}",,,
2periods_new_build_simple_prm,"{('', '', '', 1): {1: -10153045900.191605}}","{('', '', '', 1): {1: -10153045900.191605}}",,,
2periods_new_build_simple_prm_2loadzones,"{('', '', '', 1): {1: -613211671721885.6}}","{('', '', '', 1): {1: -613211671721885.6}}",,,
2periods_new_build_simple_prm_2loadzones_newtx_w_transfers,"{('', '', '', 1): {1: -17323444870.08401}}","{('', '', '', 1): {1: -17323444870.08401}}",,,
2periods_new_build_simple_prm_2loadzones_newtx_w_transfers_w_costs,"{('', '', '', 1): {1: -17323445422.08401}}","{('', '', '', 1): {1: -17323445422.08401}}",,,
2periods_new_build_simple_prm_2loadzones_newtx_w_transfers,"{('', '', '', 1): {1: -17323444876.665836}}","{('', '', '', 1): {1: -17323444876.665836}}",,,
2periods_new_build_simple_prm_2loadzones_newtx_w_transfers_w_costs,"{('', '', '', 1): {1: -17323445428.665836}}","{('', '', '', 1): {1: -17323445428.665836}}",,,
2periods_new_build_simple_prm_2loadzones_newtx_w_transfers_w_subsidies,"{('', '', '', 1): {1: -17323439361.04978}}","{('', '', '', 1): {1: -17323439361.04978}}",,,
2periods_new_build_simple_prm_w_energy_only,"{('', '', '', 1): {1: -11133045900.181093}}","{('', '', '', 1): {1: -11133045900.181093}}",,,
2periods_new_build_simple_prm_w_energy_only,"{('', '', '', 1): {1: -11133045900.194233}}","{('', '', '', 1): {1: -11133045900.194233}}",,,
2periods_new_build_simple_prm_w_energy_only_deliv_cap_limit,"{('', '', '', 1): {1: -11133045900.191605}}","{('', '', '', 1): {1: -11133045900.191605}}",,,
multi_stage_prod_cost,"{('', '', '', 1): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436373826.099}, ('', '', '', 2): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436373826.099}, ('', '', '', 3): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436373826.099}}","{('', '', '', 1): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436373826.099}, ('', '', '', 2): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436373826.099}, ('', '', '', 3): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436373826.099}}",,,
multi_stage_prod_cost_linked_subproblems,"{('', '', '', 1): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436372366.0408}, ('', '', '', 2): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436372366.0408}, ('', '', '', 3): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436372366.0408}}","{('', '', '', 1): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436372366.0408}, ('', '', '', 2): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436372366.0408}, ('', '', '', 3): {1: -1265436373826.0408, 2: -1265436373826.0408, 3: -1265436372366.0408}}",,,
Expand Down Expand Up @@ -118,7 +118,7 @@ ra_toolkit_sync,"{('weather_iteration_2010', 'hydro_iteration_2010', 'availabili
ra_toolkit_sync_single_year,"{('weather_iteration_2010', 'hydro_iteration_2010', 'availability_iteration_1', 1): {1: -0.0}, ('weather_iteration_2010', 'hydro_iteration_2010', 'availability_iteration_1', 2): {1: -0.0}}","{('weather_iteration_2010', 'hydro_iteration_2010', 'availability_iteration_1', 1): {1: -0.0}, ('weather_iteration_2010', 'hydro_iteration_2010', 'availability_iteration_1', 2): {1: -0.0}}",,,
test_performance_standard_power,"{('', '', '', 1): {1: -3504414927375.9478}}","{('', '', '', 1): {1: -3504414927375.9478}}",,,
test_performance_standard_both,"{('', '', '', 1): {1: -3592014754469.9077}}","{('', '', '', 1): {1: -3592014754469.9077}}",,,
test_new_instantaneous_penetration,"{('', '', '', 1): {1: -6852354303.662479}}","{('', '', '', 1): {1: -6852354303.662479}}",,,
test_new_instantaneous_penetration,"{('', '', '', 1): {1: -6852354310.254818}}","{('', '', '', 1): {1: -6852354310.254818}}",,,
test_tx_flow_w_simflow,"{('', '', '', 1): {1: -59168136183373.484}}","{('', '', '', 1): {1: -59168136183373.484}}",,,
hydro_system,"{('', '', '', 1): {1: 17519.999222673472}}","{('', '', '', 1): {1: 17519.999222673472}}",,,
hydro_system_exog_elev,"{('', 'hydro_iteration_1', '', 1): {1: -0.0}}","{('', 'hydro_iteration_1', '', 1): {1: -0.0}}",,,
Expand All @@ -133,12 +133,12 @@ test_w_lf,"{('', '', '', 1): {1: -175270657.06592113}}","{('', '', '', 1): {1: -
test_w_lf_w_demand_charges,"{('', '', '', 1): {1: -175270707.06592113}}","{('', '', '', 1): {1: -175270707.06592113}}",,,
test_w_lf_only,"{('', '', '', 1): {1: -0.0}}","{('', '', '', 1): {1: -0.0}}",,,
test_w_lf_only_and_prices,"{('', '', '', 1): {1: -21900000.0}}","{('', '', '', 1): {1: np.float64(-21900000.0)}}",,,
2periods_new_build_2zones_loadcomponents,"{('', '', '', 1): {1: -20171691804.789494}}","{('', '', '', 1): {1: -20171691804.789494}}",,,
2periods_new_build_2zones_loadcomponents,"{('', '', '', 1): {1: -20171691798.19321}}","{('', '', '', 1): {1: -20171691798.19321}}",,,
test_w_lf_only_energy_potential_limit,"{('', '', '', 1): {1: -3139999980999.9995}}","{('', '', '', 1): {1: -3139999980999.9995}}",,,
test_w_hydro_as_slice_candidate,"{('', '', '', 1): {1: -200490477.22404}}","{('', '', '', 1): {1: -200490477.22404}}",,,
test_w_energy_products,"{('', '', '', 1): {1: -16211256.0}}","{('', '', '', 1): {1: np.float64(-16211256.0)}}",,,
test_w_energy_products_group_limits,"{('', '', '', 1): {1: -140015997056.28812}}","{('', '', '', 1): {1: np.float64(-140015997056.28812)}}",,,
2periods_new_build_generic_policy,"{('', '', '', 1): {1: -26966855745105.855}}","{('', '', '', 1): {1: -26966855745105.855}}",,,
2periods_new_build_generic_policy,"{('', '', '', 1): {1: -26966855745114.637}}","{('', '', '', 1): {1: -26966855745114.637}}",,,
open_data,"{('weather_iteration_2010', 'hydro_iteration_2010', '', 1): {1: -177248006449.44724}, ('weather_iteration_2010', 'hydro_iteration_2010', '', 2): {1: -206929765361.27356}}","{('weather_iteration_2010', 'hydro_iteration_2010', '', 1): {1: -177248006449.44724}, ('weather_iteration_2010', 'hydro_iteration_2010', '', 2): {1: -206929765361.27356}}",,,
hydro_system_exog_elev_w_travel_time_and_max_halfday_flows,"{('', 'hydro_iteration_1', '', 1): {1: -0.0}}","{('', 'hydro_iteration_1', '', 1): {1: -0.0}}",,,
hydro_system_w_ramp_limits,"{('', 'hydro_iteration_1', '', 1): {1: -0.0}}","{('', 'hydro_iteration_1', '', 1): {1: -0.0}}",,,
Expand Down
Loading