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

RTS-GMLC fixes #245

Merged
merged 4 commits into from
Sep 20, 2021
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
17 changes: 14 additions & 3 deletions egret/model_library/unit_commitment/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,26 @@ def power_generated_t0_validator(m, v, g):

else:
# Generator was off, but could have residual power due to
# start-up/shut-down curve. Therefore, do not be too picky
# as the value doesn't affect any constraints directly
# start-up/shut-down curve
return True

def power_generated_t0_initializer(m, g):
if value(m.UnitOnT0[g]):
return thermal_gen_attrs['initial_p_output'][g]
else:
# return zero here for ramping
# constraints which need this to
# be 0 when the generator is off
# (power generated when ramping down
# is handled "outside" the traditional
# thermal generator model)
return 0.

model.PowerGeneratedT0 = Param(model.ThermalGenerators,
within=NonNegativeReals,
validate=power_generated_t0_validator,
mutable=True,
initialize=thermal_gen_attrs['initial_p_output'])
initialize=power_generated_t0_initializer)

# limits for time periods in which generators are brought on or off-line.
# must be no less than the generator minimum output.
Expand Down
7 changes: 7 additions & 0 deletions egret/model_library/unit_commitment/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,13 @@ def ancillary_service_capacity_limit_lower(m, g, t):
((m.RegulationLowLimit[g,t] - m.MinimumPowerOutput[g,t])*m.RegulationOn[g,t] if reg else 0.)
model.AncillaryServiceCapacityLimitLower = Constraint(model.ThermalGenerators, model.TimePeriods, rule=ancillary_service_capacity_limit_lower)

# What follows is shared ramping constraints for reserves
# We don't include these constraints unless explicitly told
# to do so. They are not universally used and can be
# computationally expensive.
if not system.get('reserve_ramping_constraints', False):
return

