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

Superperiods & superperiod subsidy budgets #1029

Merged
merged 4 commits into from
Jul 18, 2023
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
1 change: 1 addition & 0 deletions db/csvs_test_examples/csv_structure.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ solver,core,solver_options_id,options_solver,simple,,0,0,,,,
temporal,core,temporal_scenario_id,temporal,dir_subsc_only,,0,0,,"ignore
",,
temporal,core,temporal_scenario_id,temporal_periods,dir_aux,,0,0,period_params.csv,,,
temporal,core,temporal_scenario_id,temporal_superperiods,dir_aux,,0,0,superperiods.csv,,,
temporal,core,temporal_scenario_id,temporal_horizons,dir_aux,,0,0,horizon_params.csv,,,
temporal,core,temporal_scenario_id,temporal,dir_aux,,0,0,structure.csv,ignore,,
temporal,core,temporal_scenario_id,temporal_horizon_timepoints_start_end,dir_aux,temporal,0,0,horizon_timepoints.csv,,,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
program,period,program_budget
ITC,2020,1000
ITC,2030,1000
program,superperiod,program_budget
ITC,1,1000
ITC,2,1000
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
program,period,program_budget
ITC,2020,100000
ITC,2030,100000
program,superperiod,program_budget
ITC,1,100000
ITC,2,100000
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
program,superperiod,program_budget
ITC,1,2000
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
program,project_or_tx,vintage,is_tx,annual_payment_subsidy
ITC,Solar,2020,0,20
ITC,Battery,2030,0,20
237 changes: 119 additions & 118 deletions db/csvs_test_examples/scenarios.csv

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1horizon_1period
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
subproblem_id,balancing_type_horizon,horizon,boundary
1,day,202001,circular
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
subproblem_id,stage_id,balancing_type_horizon,horizon,tmp_start,tmp_end
1,1,day,202001,20200101,20200102
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
period,discount_factor,period_start_year,period_end_year
2020,1,2020,2021
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
subproblem_id,stage_id,timepoint,period,number_of_hours_in_timepoint,timepoint_weight,previous_stage_timepoint_map,spinup_or_lookahead,linked_timepoint,month,hour_of_day,timestamp,ignore_horizon_day
1,1,20200101,2020,1,4380,,0,,1,1,1/1/20 0:00,202001
1,1,20200102,2020,1,4380,,0,,1,2,1/1/20 1:00,202001
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
superperiod,period
1,2020
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1horizon_2periods
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
subproblem_id,balancing_type_horizon,horizon,boundary
1,day,202001,circular
1,day,203001,circular
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
subproblem_id,stage_id,balancing_type_horizon,horizon,tmp_start,tmp_end
1,1,day,202001,20200101,20200102
1,1,day,203001,20300101,20300102
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
period,discount_factor,period_start_year,period_end_year
2020,1,2020,2030
2030,1,2030,2040
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
subproblem_id,stage_id,timepoint,period,number_of_hours_in_timepoint,timepoint_weight,previous_stage_timepoint_map,spinup_or_lookahead,linked_timepoint,month,hour_of_day,timestamp,ignore_horizon_day
1,1,20200101,2020,1,4380,,0,,1,1,1/1/20 0:00,202001
1,1,20200102,2020,1,4380,,0,,1,2,1/1/20 1:00,202001
1,1,20300101,2030,1,4380,,0,,1,1,1/1/30 0:00,203001
1,1,20300102,2030,1,4380,,0,,1,2,1/1/30 1:00,203001
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
superperiod,period
1,2020
2,2030
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1horizon_2periods
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
subproblem_id,balancing_type_horizon,horizon,boundary
1,day,202001,circular
1,day,203001,circular
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
subproblem_id,stage_id,balancing_type_horizon,horizon,tmp_start,tmp_end
1,1,day,202001,20200101,20200102
1,1,day,203001,20300101,20300102
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
period,discount_factor,period_start_year,period_end_year
2020,1,2020,2030
2030,1,2030,2040
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
subproblem_id,stage_id,timepoint,period,number_of_hours_in_timepoint,timepoint_weight,previous_stage_timepoint_map,spinup_or_lookahead,linked_timepoint,month,hour_of_day,timestamp,ignore_horizon_day
1,1,20200101,2020,1,4380,,0,,1,1,1/1/20 0:00,202001
1,1,20200102,2020,1,4380,,0,,1,2,1/1/20 1:00,202001
1,1,20300101,2030,1,4380,,0,,1,1,1/1/30 0:00,203001
1,1,20300102,2030,1,4380,,0,,1,2,1/1/30 1:00,203001
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
superperiod,period
1,2020
1,2030
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1horizon_2periods_10yrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subproblem_id,balancing_type_horizon,horizon,boundary
1,day,202001,circular
1,day,203001,circular
1,year,2020,circular
1,year,2030,circular
1,halfyear,20201,circular
1,halfyear,20202,circular
1,halfyear,20301,circular
1,halfyear,20302,circular
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subproblem_id,stage_id,balancing_type_horizon,horizon,tmp_start,tmp_end
1,1,day,202001,20200101,20200102
1,1,day,203001,20300101,20300102
1,1,year,2020,20200101,20200102
1,1,year,2030,20300101,20300102
1,1,halfyear,20201,20200101,20200101
1,1,halfyear,20202,20200102,20200102
1,1,halfyear,20301,20300101,20300101
1,1,halfyear,20302,20300102,20300102
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
period,discount_factor,period_start_year,period_end_year
2020,1,2020,2030
2030,1,2030,2040
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
subproblem_id,stage_id,timepoint,period,number_of_hours_in_timepoint,timepoint_weight,previous_stage_timepoint_map,spinup_or_lookahead,linked_timepoint,month,hour_of_day,timestamp,ignore_horizon_day
1,1,20200101,2020,1,4380,,0,,1,1,1/1/20 0:00,202001
1,1,20200102,2020,1,4380,,0,,1,2,1/1/20 1:00,202001
1,1,20300101,2030,1,4380,,0,,1,1,1/1/30 0:00,203001
1,1,20300102,2030,1,4380,,0,,1,2,1/1/30 1:00,203001
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
superperiod,period
1,2020
2,2030
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superperiod,period
15 changes: 13 additions & 2 deletions db/db_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,17 @@ FOREIGN KEY (temporal_scenario_id) REFERENCES subscenarios_temporal
(temporal_scenario_id)
);

