diff --git a/src/definitions.jl b/src/definitions.jl index 4ac5f5ca..99705846 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -1,6 +1,7 @@ const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder)))) -const DATA_DIR = - joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-3.0-alpha") +# const DATA_DIR = +# joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-3.0-alpha") +const DATA_DIR = get(ENV, "PSB_DATA_DIR", joinpath(dirname(PACKAGE_DIR), "PowerSystemsTestData")) # TODO remove before merging! Kludge to use custom test data until https://github.com/NREL-Sienna/PowerSystemCaseBuilder.jl/issues/54 gets resolved const RTS_DIR = joinpath(LazyArtifacts.artifact"rts", "RTS-GMLC-0.2.2") diff --git a/src/library/psi_library.jl b/src/library/psi_library.jl index cd7172e1..6356646b 100644 --- a/src/library/psi_library.jl +++ b/src/library/psi_library.jl @@ -18,7 +18,7 @@ function build_c_sys5_pjm(; add_forecasts, raw_data, sys_kwargs...) PrimeMovers.PVe, (min = 0.0, max = 0.0), 1.0, - TwoPartCost(LinearFunctionData(0.0), 0.0), + RenewableGenerationCost(nothing), 100.0, ) wind_device = PSY.RenewableDispatch( @@ -31,7 +31,7 @@ function build_c_sys5_pjm(; add_forecasts, raw_data, sys_kwargs...) PrimeMovers.WT, (min = 0.0, max = 0.0), 1.0, - TwoPartCost(LinearFunctionData(0.0), 0.0), + RenewableGenerationCost(nothing), 100.0, ) PSY.add_component!(c_sys5, pv_device) @@ -133,7 +133,7 @@ function build_c_sys5_pjm_rt(; add_forecasts, raw_data, sys_kwargs...) PrimeMovers.PVe, (min = 0.0, max = 0.0), 1.0, - TwoPartCost(LinearFunctionData(0.0), 0.0), + RenewableGenerationCost(nothing), 100.0, ) wind_device = PSY.RenewableDispatch( @@ -146,7 +146,7 @@ function build_c_sys5_pjm_rt(; add_forecasts, raw_data, sys_kwargs...) PrimeMovers.WT, (min = 0.0, max = 0.0), 1.0, - TwoPartCost(LinearFunctionData(0.0), 0.0), + RenewableGenerationCost(nothing), 100.0, ) PSY.add_component!(c_sys5, pv_device) @@ -284,14 +284,7 @@ function build_5_bus_hydro_uc_sys_targets(; add_forecasts, raw_data, sys_kwargs. else c_sys5_hy_uc = PSY.System(rawsys; sys_kwargs...) end - cost = PSY.StorageManagementCost(; - variable = LinearFunctionData(0.15), - fixed = 0.0, - start_up = 0.0, - shut_down = 0.0, - energy_shortage_cost = 50.0, - energy_surplus_cost = 0.0, - ) + cost = HydroGenerationCost(CostCurve(LinearCurve(0.15)), 0.0) for hy in get_components(HydroEnergyReservoir, c_sys5_hy_uc) set_operation_cost!(hy, cost) end @@ -341,14 +334,7 @@ function build_5_bus_hydro_ed_sys_targets(; raw_data, kwargs...) time_series_in_memory = true, sys_kwargs..., ) - cost = PSY.StorageManagementCost(; - variable = LinearFunctionData(0.15), - fixed = 0.0, - start_up = 0.0, - shut_down = 0.0, - energy_shortage_cost = 50.0, - energy_surplus_cost = 0.0, - ) + cost = HydroGenerationCost(CostCurve(LinearCurve(0.15)), 0.0) for hy in get_components(HydroEnergyReservoir, c_sys5_hy_ed) set_operation_cost!(hy, cost) end @@ -400,14 +386,7 @@ function build_5_bus_hydro_wk_sys_targets(; raw_data, kwargs...) time_series_in_memory = true, sys_kwargs..., ) - cost = PSY.StorageManagementCost(; - variable = LinearFunctionData(0.15), - fixed = 0.0, - start_up = 0.0, - shut_down = 0.0, - energy_shortage_cost = 50.0, - energy_surplus_cost = 0.0, - ) + cost = HydroGenerationCost(CostCurve(LinearCurve(0.15)), 0.0) for hy in get_components(HydroEnergyReservoir, c_sys5_hy_wk) set_operation_cost!(hy, cost) end @@ -646,14 +625,7 @@ function build_modified_RTS_GMLC_RT_sys_noForecast(; kwargs...) return sys end -function build_modified_tamu_ercot_da_sys(; raw_data, kwargs...) - sys_kwargs = filter_kwargs(; kwargs...) - system_path = joinpath(raw_data, "DA_sys.json") - sys = System(system_path; sys_kwargs...) - return sys -end - -function build_two_zone_5_bus(; raw_data, kwargs...) +function build_two_zone_5_bus(; kwargs...) ## System with 10 buses ###################################################### """ It is composed by 2 identical 5-bus systems connected by a DC line @@ -848,8 +820,9 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -0.30, max = 0.30), ramp_limits = nothing, time_limits = nothing, - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 14.0, 0.0), + # Arguments + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 14.0, 0.0)), 0.0, 4.0, 2.0, @@ -870,8 +843,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -1.275, max = 1.275), ramp_limits = (up = 0.02 * 2.2125, down = 0.02 * 2.2125), time_limits = (up = 2.0, down = 1.0), - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 15.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 15.0, 0.0)), 0.0, 1.5, 0.75, @@ -892,8 +865,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -3.90, max = 3.90), ramp_limits = (up = 0.012 * 5.2, down = 0.012 * 5.2), time_limits = (up = 3.0, down = 2.0), - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 30.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 30.0, 0.0)), 0.0, 3.0, 1.5, @@ -914,8 +887,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -1.5, max = 1.5), ramp_limits = (up = 0.015 * 2.5, down = 0.015 * 2.5), time_limits = (up = 2.0, down = 1.0), - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 40.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 40.0, 0.0)), 0.0, 4.0, 2.0, @@ -936,8 +909,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -4.50, max = 4.50), ramp_limits = (up = 0.015 * 7.5, down = 0.015 * 7.5), time_limits = (up = 5.0, down = 3.0), - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 10.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 10.0, 0.0)), 0.0, 1.5, 0.75, @@ -958,8 +931,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -0.30, max = 0.30), ramp_limits = nothing, time_limits = nothing, - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 14.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 14.0, 0.0)), 0.0, 4.0, 2.0, @@ -980,8 +953,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -1.275, max = 1.275), ramp_limits = (up = 0.02 * 2.2125, down = 0.02 * 2.2125), time_limits = (up = 2.0, down = 1.0), - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 15.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 15.0, 0.0)), 0.0, 1.5, 0.75, @@ -1002,8 +975,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -3.90, max = 3.90), ramp_limits = (up = 0.012 * 5.2, down = 0.012 * 5.2), time_limits = (up = 3.0, down = 2.0), - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 30.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 30.0, 0.0)), 0.0, 3.0, 1.5, @@ -1024,8 +997,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -1.5, max = 1.5), ramp_limits = (up = 0.015 * 2.5, down = 0.015 * 2.5), time_limits = (up = 2.0, down = 1.0), - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 40.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 40.0, 0.0)), 0.0, 4.0, 2.0, @@ -1046,8 +1019,8 @@ function build_two_zone_5_bus(; raw_data, kwargs...) reactive_power_limits = (min = -4.50, max = 4.50), ramp_limits = (up = 0.015 * 7.5, down = 0.015 * 7.5), time_limits = (up = 5.0, down = 3.0), - operation_cost = ThreePartCost( - QuadraticFunctionData(0.0, 10.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 10.0, 0.0)), 0.0, 1.5, 0.75, @@ -1445,7 +1418,7 @@ function _duplicate_system(main_sys::PSY.System, twin_sys::PSY.System, HVDC_line main_sys, ) noise_values = rand(MersenneTwister(COST_PERTURBATION_NOISE_SEED), 1_000_000) - old_pwl_array = get_variable(get_operation_cost(g)) |> get_points + old_pwl_array = get_points(get_value_curve(get_variable(get_operation_cost(g)))) new_pwl_array = similar(old_pwl_array) for (ix, (x, y)) in enumerate(old_pwl_array) if ix ∈ [1, length(old_pwl_array)] @@ -1473,7 +1446,7 @@ function _duplicate_system(main_sys::PSY.System, twin_sys::PSY.System, HVDC_line end end end - set_variable!(get_operation_cost(g), PiecewiseLinearPointData(new_pwl_array)) + set_variable!(get_operation_cost(g), CostCurve(PiecewisePointCurve(new_pwl_array))) end # set service participation diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 0629bf29..da31daf5 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -216,7 +216,8 @@ function build_c_sys5_re(; ) end for (ix, serv) in enumerate(PSY.get_components(PSY.ReserveDemandCurve, c_sys5_re)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = TimeSeries.timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -477,7 +478,8 @@ function build_c_sys5_hyd(; ) end for (ix, serv) in enumerate(PSY.get_components(PSY.ReserveDemandCurve, c_sys5_hyd)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = TimeSeries.timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -651,7 +653,8 @@ function build_c_sys5_hyd_ems(; ) end for (ix, serv) in enumerate(PSY.get_components(PSY.ReserveDemandCurve, c_sys5_hyd)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = TimeSeries.timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -770,7 +773,8 @@ function build_c_sys5_bat(; ) end for (ix, serv) in enumerate(PSY.get_components(PSY.ReserveDemandCurve, c_sys5_bat)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = TimeSeries.timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -861,7 +865,8 @@ function build_c_sys5_il(; add_forecasts, add_reserves, raw_data, kwargs...) ) end for (ix, serv) in enumerate(PSY.get_components(PSY.ReserveDemandCurve, c_sys5_il)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = TimeSeries.timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -1015,8 +1020,8 @@ function build_sys_ramp_testing(; raw_data, kwargs...) reactive_power_limits = nothing, ramp_limits = nothing, time_limits = nothing, - operation_cost = PSY.ThreePartCost( - QuadraticFunctionData(0.0, 14.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 14.0, 0.0)), 0.0, 4.0, 2.0, @@ -1037,8 +1042,8 @@ function build_sys_ramp_testing(; raw_data, kwargs...) reactive_power_limits = nothing, ramp_limits = (up = 0.010625 * 2.0, down = 0.010625 * 2.0), time_limits = nothing, - operation_cost = PSY.ThreePartCost( - QuadraticFunctionData(0.0, 15.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 15.0, 0.0)), 0.0, 1.5, 0.75, @@ -1205,7 +1210,8 @@ function build_c_sys5_uc(; end for (ix, serv) in enumerate(PSY.get_components(PSY.ReserveDemandCurve, c_sys5_uc)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -1322,7 +1328,8 @@ function build_c_sys5_uc_non_spin(; end for (ix, serv) in enumerate(PSY.get_components(PSY.ReserveDemandCurve, c_sys5_uc)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -1467,7 +1474,8 @@ function build_c_sys5_uc_re(; end for (ix, serv) in enumerate(PSY.get_components(PSY.ReserveDemandCurve, c_sys5_uc)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -2342,9 +2350,16 @@ function build_sos_test_sys(; raw_data, kwargs...) reactive_power_limits = nothing, time_limits = nothing, ramp_limits = nothing, - operation_cost = PSY.ThreePartCost( - PiecewiseLinearPointData( - [(22.0, 1122.43), (33.0, 1617.43), (44.0, 1742.48), (55.0, 2075.88)]), + operation_cost = ThermalGenerationCost( + CostCurve( + PiecewisePointCurve( + [ + (22.0, 1122.43), + (33.0, 1617.43), + (44.0, 1742.48), + (55.0, 2075.88), + ]), + ), 0.0, 5665.23, 0.0, @@ -2365,14 +2380,15 @@ function build_sos_test_sys(; raw_data, kwargs...) reactive_power_limits = nothing, time_limits = nothing, ramp_limits = nothing, - operation_cost = PSY.ThreePartCost( - PiecewiseLinearPointData( - [ - (62.0, 1500.19), - (92.9, 2132.59), - (124.0, 2829.875), - (155.0, 2831.444), - ]), + operation_cost = ThermalGenerationCost( + CostCurve( + PiecewisePointCurve([ + (62.0, 1500.19), + (92.9, 2132.59), + (124.0, 2829.875), + (155.0, 2831.444), + ]), + ), 0.0, 5665.23, 0.0, @@ -2437,13 +2453,15 @@ function build_pwl_test_sys(; raw_data, kwargs...) reactive_power_limits = nothing, time_limits = nothing, ramp_limits = nothing, - operation_cost = PSY.ThreePartCost( - PiecewiseLinearPointData([ - (22.0, 589.99), - (33.0, 884.99), - (44.0, 1210.04), - (55.0, 1543.44), - ]), + operation_cost = ThermalGenerationCost( + CostCurve( + PiecewisePointCurve([ + (22.0, 589.99), + (33.0, 884.99), + (44.0, 1210.04), + (55.0, 1543.44), + ]), + ), 532.44, 5665.23, 0.0, @@ -2464,13 +2482,15 @@ function build_pwl_test_sys(; raw_data, kwargs...) reactive_power_limits = nothing, time_limits = nothing, ramp_limits = nothing, - operation_cost = PSY.ThreePartCost( - PiecewiseLinearPointData([ - (62.0, 1264.80), - (93.0, 1897.20), - (124.0, 2594.4787), - (155.0, 3433.04), - ]), + operation_cost = ThermalGenerationCost( + CostCurve( + PiecewisePointCurve([ + (62.0, 1264.80), + (93.0, 1897.20), + (124.0, 2594.4787), + (155.0, 3433.04), + ]), + ), 235.397, 5665.23, 0.0, @@ -2522,8 +2542,8 @@ function build_duration_test_sys(; raw_data, kwargs...) reactive_power_limits = nothing, ramp_limits = nothing, time_limits = (up = 4, down = 2), - operation_cost = PSY.ThreePartCost( - QuadraticFunctionData(0.0, 14.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 14.0, 0.0)), 0.0, 4.0, 2.0, @@ -2545,8 +2565,8 @@ function build_duration_test_sys(; raw_data, kwargs...) reactive_power_limits = nothing, ramp_limits = nothing, time_limits = (up = 6, down = 4), - operation_cost = PSY.ThreePartCost( - QuadraticFunctionData(0.0, 15.0, 0.0), + operation_cost = ThermalGenerationCost( + CostCurve(QuadraticCurve(0.0, 15.0, 0.0)), 0.0, 1.5, 0.75, @@ -2590,7 +2610,7 @@ function build_pwl_marketbid_sys(; raw_data, kwargs...) time_limits = nothing, ramp_limits = nothing, operation_cost = PSY.MarketBidCost(; - no_load = 0.0, + no_load_cost = 0.0, start_up = (hot = 0.0, warm = 0.0, cold = 0.0), shut_down = 0.0, ), @@ -2614,7 +2634,7 @@ function build_pwl_marketbid_sys(; raw_data, kwargs...) start_time_limits = (hot = 2.0, warm = 4.0, cold = 12.0), start_types = 3, operation_cost = PSY.MarketBidCost(; - no_load = 0.0, + no_load_cost = 0.0, start_up = (hot = 393.28, warm = 455.37, cold = 703.76), shut_down = 0.0, ), @@ -2625,32 +2645,32 @@ function build_pwl_marketbid_sys(; raw_data, kwargs...) DA_load_forecast = Dict{Dates.DateTime, TimeSeries.TimeArray}() market_bid_gen1_data = Dict( ini_time => [ - PiecewiseLinearPointData([ + CostCurve(IncrementalCurve(PiecewisePointCurve(([ (22.0, 589.99), (33.0, 884.99), (44.0, 1210.04), (55.0, 1543.44), - ]), - PiecewiseLinearPointData([ + ])))), + CostCurve(IncrementalCurve(PiecewisePointCurve(([ (22.0, 589.99), (33.0, 884.99), (44.0, 1210.04), (55.0, 1543.44), - ]), + ])))), ], ini_time + Hour(1) => [ - PiecewiseLinearPointData([ + CostCurve(IncrementalCurve(PiecewisePointCurve(([ (22.0, 589.99), (33.0, 884.99), (44.0, 1210.04), (55.0, 1543.44), - ]), - PiecewiseLinearPointData([ + ])))), + CostCurve(IncrementalCurve(PiecewisePointCurve(([ (22.0, 589.99), (33.0, 884.99), (44.0, 1210.04), (55.0, 1543.44), - ]), + ])))), ], ) market_bid_gen1 = PSY.Deterministic(; @@ -2660,32 +2680,32 @@ function build_pwl_marketbid_sys(; raw_data, kwargs...) ) market_bid_gen2_data = Dict( ini_time => [ - PiecewiseLinearPointData([ + CostCurve(IncrementalCurve(PiecewisePointCurve(([ (5.0, 0.0), (7.33, 290.1), (9.67, 582.72), (12.0, 894.1), - ]), - PiecewiseLinearPointData([ + ])))), + CostCurve(IncrementalCurve(PiecewisePointCurve(([ (5.0, 0.0), (7.33, 300.1), (9.67, 600.72), (12.0, 900.1), - ]), + ])))), ], ini_time + Hour(1) => [ - PiecewiseLinearPointData([ + CostCurve(IncrementalCurve(PiecewisePointCurve(([ (5.0, 0.0), (7.33, 290.1), (9.67, 582.72), (12.0, 894.1), - ]), - PiecewiseLinearPointData([ + ])))), + CostCurve(IncrementalCurve(PiecewisePointCurve(([ (5.0, 0.0), (7.33, 300.1), (9.67, 600.72), (12.0, 900.1), - ]), + ])))), ], ) market_bid_gen2 = PSY.Deterministic(; @@ -2819,7 +2839,7 @@ function build_test_RTS_GMLC_sys_with_hybrid(; raw_data, add_forecasts, kwargs.. storage = storage, renewable_unit = renewable_unit, base_power = 100.0, - operation_cost = TwoPartCost(nothing), + operation_cost = MarketBidCost(nothing), ) add_component!(sys, h_sys) return sys @@ -2926,7 +2946,8 @@ function build_c_sys5_bat_ems(; add_time_series!(c_sys5_bat, serv, Deterministic("requirement", forecast_data)) end for (ix, serv) in enumerate(get_components(ReserveDemandCurve, c_sys5_bat)) - forecast_data = SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}() + forecast_data = + SortedDict{Dates.DateTime, Vector{CostCurve{PiecewiseIncrementalCurve}}}() for t in 1:2 ini_time = timestamp(ORDC_cost_ts[t])[1] forecast_data[ini_time] = TimeSeries.values(ORDC_cost_ts[t]) @@ -3006,8 +3027,9 @@ function build_c_sys5_hybrid(; add_forecasts, raw_data, kwargs...) reactive_power_limits = (min = -2.0, max = 2.0), base_power = 100.0, storage_target = 0.2, - operation_cost = PSY.StorageManagementCost(; - variable = PSY.LinearFunctionData(0.0), + operation_cost = PSY.StorageCost(; + charge_variable_cost = zero(CostCurve), + discharge_variable_cost = zero(CostCurve), fixed = 0.0, start_up = 0.0, shut_down = 0.0, @@ -3189,8 +3211,9 @@ function build_c_sys5_hybrid_uc(; add_forecasts, raw_data, kwargs...) reactive_power_limits = (min = -2.0, max = 2.0), base_power = 100.0, storage_target = 0.2, - operation_cost = PSY.StorageManagementCost(; - variable = PSY.LinearFunctionData(0.0), + operation_cost = PSY.StorageCost(; + charge_variable_cost = zero(CostCurve), + discharge_variable_cost = zero(CostCurve), fixed = 0.0, start_up = 0.0, shut_down = 0.0, @@ -3317,8 +3340,9 @@ function build_c_sys5_hybrid_ed(; add_forecasts, raw_data, kwargs...) reactive_power_limits = (min = -2.0, max = 2.0), base_power = 100.0, storage_target = 0.2, - operation_cost = PSY.StorageManagementCost(; - variable = PSY.LinearFunctionData(0.0), + operation_cost = PSY.StorageCost(; + charge_variable_cost = zero(CostCurve), + discharge_variable_cost = zero(CostCurve), fixed = 0.0, start_up = 0.0, shut_down = 0.0, @@ -3462,14 +3486,8 @@ function build_hydro_test_case_b_sys(; raw_data, kwargs...) reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), time_limits = nothing, - operation_cost = PSY.StorageManagementCost(; - variable = LinearFunctionData(0.15), - fixed = 0.0, - start_up = 0.0, - shut_down = 0.0, - energy_shortage_cost = 0.0, - energy_surplus_cost = 10.0, - ), + operation_cost = HydroGenerationCost( + CostCurve(LinearCurve(0.15)), 0.0), base_power = 100.0, storage_capacity = 50.0, inflow = 4.0, @@ -3524,14 +3542,8 @@ function build_hydro_test_case_c_sys(; raw_data, kwargs...) reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), time_limits = nothing, - operation_cost = PSY.StorageManagementCost(; - variable = LinearFunctionData(0.15), - fixed = 0.0, - start_up = 0.0, - shut_down = 0.0, - energy_shortage_cost = 50.0, - energy_surplus_cost = 0.0, - ), + operation_cost = HydroGenerationCost( + CostCurve(LinearCurve(0.15)), 0.0), base_power = 100.0, storage_capacity = 50.0, inflow = 4.0, @@ -3586,14 +3598,8 @@ function build_hydro_test_case_d_sys(; raw_data, kwargs...) reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), time_limits = nothing, - operation_cost = PSY.StorageManagementCost(; - variable = LinearFunctionData(0.15), - fixed = 0.0, - start_up = 0.0, - shut_down = 0.0, - energy_shortage_cost = 0.0, - energy_surplus_cost = -5.0, - ), + operation_cost = HydroGenerationCost( + CostCurve(LinearCurve(0.15)), 0.0), base_power = 100.0, storage_capacity = 50.0, inflow = 4.0, @@ -3648,13 +3654,9 @@ function build_hydro_test_case_e_sys(; raw_data, kwargs...) reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), time_limits = nothing, - operation_cost = PSY.StorageManagementCost(; - variable = LinearFunctionData(0.15), - fixed = 0.0, - start_up = 0.0, - shut_down = 0.0, - energy_shortage_cost = 50.0, - energy_surplus_cost = 40.0, + operation_cost = HydroGenerationCost( + CostCurve(LinearCurve(0.15)), + 0.0, ), base_power = 100.0, storage_capacity = 50.0, @@ -3710,13 +3712,9 @@ function build_hydro_test_case_f_sys(; raw_data, kwargs...) reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), time_limits = nothing, - operation_cost = PSY.StorageManagementCost(; - variable = LinearFunctionData(0.15), - fixed = 0.0, - start_up = 0.0, - shut_down = 0.0, - energy_shortage_cost = 50.0, - energy_surplus_cost = -5.0, + operation_cost = HydroGenerationCost( + CostCurve(LinearCurve(0.15)), + 0.0, ), base_power = 100.0, storage_capacity = 50.0, @@ -3770,7 +3768,7 @@ function build_batt_test_case_b_sys(; raw_data, kwargs...) PrimeMovers.WT, (min = -0.800, max = 0.800), 1.0, - TwoPartCost(LinearFunctionData(0.220), 0.0), + RenewableGenerationCost(CostCurve(LinearCurve(0.220))), 100.0, ) @@ -3790,8 +3788,9 @@ function build_batt_test_case_b_sys(; raw_data, kwargs...) reactive_power_limits = (min = -2.0, max = 2.0), base_power = 100.0, storage_target = 0.2, - operation_cost = PSY.StorageManagementCost(; - variable = PSY.LinearFunctionData(0.0), + operation_cost = PSY.StorageCost(; + charge_variable_cost = zero(CostCurve), + discharge_variable_cost = zero(CostCurve), fixed = 0.0, start_up = 0.0, shut_down = 0.0, @@ -3845,7 +3844,7 @@ function build_batt_test_case_c_sys(; raw_data, kwargs...) PrimeMovers.WT, (min = -0.800, max = 0.800), 1.0, - TwoPartCost(LinearFunctionData(0.220), 0.0), + RenewableGenerationCost(CostCurve(LinearCurve(0.220))), 100.0, ) @@ -3865,8 +3864,9 @@ function build_batt_test_case_c_sys(; raw_data, kwargs...) reactive_power_limits = (min = -2.0, max = 2.0), base_power = 100.0, storage_target = 0.2, - operation_cost = PSY.StorageManagementCost(; - variable = PSY.LinearFunctionData(0.0), + operation_cost = PSY.StorageCost(; + charge_variable_cost = zero(CostCurve), + discharge_variable_cost = zero(CostCurve), fixed = 0.0, start_up = 0.0, shut_down = 0.0, @@ -3920,7 +3920,7 @@ function build_batt_test_case_d_sys(; raw_data, kwargs...) PrimeMovers.WT, (min = -0.800, max = 0.800), 1.0, - TwoPartCost(LinearFunctionData(0.220), 0.0), + RenewableGenerationCost(CostCurve(LinearCurve(0.220))), 100.0, ) @@ -3940,8 +3940,9 @@ function build_batt_test_case_d_sys(; raw_data, kwargs...) reactive_power_limits = (min = -2.0, max = 2.0), base_power = 100.0, storage_target = 0.2, - operation_cost = PSY.StorageManagementCost(; - variable = PSY.LinearFunctionData(0.0), + operation_cost = PSY.StorageCost(; + charge_variable_cost = zero(CostCurve), + discharge_variable_cost = zero(CostCurve), fixed = 0.0, start_up = 0.0, shut_down = 0.0, @@ -3995,7 +3996,7 @@ function build_batt_test_case_e_sys(; raw_data, kwargs...) PrimeMovers.WT, (min = -0.800, max = 0.800), 1.0, - TwoPartCost(LinearFunctionData(0.220), 0.0), + RenewableGenerationCost(CostCurve(LinearCurve(0.220))), 100.0, ) @@ -4015,8 +4016,9 @@ function build_batt_test_case_e_sys(; raw_data, kwargs...) reactive_power_limits = (min = -2.0, max = 2.0), base_power = 100.0, storage_target = 0.2, - operation_cost = PSY.StorageManagementCost(; - variable = PSY.LinearFunctionData(0.0), + operation_cost = PSY.StorageCost(; + charge_variable_cost = zero(CostCurve), + discharge_variable_cost = zero(CostCurve), fixed = 0.0, start_up = 0.0, shut_down = 0.0, @@ -4070,7 +4072,7 @@ function build_batt_test_case_f_sys(; raw_data, kwargs...) PrimeMovers.WT, (min = -0.800, max = 0.800), 1.0, - TwoPartCost(LinearFunctionData(0.220), 0.0), + RenewableGenerationCost(CostCurve(LinearCurve(0.220))), 100.0, ) @@ -4090,8 +4092,9 @@ function build_batt_test_case_f_sys(; raw_data, kwargs...) reactive_power_limits = (min = -2.0, max = 2.0), base_power = 100.0, storage_target = 0.2, - operation_cost = PSY.StorageManagementCost(; - variable = PSY.LinearFunctionData(0.0), + operation_cost = PSY.StorageCost(; + charge_variable_cost = zero(CostCurve), + discharge_variable_cost = zero(CostCurve), fixed = 0.0, start_up = 0.0, shut_down = 0.0, diff --git a/src/system_descriptor_data.jl b/src/system_descriptor_data.jl index 0a0c96ba..fb054e60 100644 --- a/src/system_descriptor_data.jl +++ b/src/system_descriptor_data.jl @@ -734,14 +734,6 @@ const SYSTEM_CATALOG = [ raw_data = RTS_DIR, build_function = build_HVDC_TWO_RTO_RTS_5Min_sys, ), - SystemDescriptor(; - name = "modified_tamu_ercot_da_system", - description = "Modified tamu ercot day ahead system", - category = PSISystems, - raw_data = joinpath(DATA_DIR, "tamu_ercot"), - build_function = build_modified_tamu_ercot_da_sys, - download_function = download_modified_tamu_ercot_da, - ), SystemDescriptor(; name = "psse_ACTIVSg2000_sys", description = "PSSE ACTIVSg2000 Test system", diff --git a/src/utils/download.jl b/src/utils/download.jl index 4e972b9b..05167dc6 100644 --- a/src/utils/download.jl +++ b/src/utils/download.jl @@ -68,23 +68,3 @@ function unzip(::Type{Windows}, filename, directory) end @assert success(`$path_7z x $filename -y -o$directory`) "Unable to extract $filename to $directory" end - -function download_modified_tamu_ercot_da(; kwargs...) - directory = abspath(normpath(joinpath(PACKAGE_DIR, "data"))) - data = joinpath(directory, "tamu_ercot") - # This is temporary place for hosting the dataset. - data_urls = Dict( - "DA_sys.json" => "https://www.dropbox.com/sh/uzohjqzoyinyyas/AAC40qKEowAbGax-yYiB_4wna/DA_sys.json?dl=1", - "DA_sys_validation_descriptors.json" => "https://www.dropbox.com/sh/uzohjqzoyinyyas/AADWU21wuWW62Fl5SP4ubo8Va/DA_sys_validation_descriptors.json?dl=1", - "DA_sys_time_series_storage.h5" => "https://www.dropbox.com/sh/uzohjqzoyinyyas/AADURazsNKxO5l4_1wBiW8qsa/DA_sys_time_series_storage.h5?dl=1", - ) - if !isdir(data) - @info "Downloading TAMU ERCOT dataset." - mkpath(data) - for (file, urls) in data_urls - tempfilename = Base.download(urls) - mv(tempfilename, joinpath(data, file); force = true) - end - end - return data -end