## NOTE: ScaledNominalRampUpLimit/ScaledNominalRampDownLimit and ScaledStartupRampLimit/ScaledShutdownRampLimit
## are not appropriate in the ramp sharing constraints that follow.
## In particular, we need to possibly allow these to be larger than (MaximumPowerGenerated -
Expand Down
2 changes: 1 addition & 1 deletion egret/models/tests/uc_test_instances/tiny_uc_1.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion egret/models/tests/uc_test_instances/tiny_uc_10.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion egret/models/tests/uc_test_instances/tiny_uc_11.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion egret/models/tests/uc_test_instances/tiny_uc_2.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"elements": {"bus": {"Bus1": {}}, "load": {"Bus1": {"bus": "Bus1", "in_service": true, "p_load": {"data_type": "time_series", "values": [220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0]}}}, "generator": {"GEN1": {"generator_type": "thermal", "bus": "Bus1", "fuel": "G", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 150, "p_max": 455, "ramp_up_60min": 225, "ramp_down_60min": 225, "startup_capacity": 150, "shutdown_capacity": 150, "min_up_time": 8, "min_down_time": 8, "initial_status": 8, "initial_p_output": 220.0, "shutdown_cost": 0.0, "agc_capable": true, "ramp_agc": 3.75, "fast_start": false, "supplemental_start": true, "supplemental_non_spinning_capacity": 150, "p_min_agc": 165.0, "p_max_agc": 413.6363636363636, "fuel_supply": "fs_GEN1", "p_fuel": {"data_type": "fuel_curve", "values": [[150, 725.5142857142857], [250, 1193.5714285714287], [300, 1428.6285714285714], [400, 1900.8], [455, 2161.6634285714285]]}, "startup_fuel": [[8, 128.57142857142858], [14, 257.14285714285717]], "fuel_cost": 3.5}, "GEN5": {"generator_type": "thermal", "bus": "Bus1", "fuel": "O", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 25, "p_max": 162, "ramp_up_60min": 60, "ramp_down_60min": 60, "startup_capacity": 25, "shutdown_capacity": 25, "min_up_time": 6, "min_down_time": 6, "initial_status": -6, "initial_p_output": 0, "startup_cost": [[6, 90], [11, 180]], "shutdown_cost": 0.0, "p_cost": {"data_type": "cost_curve", "cost_curve_type": "piecewise", "values": [[25, 539.9875], [75, 1544.8875], [125, 2569.6875], [150, 3089.55], [162, 3340.85112]]}, "agc_capable": true, "ramp_agc": 1.0, "fast_start": true, "supplemental_start": true, "supplemental_non_spinning_capacity": 25, "non_spinning_capacity": 35.0, "p_min_agc": 27.500000000000004, "p_max_agc": 147.27272727272725}, "GEN6": {"generator_type": "thermal", "bus": "Bus1", "fuel": "G", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 20, "p_max": 80, "ramp_up_60min": 60, "ramp_down_60min": 60, "startup_capacity": 20, "shutdown_capacity": 20, "min_up_time": 3, "min_down_time": 3, "initial_status": -3, "initial_p_output": 0, "shutdown_cost": 0.0, "fixed_commitment": null, "agc_capable": true, "ramp_agc": 1.0, "fast_start": true, "supplemental_start": true, "supplemental_non_spinning_capacity": 20, "non_spinning_capacity": 30.0, "area": "Area1", "p_min_agc": 22.0, "p_max_agc": 72.72727272727272, "p_fuel": {"data_type": "fuel_curve", "values": [[20, 194.0192], [40, 375.5168], [60, 559.2927999999999], [80, 745.3471999999999]]}, "startup_fuel": [[3, 6.8], [8, 13.6]], "fuel_supply": "fs_GEN6", "fuel_cost": 2.5}}, "fuel_supply": {"fs_GEN1": {"fuel_supply_type": "instantaneous", "fuel_available": {"data_type": "time_series", "values": [1e+100, 1000.0, 800.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 800.0, 1000.0, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100]}}, "fs_GEN6": {"fuel_supply_type": "instantaneous", "fuel_available": {"data_type": "time_series", "values": [1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 400.0, 200.0, 100.0, 50.0, 100.0, 200.0, 300.0, 600.0, 1000.0, 1000.0]}}}}, "system": {"time_keys": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"], "time_period_length_minutes": 60, "load_mismatch_cost": 1000, "baseMVA": 100.0, "reference_bus": "Bus1", "reference_bus_angle": 0.0}}
{"elements": {"bus": {"Bus1": {}}, "load": {"Bus1": {"bus": "Bus1", "in_service": true, "p_load": {"data_type": "time_series", "values": [220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0]}}}, "generator": {"GEN1": {"generator_type": "thermal", "bus": "Bus1", "fuel": "G", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 150, "p_max": 455, "ramp_up_60min": 225, "ramp_down_60min": 225, "startup_capacity": 150, "shutdown_capacity": 150, "min_up_time": 8, "min_down_time": 8, "initial_status": 8, "initial_p_output": 220.0, "shutdown_cost": 0.0, "agc_capable": true, "ramp_agc": 3.75, "fast_start": false, "supplemental_start": true, "supplemental_non_spinning_capacity": 150, "p_min_agc": 165.0, "p_max_agc": 413.6363636363636, "fuel_supply": "fs_GEN1", "p_fuel": {"data_type": "fuel_curve", "values": [[150, 725.5142857142857], [250, 1193.5714285714287], [300, 1428.6285714285714], [400, 1900.8], [455, 2161.6634285714285]]}, "startup_fuel": [[8, 128.57142857142858], [14, 257.14285714285717]], "fuel_cost": 3.5}, "GEN5": {"generator_type": "thermal", "bus": "Bus1", "fuel": "O", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 25, "p_max": 162, "ramp_up_60min": 60, "ramp_down_60min": 60, "startup_capacity": 25, "shutdown_capacity": 25, "min_up_time": 6, "min_down_time": 6, "initial_status": -6, "initial_p_output": 0, "startup_cost": [[6, 90], [11, 180]], "shutdown_cost": 0.0, "p_cost": {"data_type": "cost_curve", "cost_curve_type": "piecewise", "values": [[25, 539.9875], [75, 1544.8875], [125, 2569.6875], [150, 3089.55], [162, 3340.85112]]}, "agc_capable": true, "ramp_agc": 1.0, "fast_start": true, "supplemental_start": true, "supplemental_non_spinning_capacity": 25, "non_spinning_capacity": 35.0, "p_min_agc": 27.500000000000004, "p_max_agc": 147.27272727272725}, "GEN6": {"generator_type": "thermal", "bus": "Bus1", "fuel": "G", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 20, "p_max": 80, "ramp_up_60min": 60, "ramp_down_60min": 60, "startup_capacity": 20, "shutdown_capacity": 20, "min_up_time": 3, "min_down_time": 3, "initial_status": -3, "initial_p_output": 0, "shutdown_cost": 0.0, "fixed_commitment": null, "agc_capable": true, "ramp_agc": 1.0, "fast_start": true, "supplemental_start": true, "supplemental_non_spinning_capacity": 20, "non_spinning_capacity": 30.0, "area": "Area1", "p_min_agc": 22.0, "p_max_agc": 72.72727272727272, "p_fuel": {"data_type": "fuel_curve", "values": [[20, 194.0192], [40, 375.5168], [60, 559.2927999999999], [80, 745.3471999999999]]}, "startup_fuel": [[3, 6.8], [8, 13.6]], "fuel_supply": "fs_GEN6", "fuel_cost": 2.5}}, "fuel_supply": {"fs_GEN1": {"fuel_supply_type": "instantaneous", "fuel_available": {"data_type": "time_series", "values": [1e+100, 1000.0, 800.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 800.0, 1000.0, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100]}}, "fs_GEN6": {"fuel_supply_type": "instantaneous", "fuel_available": {"data_type": "time_series", "values": [1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 400.0, 200.0, 100.0, 50.0, 100.0, 200.0, 300.0, 600.0, 1000.0, 1000.0]}}}}, "system": {"reserve_ramping_constraints": true, "time_keys": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"], "time_period_length_minutes": 60, "load_mismatch_cost": 1000, "baseMVA": 100.0, "reference_bus": "Bus1", "reference_bus_angle": 0.0}}
2 changes: 1 addition & 1 deletion egret/models/tests/uc_test_instances/tiny_uc_3.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"elements": {"bus": {"Bus1": {}}, "load": {"Bus1": {"bus": "Bus1", "in_service": true, "p_load": {"data_type": "time_series", "values": [220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0]}}}, "generator": {"GEN1": {"generator_type": "thermal", "bus": "Bus1", "fuel": "G", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 150, "p_max": 455, "ramp_up_60min": 225, "ramp_down_60min": 225, "startup_capacity": 150, "shutdown_capacity": 150, "min_up_time": 8, "min_down_time": 8, "initial_status": 8, "initial_p_output": 220.0, "shutdown_cost": 0.0, "agc_capable": true, "ramp_agc": 3.75, "fast_start": false, "supplemental_start": true, "supplemental_non_spinning_capacity": 150, "p_min_agc": 165.0, "p_max_agc": 413.6363636363636, "fuel_supply": "fs_GEN1", "p_fuel": {"data_type": "fuel_curve", "values": [[150, 725.5142857142857], [250, 1193.5714285714287], [300, 1428.6285714285714], [400, 1900.8], [455, 2161.6634285714285]]}, "startup_fuel": [[8, 128.57142857142858], [14, 257.14285714285717]], "aux_fuel_capable": true, "aux_fuel_blending": false, "aux_fuel_online_switching": true, "fuel_cost": 3.5, "aux_fuel_cost": 5.25}, "GEN5": {"generator_type": "thermal", "bus": "Bus1", "fuel": "O", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 25, "p_max": 162, "ramp_up_60min": 60, "ramp_down_60min": 60, "startup_capacity": 25, "shutdown_capacity": 25, "min_up_time": 6, "min_down_time": 6, "initial_status": -6, "initial_p_output": 0, "startup_cost": [[6, 90], [11, 180]], "shutdown_cost": 0.0, "p_cost": {"data_type": "cost_curve", "cost_curve_type": "piecewise", "values": [[25, 539.9875], [75, 1544.8875], [125, 2569.6875], [150, 3089.55], [162, 3340.85112]]}, "agc_capable": true, "ramp_agc": 1.0, "fast_start": true, "supplemental_start": true, "supplemental_non_spinning_capacity": 25, "non_spinning_capacity": 35.0, "p_min_agc": 27.500000000000004, "p_max_agc": 147.27272727272725}, "GEN6": {"generator_type": "thermal", "bus": "Bus1", "fuel": "G", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 20, "p_max": 80, "ramp_up_60min": 60, "ramp_down_60min": 60, "startup_capacity": 20, "shutdown_capacity": 20, "min_up_time": 3, "min_down_time": 3, "initial_status": -3, "initial_p_output": 0, "shutdown_cost": 0.0, "fixed_commitment": null, "agc_capable": true, "ramp_agc": 1.0, "fast_start": true, "supplemental_start": true, "supplemental_non_spinning_capacity": 20, "non_spinning_capacity": 30.0, "area": "Area1", "p_min_agc": 22.0, "p_max_agc": 72.72727272727272, "p_fuel": {"data_type": "fuel_curve", "values": [[20, 194.0192], [40, 375.5168], [60, 559.2927999999999], [80, 745.3471999999999]]}, "startup_fuel": [[3, 6.8], [8, 13.6]], "fuel_supply": "fs_GEN6", "fuel_cost": 2.5}}, "fuel_supply": {"fs_GEN1": {"fuel_supply_type": "instantaneous", "fuel_available": {"data_type": "time_series", "values": [1e+100, 1000.0, 800.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 800.0, 1000.0, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100]}}, "fs_GEN6": {"fuel_supply_type": "instantaneous", "fuel_available": {"data_type": "time_series", "values": [1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 400.0, 200.0, 100.0, 50.0, 100.0, 200.0, 300.0, 600.0, 1000.0, 1000.0]}}}}, "system": {"time_keys": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"], "time_period_length_minutes": 60, "load_mismatch_cost": 1000, "baseMVA": 100.0, "reference_bus": "Bus1", "reference_bus_angle": 0.0}}
{"elements": {"bus": {"Bus1": {}}, "load": {"Bus1": {"bus": "Bus1", "in_service": true, "p_load": {"data_type": "time_series", "values": [220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0, 220.0]}}}, "generator": {"GEN1": {"generator_type": "thermal", "bus": "Bus1", "fuel": "G", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 150, "p_max": 455, "ramp_up_60min": 225, "ramp_down_60min": 225, "startup_capacity": 150, "shutdown_capacity": 150, "min_up_time": 8, "min_down_time": 8, "initial_status": 8, "initial_p_output": 220.0, "shutdown_cost": 0.0, "agc_capable": true, "ramp_agc": 3.75, "fast_start": false, "supplemental_start": true, "supplemental_non_spinning_capacity": 150, "p_min_agc": 165.0, "p_max_agc": 413.6363636363636, "fuel_supply": "fs_GEN1", "p_fuel": {"data_type": "fuel_curve", "values": [[150, 725.5142857142857], [250, 1193.5714285714287], [300, 1428.6285714285714], [400, 1900.8], [455, 2161.6634285714285]]}, "startup_fuel": [[8, 128.57142857142858], [14, 257.14285714285717]], "aux_fuel_capable": true, "aux_fuel_blending": false, "aux_fuel_online_switching": true, "fuel_cost": 3.5, "aux_fuel_cost": 5.25}, "GEN5": {"generator_type": "thermal", "bus": "Bus1", "fuel": "O", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 25, "p_max": 162, "ramp_up_60min": 60, "ramp_down_60min": 60, "startup_capacity": 25, "shutdown_capacity": 25, "min_up_time": 6, "min_down_time": 6, "initial_status": -6, "initial_p_output": 0, "startup_cost": [[6, 90], [11, 180]], "shutdown_cost": 0.0, "p_cost": {"data_type": "cost_curve", "cost_curve_type": "piecewise", "values": [[25, 539.9875], [75, 1544.8875], [125, 2569.6875], [150, 3089.55], [162, 3340.85112]]}, "agc_capable": true, "ramp_agc": 1.0, "fast_start": true, "supplemental_start": true, "supplemental_non_spinning_capacity": 25, "non_spinning_capacity": 35.0, "p_min_agc": 27.500000000000004, "p_max_agc": 147.27272727272725}, "GEN6": {"generator_type": "thermal", "bus": "Bus1", "fuel": "G", "in_service": true, "zone": "None", "failure_rate": 0.0, "p_min": 20, "p_max": 80, "ramp_up_60min": 60, "ramp_down_60min": 60, "startup_capacity": 20, "shutdown_capacity": 20, "min_up_time": 3, "min_down_time": 3, "initial_status": -3, "initial_p_output": 0, "shutdown_cost": 0.0, "fixed_commitment": null, "agc_capable": true, "ramp_agc": 1.0, "fast_start": true, "supplemental_start": true, "supplemental_non_spinning_capacity": 20, "non_spinning_capacity": 30.0, "area": "Area1", "p_min_agc": 22.0, "p_max_agc": 72.72727272727272, "p_fuel": {"data_type": "fuel_curve", "values": [[20, 194.0192], [40, 375.5168], [60, 559.2927999999999], [80, 745.3471999999999]]}, "startup_fuel": [[3, 6.8], [8, 13.6]], "fuel_supply": "fs_GEN6", "fuel_cost": 2.5}}, "fuel_supply": {"fs_GEN1": {"fuel_supply_type": "instantaneous", "fuel_available": {"data_type": "time_series", "values": [1e+100, 1000.0, 800.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 800.0, 1000.0, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100]}}, "fs_GEN6": {"fuel_supply_type": "instantaneous", "fuel_available": {"data_type": "time_series", "values": [1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 1e+100, 400.0, 200.0, 100.0, 50.0, 100.0, 200.0, 300.0, 600.0, 1000.0, 1000.0]}}}}, "system": {"reserve_ramping_constraints": true, "time_keys": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"], "time_period_length_minutes": 60, "load_mismatch_cost": 1000, "baseMVA": 100.0, "reference_bus": "Bus1", "reference_bus_angle": 0.0}}
Loading