-- Superperiods (combinations of periods)
DROP TABLE IF EXISTS inputs_temporal_superperiods;
CREATE TABLE inputs_temporal_superperiods (
temporal_scenario_id INTEGER,
superperiod INTEGER,
period INTEGER,
PRIMARY KEY (temporal_scenario_id, superperiod, period),
FOREIGN KEY (temporal_scenario_id) REFERENCES subscenarios_temporal
(temporal_scenario_id)
);

-- Timepoints
-- Note on linked timepoints: the user can designate timepoints from the last
-- horizon of the subproblem to be linked to the first horizon of the next
Expand Down Expand Up @@ -3116,9 +3127,9 @@ DROP TABLE IF EXISTS inputs_system_system_subsides;
CREATE TABLE inputs_system_subsidies (
subsidy_scenario_id INTEGER,
program VARCHAR(32),
period INTEGER,
superperiod INTEGER,
program_budget FLOAT,
PRIMARY KEY (subsidy_scenario_id, program, period),
PRIMARY KEY (subsidy_scenario_id, program, superperiod),
FOREIGN KEY (subsidy_scenario_id) REFERENCES
subscenarios_system_subsidies (subsidy_scenario_id)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
program period program_budget
ITC 2020 100000.0
ITC 2030 100000.0
program superperiod program_budget
ITC 1 100000.0
ITC 2 100000.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
superperiod period
1 2020
2 2030
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ of_elcc_surface,
of_local_capacity,
of_markets,
of_tuning,
temporal_scenario_id,6
temporal_scenario_id,14
load_zone_scenario_id,2
lf_reserves_up_ba_scenario_id,1
lf_reserves_down_ba_scenario_id,1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
program period program_budget
ITC 2020 1000.0
ITC 2030 1000.0
program superperiod program_budget
ITC 1 1000.0
ITC 2 1000.0
3 changes: 3 additions & 0 deletions examples/test_new_build_storage_itc/inputs/superperiods.tab
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
superperiod period
1 2020
2 2030
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ of_elcc_surface,
of_local_capacity,
of_markets,
of_tuning,
temporal_scenario_id,3
temporal_scenario_id,12
load_zone_scenario_id,1
lf_reserves_up_ba_scenario_id,1
lf_reserves_down_ba_scenario_id,1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
features
lf_reserves_up
lf_reserves_down
regulation_up
regulation_down
subsidies
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fuel period month fuel_price_per_mmbtu
Coal 2020 1 4.0
Coal 2020 2 4.0
Coal 2030 1 4.0
Coal 2030 2 4.0
Gas 2020 1 5.0
Gas 2020 2 5.0
Gas 2030 1 5.0
Gas 2030 2 5.0
Uranium 2020 1 2.0
Uranium 2020 2 2.0
Uranium 2030 1 2.0
Uranium 2030 2 2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fuel co2_intensity_tons_per_mmbtu fuel_group
Coal 0.09552 Solid
Gas 0.05306 Gas
Uranium 0.0 Other
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
project period load_point_fraction average_heat_rate_mmbtu_per_mwh
Coal 0 0.4 1250.0
Coal 0 1.0 506.0
Gas_CCGT 0 0.5 506.0
Gas_CCGT 0 1.0 256.0
Gas_CT 0 0.4 208.33333
Gas_CT 0 1.0 88.13333
Nuclear 0 1.0 1666.67
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
horizon balancing_type_horizon timepoint
202001 day 20200101
202001 day 20200102
203001 day 20300101
203001 day 20300102
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
horizon balancing_type_horizon boundary
202001 day circular
203001 day circular
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ba timepoint requirement
Zone1 20200101 1.0
Zone1 20200102 2.0
Zone1 20300101 1.0
Zone1 20300102 2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ba timepoint requirement
Zone1 20200101 1.0
Zone1 20200102 2.0
Zone1 20300101 1.0
Zone1 20300102 2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
balancing_area allow_violation violation_penalty_per_mw reserve_to_energy_adjustment
Zone1 1 999999999.0 .
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
balancing_area allow_violation violation_penalty_per_mw reserve_to_energy_adjustment
Zone1 1 999999999.0 .
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
LOAD_ZONES timepoint load_mw
Zone1 20200101 10.0
Zone1 20200102 20.0
Zone1 20300101 10.0
Zone1 20300102 20.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
load_zone allow_overgeneration overgeneration_penalty_per_mw allow_unserved_energy unserved_energy_penalty_per_mwh unserved_energy_limit_mwh max_unserved_load_penalty_per_mw max_unserved_load_limit_mw export_penalty_cost_per_mwh
Zone1 1 99999999.0 1 99999999.0 . 0.0 . 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
project vintage operational_lifetime_yrs fixed_cost_per_mw_yr fixed_cost_per_mwh_yr financial_lifetime_yrs annualized_real_cost_per_mw_yr annualized_real_cost_per_mwh_yr
Battery 2020 10.0 0.0 0.0 10.0 1.0 1.0
Battery 2030 10.0 0.0 0.0 10.0 1.0 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
period discount_factor period_start_year period_end_year hours_in_period_timepoints
2020 1.0 2020.0 2030.0 8760.0
2030 1.0 2030.0 2040.0 8760.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project fuel min_fraction_in_fuel_blend max_fraction_in_fuel_blend
Coal Coal . .
Gas_CCGT Gas . .
Gas_CT Gas . .
Nuclear Uranium . .
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
project capacity_type availability_type operational_type balancing_type_project technology load_zone variable_om_cost_per_mwh min_stable_level_fraction unit_size_mw startup_cost_per_mw shutdown_cost_per_mw startup_fuel_mmbtu_per_mw startup_plus_ramp_up_rate shutdown_plus_ramp_down_rate ramp_up_when_on_rate ramp_down_when_on_rate ramp_up_violation_penalty ramp_down_violation_penalty min_up_time_hours min_up_time_violation_penalty min_down_time_hours min_down_time_violation_penalty allow_startup_shutdown_power storage_efficiency charging_efficiency discharging_efficiency charging_capacity_multiplier discharging_capacity_multiplier minimum_duration_hours maximum_duration_hours aux_consumption_frac_capacity aux_consumption_frac_power last_commitment_stage curtailment_cost_per_pwh powerunithour_per_fuelunit soc_penalty_cost_per_energyunit soc_last_tmp_penalty_cost_per_energyunit partial_availability_threshold lf_reserves_up_ba lf_reserves_up_derate lf_reserves_down_ba lf_reserves_down_derate regulation_up_ba regulation_up_derate regulation_down_ba regulation_down_derate lf_reserves_up_ramp_rate lf_reserves_down_ramp_rate regulation_up_ramp_rate regulation_down_ramp_rate
Battery stor_new_lin exogenous stor day Storage Zone1 0.0 . . . . . . . . . . . . . . . . . 0.8 0.8 . . 1.0 99.0 . . . . . . . . Zone1 . Zone1 . Zone1 . Zone1 . . . . .
Coal gen_spec exogenous gen_commit_cap day Coal Zone1 1.0 0.4 6.0 1.0 0.0 . . . . . . . . . . . . . . . . . . . . . 2 . . . . . . . . . Zone1 . Zone1 . . . . .
Gas_CCGT gen_spec exogenous gen_commit_cap day Gas Zone1 2.0 0.4 6.0 1.0 2.0 . . . . . . . . . . . . . . . . . . . . . 1 . . . . . Zone1 . Zone1 . Zone1 . Zone1 . . . . .
Gas_CT gen_spec exogenous gen_commit_cap day Gas Zone1 2.0 0.4 6.0 0.0 1.0 . . . . . . . . . . . . . . . . . . . . . 3 . . . . . . . . . . . . . . . . .
Nuclear gen_spec exogenous gen_must_run day Nuclear Zone1 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Wind gen_spec exogenous gen_var day Wind Zone1 0.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
balancing_area allow_violation violation_penalty_per_mw reserve_to_energy_adjustment
Zone1 1 999999999.0 .
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ba timepoint requirement
Zone1 20200101 1.0
Zone1 20200102 2.0
Zone1 20300101 1.0
Zone1 20300102 2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
balancing_area allow_violation violation_penalty_per_mw reserve_to_energy_adjustment
Zone1 1 999999999.0 .
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ba timepoint requirement
Zone1 20200101 1.0
Zone1 20200102 2.0
Zone1 20300101 1.0
Zone1 20300102 2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
project period specified_capacity_mw hyb_gen_specified_capacity_mw hyb_stor_specified_capacity_mw specified_capacity_mwh fuel_production_capacity_fuelunitperhour fuel_release_capacity_fuelunitperhour fuel_storage_capacity_fuelunit fixed_cost_per_mw_yr hyb_gen_fixed_cost_per_mw_yr hyb_stor_fixed_cost_per_mw_yr fixed_cost_per_mwh_yr fuel_production_capacity_fixed_cost_per_fuelunitperhour_yr fuel_release_capacity_fixed_cost_per_fuelunitperhour_yr fuel_storage_capacity_fixed_cost_per_fuelunit_yr
Coal 2020 6.0 0.0
Coal 2030 6.0 0.0
Gas_CCGT 2020 6.0 0.0
Gas_CCGT 2030 6.0 0.0
Gas_CT 2020 6.0 0.0
Gas_CT 2030 6.0 0.0
Nuclear 2020 6.0 0.0
Nuclear 2030 6.0 0.0
Wind 2020 2.0 0.0
Wind 2030 2.0 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
program superperiod program_budget
ITC 1 2000.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
program project_or_tx period is_tx annual_payment_subsidy
ITC Battery 2030 0 20.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
superperiod period
1 2020
1 2030
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
timepoint period timepoint_weight number_of_hours_in_timepoint previous_stage_timepoint_map month
20200101 2020 4380.0 1 . 1
20200102 2020 4380.0 1 . 1
20300101 2030 4380.0 1 . 1
20300102 2030 4380.0 1 . 1
Loading