From 11c51c4b3323362f51d7b3c969f6d37dc5468f6a Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 27 Jan 2023 13:37:34 -0700 Subject: [PATCH 01/31] change ACBuses name --- src/library/psitest_library.jl | 38 +++++++++++++++++----------------- src/library/psytest_library.jl | 4 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 08d3ae4..5075ff8 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -918,7 +918,7 @@ function build_c_sys5_reg(; kwargs...) area = PSY.Area("1") PSY.add_component!(c_sys5_reg, area) - [PSY.set_area!(b, area) for b in PSY.get_components(PSY.Bus, c_sys5_reg)] + [PSY.set_area!(b, area) for b in PSY.get_components(PSY.ACBus, c_sys5_reg)] AGC_service = PSY.AGC( name = "AGC_Area1", available = true, @@ -974,7 +974,7 @@ end function build_sys_ramp_testing(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gen_ramp = [ PSY.ThermalStandard( @@ -1378,7 +1378,7 @@ end function build_c_sys5_pwl_uc(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_uc = build_c_sys5_uc(; sys_kwargs...) - thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.Bus, c_sys5_uc))) + thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.ACBus, c_sys5_uc))) for d in thermal PSY.add_component!(c_sys5_uc, d) end @@ -1456,7 +1456,7 @@ end function build_c_sys5_pwl_ed(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_ed = build_c_sys5_ed(; sys_kwargs...) - thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.Bus, c_sys5_ed))) + thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.ACBus, c_sys5_ed))) for d in thermal PSY.add_component!(c_sys5_ed, d) end @@ -1467,7 +1467,7 @@ function build_c_sys5_pwl_ed_nonconvex(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_ed = build_c_sys5_ed(; sys_kwargs...) thermal = - thermal_generators5_pwl_nonconvex(collect(PSY.get_components(PSY.Bus, c_sys5_ed))) + thermal_generators5_pwl_nonconvex(collect(PSY.get_components(PSY.ACBus, c_sys5_ed))) for d in thermal PSY.add_component!(c_sys5_ed, d) end @@ -2213,7 +2213,7 @@ end function build_sos_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost_sos = [ PSY.ThermalStandard( @@ -2306,7 +2306,7 @@ end function build_pwl_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost = [ PSY.ThermalStandard( @@ -2375,7 +2375,7 @@ end function build_duration_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) DA_dur = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -2438,7 +2438,7 @@ end function build_pwl_marketbid_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost = [ PSY.ThermalStandard( @@ -3262,7 +3262,7 @@ end function build_hydro_test_case_b_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3324,7 +3324,7 @@ end function build_hydro_test_case_c_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3386,7 +3386,7 @@ end function build_hydro_test_case_d_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3448,7 +3448,7 @@ end function build_hydro_test_case_e_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3510,7 +3510,7 @@ end function build_hydro_test_case_f_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3572,7 +3572,7 @@ end function build_batt_test_case_b_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3647,7 +3647,7 @@ end function build_batt_test_case_c_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3722,7 +3722,7 @@ end function build_batt_test_case_d_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3797,7 +3797,7 @@ end function build_batt_test_case_e_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3872,7 +3872,7 @@ end function build_batt_test_case_f_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.2, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index 2a8a9b7..7b543e7 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -155,7 +155,7 @@ end function build_dynamic_inverter_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) nodes_OMIB = [ - PSY.Bus( + PSY.ACBus( 1, #number "Bus 1", #Name "REF", #BusType (REF, PV, PQ) @@ -166,7 +166,7 @@ function build_dynamic_inverter_sys(; kwargs...) nothing, nothing, ), #Base voltage in kV - PSY.Bus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), + PSY.ACBus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), ] battery = PSY.GenericBattery( From 1a8cea982a0afc8bf3bca1dbc01efec725028bdc Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 27 Jan 2023 13:37:34 -0700 Subject: [PATCH 02/31] change ACBuses name --- src/library/psitest_library.jl | 38 +++++++++++++++++----------------- src/library/psytest_library.jl | 4 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 08d3ae4..5075ff8 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -918,7 +918,7 @@ function build_c_sys5_reg(; kwargs...) area = PSY.Area("1") PSY.add_component!(c_sys5_reg, area) - [PSY.set_area!(b, area) for b in PSY.get_components(PSY.Bus, c_sys5_reg)] + [PSY.set_area!(b, area) for b in PSY.get_components(PSY.ACBus, c_sys5_reg)] AGC_service = PSY.AGC( name = "AGC_Area1", available = true, @@ -974,7 +974,7 @@ end function build_sys_ramp_testing(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gen_ramp = [ PSY.ThermalStandard( @@ -1378,7 +1378,7 @@ end function build_c_sys5_pwl_uc(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_uc = build_c_sys5_uc(; sys_kwargs...) - thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.Bus, c_sys5_uc))) + thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.ACBus, c_sys5_uc))) for d in thermal PSY.add_component!(c_sys5_uc, d) end @@ -1456,7 +1456,7 @@ end function build_c_sys5_pwl_ed(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_ed = build_c_sys5_ed(; sys_kwargs...) - thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.Bus, c_sys5_ed))) + thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.ACBus, c_sys5_ed))) for d in thermal PSY.add_component!(c_sys5_ed, d) end @@ -1467,7 +1467,7 @@ function build_c_sys5_pwl_ed_nonconvex(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_ed = build_c_sys5_ed(; sys_kwargs...) thermal = - thermal_generators5_pwl_nonconvex(collect(PSY.get_components(PSY.Bus, c_sys5_ed))) + thermal_generators5_pwl_nonconvex(collect(PSY.get_components(PSY.ACBus, c_sys5_ed))) for d in thermal PSY.add_component!(c_sys5_ed, d) end @@ -2213,7 +2213,7 @@ end function build_sos_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost_sos = [ PSY.ThermalStandard( @@ -2306,7 +2306,7 @@ end function build_pwl_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost = [ PSY.ThermalStandard( @@ -2375,7 +2375,7 @@ end function build_duration_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) DA_dur = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -2438,7 +2438,7 @@ end function build_pwl_marketbid_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost = [ PSY.ThermalStandard( @@ -3262,7 +3262,7 @@ end function build_hydro_test_case_b_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3324,7 +3324,7 @@ end function build_hydro_test_case_c_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3386,7 +3386,7 @@ end function build_hydro_test_case_d_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3448,7 +3448,7 @@ end function build_hydro_test_case_e_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3510,7 +3510,7 @@ end function build_hydro_test_case_f_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3572,7 +3572,7 @@ end function build_batt_test_case_b_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3647,7 +3647,7 @@ end function build_batt_test_case_c_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3722,7 +3722,7 @@ end function build_batt_test_case_d_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3797,7 +3797,7 @@ end function build_batt_test_case_e_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3872,7 +3872,7 @@ end function build_batt_test_case_f_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.2, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index 2a8a9b7..7b543e7 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -155,7 +155,7 @@ end function build_dynamic_inverter_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) nodes_OMIB = [ - PSY.Bus( + PSY.ACBus( 1, #number "Bus 1", #Name "REF", #BusType (REF, PV, PQ) @@ -166,7 +166,7 @@ function build_dynamic_inverter_sys(; kwargs...) nothing, nothing, ), #Base voltage in kV - PSY.Bus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), + PSY.ACBus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), ] battery = PSY.GenericBattery( From 06c2c912cc399acab4f57eb4f52230b45cb4a289 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 3 Feb 2023 16:40:32 -0800 Subject: [PATCH 03/31] add 10bus AC/DC system --- src/library/psitest_library.jl | 48 ++++++++++++++++++++++++++++++++++ src/system_descriptor_data.jl | 7 +++++ src/system_library.jl | 1 + 3 files changed, 56 insertions(+) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 5075ff8..cc58609 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1030,6 +1030,54 @@ function build_sys_ramp_testing(; kwargs...) return ramp_test_sys end +function build_sys_10bus_ac_dc(; kwargs...) + sys_kwargs = filter_kwargs(; kwargs...) + nodes = nodes10() + nodesdc = nodes10_dc() + branchesdc = branches10_dc(nodesdc) + ipcs = ipcs_10bus(nodes, nodesdc) + + sys = System( + 100.0, + nodes, + thermal_generators10(nodes), + loads10(nodes), + branches10_ac(nodes), + sys_kwargs... + ) + + # Add DC Buses + for n in nodesdc + add_component!(sys, n) + end + # Add DC Branches + for l in branchesdc + add_component!(sys, l) + end + # Add IPCs + for i in ipcs + add_component!(sys, i) + end + + # Add TimeSeries to Loads + resolution = Dates.Hour(1) + loads = get_components(PowerLoad, sys) + for l in loads + if occursin("nodeB", get_name(l)) + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + elseif occursin("nodeC", get_name(l)) + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + else + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + end + end + + return sys +end + function build_c_sys5_uc(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) nodes = nodes5() diff --git a/src/system_descriptor_data.jl b/src/system_descriptor_data.jl index 9f38dd8..7d764b7 100644 --- a/src/system_descriptor_data.jl +++ b/src/system_descriptor_data.jl @@ -195,6 +195,13 @@ const SYSTEM_CATALOG = [ raw_data = joinpath(DATA_DIR, "psy_data", "data_5bus_pu.jl"), build_function = build_c_sys5_reg, ), + SystemDescriptor( + name = "sys10_pjm_ac_dc", + description = "10-bus system (duplicate 5-bus PJM) with 4-DC bus system", + category = PSISystems, + raw_data = joinpath(DATA_DIR, "psy_data", "data_10bus_ac_dc_pu.jl"), + build_function = build_sys_10bus_ac_dc, + ), SystemDescriptor( name = "c_ramp_test", description = "1-bus for ramp testing", diff --git a/src/system_library.jl b/src/system_library.jl index 47229d0..16b7f38 100644 --- a/src/system_library.jl +++ b/src/system_library.jl @@ -1,4 +1,5 @@ include(joinpath(DATA_DIR, "psy_data", "data_5bus_pu.jl")) +include(joinpath(DATA_DIR, "psy_data", "data_10bus_ac_dc_pu.jl")) include(joinpath(DATA_DIR, "psy_data", "data_14bus_pu.jl")) include(joinpath(DATA_DIR, "psid_tests", "data_tests/dynamic_test_data.jl")) From 2c4e60b9edaddc9db473720d47a92f6dd50ab0de Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 3 Feb 2023 17:19:11 -0800 Subject: [PATCH 04/31] format --- src/library/psitest_library.jl | 4 ++-- src/library/psytest_library.jl | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index cc58609..871364e 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1036,14 +1036,14 @@ function build_sys_10bus_ac_dc(; kwargs...) nodesdc = nodes10_dc() branchesdc = branches10_dc(nodesdc) ipcs = ipcs_10bus(nodes, nodesdc) - + sys = System( 100.0, nodes, thermal_generators10(nodes), loads10(nodes), branches10_ac(nodes), - sys_kwargs... + sys_kwargs..., ) # Add DC Buses diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index 7b543e7..8468d1f 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -166,7 +166,17 @@ function build_dynamic_inverter_sys(; kwargs...) nothing, nothing, ), #Base voltage in kV - PSY.ACBus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), + PSY.ACBus( + 2, + "Bus 2", + "PV", + 0, + 1.045, + (min = 0.94, max = 1.06), + 69, + nothing, + nothing, + ), ] battery = PSY.GenericBattery( From 720a5b5b656e911fda98121e535b2256b03e0445 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 5 Feb 2023 14:11:55 -0700 Subject: [PATCH 05/31] add package call PSY --- src/library/psitest_library.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 871364e..742e8a4 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1037,7 +1037,7 @@ function build_sys_10bus_ac_dc(; kwargs...) branchesdc = branches10_dc(nodesdc) ipcs = ipcs_10bus(nodes, nodesdc) - sys = System( + sys = PSY.System( 100.0, nodes, thermal_generators10(nodes), @@ -1048,30 +1048,30 @@ function build_sys_10bus_ac_dc(; kwargs...) # Add DC Buses for n in nodesdc - add_component!(sys, n) + PSY.add_component!(sys, n) end # Add DC Branches for l in branchesdc - add_component!(sys, l) + PSY.add_component!(sys, l) end # Add IPCs for i in ipcs - add_component!(sys, i) + PSY.add_component!(sys, i) end # Add TimeSeries to Loads resolution = Dates.Hour(1) - loads = get_components(PowerLoad, sys) + loads = PSY.get_components(PowerLoad, sys) for l in loads - if occursin("nodeB", get_name(l)) + if occursin("nodeB", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) - elseif occursin("nodeC", get_name(l)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + elseif occursin("nodeC", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) else data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) end end From 57f8aec416660c715903a6d0d02019b24cc4cba7 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Mon, 13 Feb 2023 09:05:50 -0700 Subject: [PATCH 06/31] add a fix to PSY3 tests --- src/library/psitest_library.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 742e8a4..4e12648 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1065,13 +1065,13 @@ function build_sys_10bus_ac_dc(; kwargs...) for l in loads if occursin("nodeB", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) elseif occursin("nodeC", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) else data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) end end From e67db1ff8555e568749eedd42f6f6761215717a6 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Tue, 14 Feb 2023 09:44:32 -0800 Subject: [PATCH 07/31] update project --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c46c118..6acdb07 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PowerSystemCaseBuilder" uuid = "f00506e0-b84f-492a-93c2-c0a9afc4364e" authors = ["sourabhdalvi "] -version = "1.0.1" +version = "1.0.3" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" From 7a34fff4eece10ec87f3e002cfef92277cd4cd6d Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 21 Feb 2023 10:15:18 -0700 Subject: [PATCH 08/31] update artifact reference --- Artifacts.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index eba39b5..17cfac0 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,9 +1,10 @@ [CaseData] -git-tree-sha1 = "fec03a034c9450044006761a8a29ac9ae09a0c2d" +git-tree-sha1 = "b2e5ec0a5e5dabe0d5b7864fe743f410d5e0d224" +lazy = true [[CaseData.download]] - url = "https://github.com/NREL-SIIP/PowerSystemsTestData/archive/refs/tags/1.0.tar.gz" - sha256 = "4bf48a997c19f22e6dc9c9a305dcdb60e0013a95b8e882cba419423235698570" + url = "https://github.com/NREL-SIIP/PowerSystemsTestData/archive/refs/tags/2.0-alpha.tar.gz" + sha256 = "b997642874dc3a5fc7c5b25f9270a03ef38473ea5acfd4e814e1a8ede4be9fad" [rts] git-tree-sha1 = "5098f357bad765bfefcff58f080818863ca776bd" From c97ffc07d3d33f8348bb8aedc1163bbcb7ad3e33 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 21 Feb 2023 10:21:50 -0700 Subject: [PATCH 09/31] update definitions --- src/definitions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions.jl b/src/definitions.jl index 8a3919c..1ae1246 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -1,5 +1,5 @@ const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder)))) -const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-1.0") +const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0-alpha") const RTS_DIR = joinpath(LazyArtifacts.artifact"rts", "RTS-GMLC-0.2.2") const SYSTEM_DESCRIPTORS_FILE = joinpath(PACKAGE_DIR, "src", "system_descriptor.jl") From 80b45f60406e8df0f0b59c50e43bad5d248bbc74 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 27 Jan 2023 13:37:34 -0700 Subject: [PATCH 10/31] change ACBuses name --- src/library/psitest_library.jl | 40 +++++++++++++++++----------------- src/library/psytest_library.jl | 4 ++-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index f5e55e1..e6d1282 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -918,8 +918,8 @@ function build_c_sys5_reg(; kwargs...) area = PSY.Area("1") PSY.add_component!(c_sys5_reg, area) - [PSY.set_area!(b, area) for b in PSY.get_components(PSY.Bus, c_sys5_reg)] - AGC_service = PSY.AGC(; + [PSY.set_area!(b, area) for b in PSY.get_components(PSY.ACBus, c_sys5_reg)] + AGC_service = PSY.AGC( name = "AGC_Area1", available = true, bias = 739.0, @@ -977,7 +977,7 @@ end function build_sys_ramp_testing(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gen_ramp = [ PSY.ThermalStandard(; @@ -1381,7 +1381,7 @@ end function build_c_sys5_pwl_uc(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_uc = build_c_sys5_uc(; sys_kwargs...) - thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.Bus, c_sys5_uc))) + thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.ACBus, c_sys5_uc))) for d in thermal PSY.add_component!(c_sys5_uc, d) end @@ -1459,7 +1459,7 @@ end function build_c_sys5_pwl_ed(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_ed = build_c_sys5_ed(; sys_kwargs...) - thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.Bus, c_sys5_ed))) + thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.ACBus, c_sys5_ed))) for d in thermal PSY.add_component!(c_sys5_ed, d) end @@ -1470,7 +1470,7 @@ function build_c_sys5_pwl_ed_nonconvex(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_ed = build_c_sys5_ed(; sys_kwargs...) thermal = - thermal_generators5_pwl_nonconvex(collect(PSY.get_components(PSY.Bus, c_sys5_ed))) + thermal_generators5_pwl_nonconvex(collect(PSY.get_components(PSY.ACBus, c_sys5_ed))) for d in thermal PSY.add_component!(c_sys5_ed, d) end @@ -2216,7 +2216,7 @@ end function build_sos_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost_sos = [ PSY.ThermalStandard(; @@ -2309,7 +2309,7 @@ end function build_pwl_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost = [ PSY.ThermalStandard(; @@ -2378,7 +2378,7 @@ end function build_duration_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) DA_dur = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -2441,7 +2441,7 @@ end function build_pwl_marketbid_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost = [ PSY.ThermalStandard(; @@ -3265,7 +3265,7 @@ end function build_hydro_test_case_b_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3327,7 +3327,7 @@ end function build_hydro_test_case_c_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3389,7 +3389,7 @@ end function build_hydro_test_case_d_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3451,7 +3451,7 @@ end function build_hydro_test_case_e_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3513,7 +3513,7 @@ end function build_hydro_test_case_f_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3575,7 +3575,7 @@ end function build_batt_test_case_b_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3650,7 +3650,7 @@ end function build_batt_test_case_c_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3725,7 +3725,7 @@ end function build_batt_test_case_d_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3800,7 +3800,7 @@ end function build_batt_test_case_e_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3875,7 +3875,7 @@ end function build_batt_test_case_f_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.2, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index 6965347..a825db4 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -155,7 +155,7 @@ end function build_dynamic_inverter_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) nodes_OMIB = [ - PSY.Bus( + PSY.ACBus( 1, #number "Bus 1", #Name "REF", #BusType (REF, PV, PQ) @@ -166,7 +166,7 @@ function build_dynamic_inverter_sys(; kwargs...) nothing, nothing, ), #Base voltage in kV - PSY.Bus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), + PSY.ACBus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), ] battery = PSY.GenericBattery(; From b6c43b3c97abd576d8d3455ecf67f5c1eb1e9b55 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 3 Feb 2023 16:40:32 -0800 Subject: [PATCH 11/31] add 10bus AC/DC system --- src/library/psitest_library.jl | 48 ++++++++++++++++++++++++++++++++++ src/system_descriptor_data.jl | 9 ++++++- src/system_library.jl | 1 + 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index e6d1282..28673b7 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1033,6 +1033,54 @@ function build_sys_ramp_testing(; kwargs...) return ramp_test_sys end +function build_sys_10bus_ac_dc(; kwargs...) + sys_kwargs = filter_kwargs(; kwargs...) + nodes = nodes10() + nodesdc = nodes10_dc() + branchesdc = branches10_dc(nodesdc) + ipcs = ipcs_10bus(nodes, nodesdc) + + sys = System( + 100.0, + nodes, + thermal_generators10(nodes), + loads10(nodes), + branches10_ac(nodes), + sys_kwargs... + ) + + # Add DC Buses + for n in nodesdc + add_component!(sys, n) + end + # Add DC Branches + for l in branchesdc + add_component!(sys, l) + end + # Add IPCs + for i in ipcs + add_component!(sys, i) + end + + # Add TimeSeries to Loads + resolution = Dates.Hour(1) + loads = get_components(PowerLoad, sys) + for l in loads + if occursin("nodeB", get_name(l)) + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + elseif occursin("nodeC", get_name(l)) + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + else + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + end + end + + return sys +end + function build_c_sys5_uc(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) nodes = nodes5() diff --git a/src/system_descriptor_data.jl b/src/system_descriptor_data.jl index b3ee67d..c5fa6a6 100644 --- a/src/system_descriptor_data.jl +++ b/src/system_descriptor_data.jl @@ -195,7 +195,14 @@ const SYSTEM_CATALOG = [ raw_data = joinpath(DATA_DIR, "psy_data", "data_5bus_pu.jl"), build_function = build_c_sys5_reg, ), - SystemDescriptor(; + SystemDescriptor( + name = "sys10_pjm_ac_dc", + description = "10-bus system (duplicate 5-bus PJM) with 4-DC bus system", + category = PSISystems, + raw_data = joinpath(DATA_DIR, "psy_data", "data_10bus_ac_dc_pu.jl"), + build_function = build_sys_10bus_ac_dc, + ), + SystemDescriptor( name = "c_ramp_test", description = "1-bus for ramp testing", category = PSITestSystems, diff --git a/src/system_library.jl b/src/system_library.jl index 0c083b1..531444f 100644 --- a/src/system_library.jl +++ b/src/system_library.jl @@ -1,4 +1,5 @@ include(joinpath(DATA_DIR, "psy_data", "data_5bus_pu.jl")) +include(joinpath(DATA_DIR, "psy_data", "data_10bus_ac_dc_pu.jl")) include(joinpath(DATA_DIR, "psy_data", "data_14bus_pu.jl")) include(joinpath(DATA_DIR, "psid_tests", "data_tests", "dynamic_test_data.jl")) include(joinpath(DATA_DIR, "psid_tests", "data_examples", "load_tutorial_functions.jl")) From 0598d8b6ab1588b1f08dcc0b9adb33e66f3743e7 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 3 Feb 2023 17:19:11 -0800 Subject: [PATCH 12/31] format --- src/library/psitest_library.jl | 4 ++-- src/library/psytest_library.jl | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 28673b7..898b0c6 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1039,14 +1039,14 @@ function build_sys_10bus_ac_dc(; kwargs...) nodesdc = nodes10_dc() branchesdc = branches10_dc(nodesdc) ipcs = ipcs_10bus(nodes, nodesdc) - + sys = System( 100.0, nodes, thermal_generators10(nodes), loads10(nodes), branches10_ac(nodes), - sys_kwargs... + sys_kwargs..., ) # Add DC Buses diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index a825db4..6d7ac62 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -166,7 +166,17 @@ function build_dynamic_inverter_sys(; kwargs...) nothing, nothing, ), #Base voltage in kV - PSY.ACBus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), + PSY.ACBus( + 2, + "Bus 2", + "PV", + 0, + 1.045, + (min = 0.94, max = 1.06), + 69, + nothing, + nothing, + ), ] battery = PSY.GenericBattery(; From 42959dc7fd30f5bd4b85f27330b9527fc689a674 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 5 Feb 2023 14:11:55 -0700 Subject: [PATCH 13/31] add package call PSY --- src/library/psitest_library.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 898b0c6..2d1657c 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1040,7 +1040,7 @@ function build_sys_10bus_ac_dc(; kwargs...) branchesdc = branches10_dc(nodesdc) ipcs = ipcs_10bus(nodes, nodesdc) - sys = System( + sys = PSY.System( 100.0, nodes, thermal_generators10(nodes), @@ -1051,30 +1051,30 @@ function build_sys_10bus_ac_dc(; kwargs...) # Add DC Buses for n in nodesdc - add_component!(sys, n) + PSY.add_component!(sys, n) end # Add DC Branches for l in branchesdc - add_component!(sys, l) + PSY.add_component!(sys, l) end # Add IPCs for i in ipcs - add_component!(sys, i) + PSY.add_component!(sys, i) end # Add TimeSeries to Loads resolution = Dates.Hour(1) - loads = get_components(PowerLoad, sys) + loads = PSY.get_components(PowerLoad, sys) for l in loads - if occursin("nodeB", get_name(l)) + if occursin("nodeB", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) - elseif occursin("nodeC", get_name(l)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + elseif occursin("nodeC", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) else data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) end end From cccdbf7a8417c165f1e9256ecea61556e5ccd41a Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Mon, 13 Feb 2023 09:05:50 -0700 Subject: [PATCH 14/31] add a fix to PSY3 tests --- src/library/psitest_library.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 2d1657c..3b72695 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1068,13 +1068,13 @@ function build_sys_10bus_ac_dc(; kwargs...) for l in loads if occursin("nodeB", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) elseif occursin("nodeC", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) else data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) end end From 3057894e545fb4cc73b990c658d9cb0137b42bfb Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 21 Feb 2023 10:21:50 -0700 Subject: [PATCH 15/31] update definitions --- src/definitions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions.jl b/src/definitions.jl index 98929fd..1ae1246 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -1,5 +1,5 @@ const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder)))) -const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-1.0.4") +const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0-alpha") const RTS_DIR = joinpath(LazyArtifacts.artifact"rts", "RTS-GMLC-0.2.2") const SYSTEM_DESCRIPTORS_FILE = joinpath(PACKAGE_DIR, "src", "system_descriptor.jl") From 53ea2210d6c6b2a84b95c8568e002a961fdfced0 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 5 Jul 2023 16:29:27 -0600 Subject: [PATCH 16/31] update artifacts --- Artifacts.toml | 6 +++--- src/definitions.jl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 17cfac0..2724061 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,10 +1,10 @@ [CaseData] -git-tree-sha1 = "b2e5ec0a5e5dabe0d5b7864fe743f410d5e0d224" +git-tree-sha1 = "5b593e426b15da3f43a99e823041e9d06387fc3a" lazy = true [[CaseData.download]] - url = "https://github.com/NREL-SIIP/PowerSystemsTestData/archive/refs/tags/2.0-alpha.tar.gz" - sha256 = "b997642874dc3a5fc7c5b25f9270a03ef38473ea5acfd4e814e1a8ede4be9fad" + url = "https://github.com/NREL-SIIP/PowerSystemsTestData/archive/refs/tags/2.0-alpha3.tar.gz" + sha256 = "a2db32c3ad4a4b5f2191ca6d2b7fd6210b94945ca3986341133f7fc5216901f1" [rts] git-tree-sha1 = "5098f357bad765bfefcff58f080818863ca776bd" diff --git a/src/definitions.jl b/src/definitions.jl index 1ae1246..1fe2c4d 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -1,5 +1,5 @@ const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder)))) -const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0-alpha") +const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0-alpha3") const RTS_DIR = joinpath(LazyArtifacts.artifact"rts", "RTS-GMLC-0.2.2") const SYSTEM_DESCRIPTORS_FILE = joinpath(PACKAGE_DIR, "src", "system_descriptor.jl") From eb9f26a0ec27716bc20d72bcb390ccce4f452ab6 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 27 Jan 2023 13:37:34 -0700 Subject: [PATCH 17/31] change ACBuses name --- src/library/psitest_library.jl | 40 +++++++++++++++++----------------- src/library/psytest_library.jl | 4 ++-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index f5e55e1..e6d1282 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -918,8 +918,8 @@ function build_c_sys5_reg(; kwargs...) area = PSY.Area("1") PSY.add_component!(c_sys5_reg, area) - [PSY.set_area!(b, area) for b in PSY.get_components(PSY.Bus, c_sys5_reg)] - AGC_service = PSY.AGC(; + [PSY.set_area!(b, area) for b in PSY.get_components(PSY.ACBus, c_sys5_reg)] + AGC_service = PSY.AGC( name = "AGC_Area1", available = true, bias = 739.0, @@ -977,7 +977,7 @@ end function build_sys_ramp_testing(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gen_ramp = [ PSY.ThermalStandard(; @@ -1381,7 +1381,7 @@ end function build_c_sys5_pwl_uc(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_uc = build_c_sys5_uc(; sys_kwargs...) - thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.Bus, c_sys5_uc))) + thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.ACBus, c_sys5_uc))) for d in thermal PSY.add_component!(c_sys5_uc, d) end @@ -1459,7 +1459,7 @@ end function build_c_sys5_pwl_ed(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_ed = build_c_sys5_ed(; sys_kwargs...) - thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.Bus, c_sys5_ed))) + thermal = thermal_generators5_pwl(collect(PSY.get_components(PSY.ACBus, c_sys5_ed))) for d in thermal PSY.add_component!(c_sys5_ed, d) end @@ -1470,7 +1470,7 @@ function build_c_sys5_pwl_ed_nonconvex(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) c_sys5_ed = build_c_sys5_ed(; sys_kwargs...) thermal = - thermal_generators5_pwl_nonconvex(collect(PSY.get_components(PSY.Bus, c_sys5_ed))) + thermal_generators5_pwl_nonconvex(collect(PSY.get_components(PSY.ACBus, c_sys5_ed))) for d in thermal PSY.add_component!(c_sys5_ed, d) end @@ -2216,7 +2216,7 @@ end function build_sos_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost_sos = [ PSY.ThermalStandard(; @@ -2309,7 +2309,7 @@ end function build_pwl_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost = [ PSY.ThermalStandard(; @@ -2378,7 +2378,7 @@ end function build_duration_test_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) DA_dur = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -2441,7 +2441,7 @@ end function build_pwl_marketbid_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) gens_cost = [ PSY.ThermalStandard(; @@ -3265,7 +3265,7 @@ end function build_hydro_test_case_b_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3327,7 +3327,7 @@ end function build_hydro_test_case_c_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3389,7 +3389,7 @@ end function build_hydro_test_case_d_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3451,7 +3451,7 @@ end function build_hydro_test_case_e_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3513,7 +3513,7 @@ end function build_hydro_test_case_f_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3575,7 +3575,7 @@ end function build_batt_test_case_b_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3650,7 +3650,7 @@ end function build_batt_test_case_c_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3725,7 +3725,7 @@ end function build_batt_test_case_d_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3800,7 +3800,7 @@ end function build_batt_test_case_e_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.4, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( @@ -3875,7 +3875,7 @@ end function build_batt_test_case_f_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) node = - PSY.Bus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) + PSY.ACBus(1, "nodeA", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing) load = PSY.PowerLoad("Bus1", true, node, 0.2, 0.9861, 100.0, 1.0, 2.0) time_periods = collect( DateTime("1/1/2024 0:00:00", "d/m/y H:M:S"):Hour(1):DateTime( diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index 6965347..a825db4 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -155,7 +155,7 @@ end function build_dynamic_inverter_sys(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) nodes_OMIB = [ - PSY.Bus( + PSY.ACBus( 1, #number "Bus 1", #Name "REF", #BusType (REF, PV, PQ) @@ -166,7 +166,7 @@ function build_dynamic_inverter_sys(; kwargs...) nothing, nothing, ), #Base voltage in kV - PSY.Bus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), + PSY.ACBus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), ] battery = PSY.GenericBattery(; From 8a6b8c5ddde497184f396343d97f4f83b78f7790 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 3 Feb 2023 16:40:32 -0800 Subject: [PATCH 18/31] add 10bus AC/DC system --- src/library/psitest_library.jl | 48 ++++++++++++++++++++++++++++++++++ src/system_descriptor_data.jl | 9 ++++++- src/system_library.jl | 1 + 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index e6d1282..28673b7 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1033,6 +1033,54 @@ function build_sys_ramp_testing(; kwargs...) return ramp_test_sys end +function build_sys_10bus_ac_dc(; kwargs...) + sys_kwargs = filter_kwargs(; kwargs...) + nodes = nodes10() + nodesdc = nodes10_dc() + branchesdc = branches10_dc(nodesdc) + ipcs = ipcs_10bus(nodes, nodesdc) + + sys = System( + 100.0, + nodes, + thermal_generators10(nodes), + loads10(nodes), + branches10_ac(nodes), + sys_kwargs... + ) + + # Add DC Buses + for n in nodesdc + add_component!(sys, n) + end + # Add DC Branches + for l in branchesdc + add_component!(sys, l) + end + # Add IPCs + for i in ipcs + add_component!(sys, i) + end + + # Add TimeSeries to Loads + resolution = Dates.Hour(1) + loads = get_components(PowerLoad, sys) + for l in loads + if occursin("nodeB", get_name(l)) + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + elseif occursin("nodeC", get_name(l)) + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + else + data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) + add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + end + end + + return sys +end + function build_c_sys5_uc(; kwargs...) sys_kwargs = filter_kwargs(; kwargs...) nodes = nodes5() diff --git a/src/system_descriptor_data.jl b/src/system_descriptor_data.jl index 0a5b084..19f6992 100644 --- a/src/system_descriptor_data.jl +++ b/src/system_descriptor_data.jl @@ -195,7 +195,14 @@ const SYSTEM_CATALOG = [ raw_data = joinpath(DATA_DIR, "psy_data", "data_5bus_pu.jl"), build_function = build_c_sys5_reg, ), - SystemDescriptor(; + SystemDescriptor( + name = "sys10_pjm_ac_dc", + description = "10-bus system (duplicate 5-bus PJM) with 4-DC bus system", + category = PSISystems, + raw_data = joinpath(DATA_DIR, "psy_data", "data_10bus_ac_dc_pu.jl"), + build_function = build_sys_10bus_ac_dc, + ), + SystemDescriptor( name = "c_ramp_test", description = "1-bus for ramp testing", category = PSITestSystems, diff --git a/src/system_library.jl b/src/system_library.jl index 0c083b1..531444f 100644 --- a/src/system_library.jl +++ b/src/system_library.jl @@ -1,4 +1,5 @@ include(joinpath(DATA_DIR, "psy_data", "data_5bus_pu.jl")) +include(joinpath(DATA_DIR, "psy_data", "data_10bus_ac_dc_pu.jl")) include(joinpath(DATA_DIR, "psy_data", "data_14bus_pu.jl")) include(joinpath(DATA_DIR, "psid_tests", "data_tests", "dynamic_test_data.jl")) include(joinpath(DATA_DIR, "psid_tests", "data_examples", "load_tutorial_functions.jl")) From 9d5edec00a842c8fc571ad9c4610ad90dccb2ffa Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 3 Feb 2023 17:19:11 -0800 Subject: [PATCH 19/31] format --- src/library/psitest_library.jl | 4 ++-- src/library/psytest_library.jl | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 28673b7..898b0c6 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1039,14 +1039,14 @@ function build_sys_10bus_ac_dc(; kwargs...) nodesdc = nodes10_dc() branchesdc = branches10_dc(nodesdc) ipcs = ipcs_10bus(nodes, nodesdc) - + sys = System( 100.0, nodes, thermal_generators10(nodes), loads10(nodes), branches10_ac(nodes), - sys_kwargs... + sys_kwargs..., ) # Add DC Buses diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index a825db4..6d7ac62 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -166,7 +166,17 @@ function build_dynamic_inverter_sys(; kwargs...) nothing, nothing, ), #Base voltage in kV - PSY.ACBus(2, "Bus 2", "PV", 0, 1.045, (min = 0.94, max = 1.06), 69, nothing, nothing), + PSY.ACBus( + 2, + "Bus 2", + "PV", + 0, + 1.045, + (min = 0.94, max = 1.06), + 69, + nothing, + nothing, + ), ] battery = PSY.GenericBattery(; From aae1f48f544bb4d2a892b24b725b6a261dd6c287 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 5 Feb 2023 14:11:55 -0700 Subject: [PATCH 20/31] add package call PSY --- src/library/psitest_library.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 898b0c6..2d1657c 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1040,7 +1040,7 @@ function build_sys_10bus_ac_dc(; kwargs...) branchesdc = branches10_dc(nodesdc) ipcs = ipcs_10bus(nodes, nodesdc) - sys = System( + sys = PSY.System( 100.0, nodes, thermal_generators10(nodes), @@ -1051,30 +1051,30 @@ function build_sys_10bus_ac_dc(; kwargs...) # Add DC Buses for n in nodesdc - add_component!(sys, n) + PSY.add_component!(sys, n) end # Add DC Branches for l in branchesdc - add_component!(sys, l) + PSY.add_component!(sys, l) end # Add IPCs for i in ipcs - add_component!(sys, i) + PSY.add_component!(sys, i) end # Add TimeSeries to Loads resolution = Dates.Hour(1) - loads = get_components(PowerLoad, sys) + loads = PSY.get_components(PowerLoad, sys) for l in loads - if occursin("nodeB", get_name(l)) + if occursin("nodeB", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) - elseif occursin("nodeC", get_name(l)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + elseif occursin("nodeC", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) else data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) - add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) end end From d46f3d5d171efdad32b7a092f407d904b38b93ca Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Mon, 13 Feb 2023 09:05:50 -0700 Subject: [PATCH 21/31] add a fix to PSY3 tests --- src/library/psitest_library.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 2d1657c..3b72695 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -1068,13 +1068,13 @@ function build_sys_10bus_ac_dc(; kwargs...) for l in loads if occursin("nodeB", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) elseif occursin("nodeC", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) else data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("active_power", data, resolution)) + PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) end end From 24f66bec8e8bcd53a6b71d045f559c5a2127c3ff Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 21 Feb 2023 10:21:50 -0700 Subject: [PATCH 22/31] update definitions --- src/definitions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions.jl b/src/definitions.jl index 98929fd..1ae1246 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -1,5 +1,5 @@ const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder)))) -const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-1.0.4") +const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0-alpha") const RTS_DIR = joinpath(LazyArtifacts.artifact"rts", "RTS-GMLC-0.2.2") const SYSTEM_DESCRIPTORS_FILE = joinpath(PACKAGE_DIR, "src", "system_descriptor.jl") From 5ee9f57a87deb1a55e1c7ae88466a2e4425656ea Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 21 Feb 2023 10:15:18 -0700 Subject: [PATCH 23/31] update artifact reference --- Artifacts.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 185213e..17cfac0 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,9 +1,10 @@ [CaseData] -git-tree-sha1 = "b67da2ffbab324574933c89f5da8037a8a837373" +git-tree-sha1 = "b2e5ec0a5e5dabe0d5b7864fe743f410d5e0d224" +lazy = true [[CaseData.download]] - url = "https://github.com/NREL-Sienna/PowerSystemsTestData/archive/refs/tags/1.0.4.tar.gz" - sha256 = "222560226fda72ee8a9ebca5c44b96c7fa92048e1088725dba1ea7f63214e83c" + url = "https://github.com/NREL-SIIP/PowerSystemsTestData/archive/refs/tags/2.0-alpha.tar.gz" + sha256 = "b997642874dc3a5fc7c5b25f9270a03ef38473ea5acfd4e814e1a8ede4be9fad" [rts] git-tree-sha1 = "5098f357bad765bfefcff58f080818863ca776bd" From 17a966f9dfa45807a66d27b26da0323cbe53176f Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 5 Jul 2023 16:29:27 -0600 Subject: [PATCH 24/31] update artifacts --- Artifacts.toml | 6 +++--- src/definitions.jl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 17cfac0..2724061 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,10 +1,10 @@ [CaseData] -git-tree-sha1 = "b2e5ec0a5e5dabe0d5b7864fe743f410d5e0d224" +git-tree-sha1 = "5b593e426b15da3f43a99e823041e9d06387fc3a" lazy = true [[CaseData.download]] - url = "https://github.com/NREL-SIIP/PowerSystemsTestData/archive/refs/tags/2.0-alpha.tar.gz" - sha256 = "b997642874dc3a5fc7c5b25f9270a03ef38473ea5acfd4e814e1a8ede4be9fad" + url = "https://github.com/NREL-SIIP/PowerSystemsTestData/archive/refs/tags/2.0-alpha3.tar.gz" + sha256 = "a2db32c3ad4a4b5f2191ca6d2b7fd6210b94945ca3986341133f7fc5216901f1" [rts] git-tree-sha1 = "5098f357bad765bfefcff58f080818863ca776bd" diff --git a/src/definitions.jl b/src/definitions.jl index 1ae1246..1fe2c4d 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -1,5 +1,5 @@ const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder)))) -const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0-alpha") +const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0-alpha3") const RTS_DIR = joinpath(LazyArtifacts.artifact"rts", "RTS-GMLC-0.2.2") const SYSTEM_DESCRIPTORS_FILE = joinpath(PACKAGE_DIR, "src", "system_descriptor.jl") From 7604a2e3aa3402fe1ff7e463dfa2799c78962474 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 5 Sep 2023 15:45:50 -0600 Subject: [PATCH 25/31] use prime_mover_type --- src/library/psi_library.jl | 26 +++++++++++++------------- src/library/psitest_library.jl | 26 +++++++++++++------------- src/library/psytest_library.jl | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/library/psi_library.jl b/src/library/psi_library.jl index a4b4007..d93196d 100644 --- a/src/library/psi_library.jl +++ b/src/library/psi_library.jl @@ -530,7 +530,7 @@ function make_modified_RTS_GMLC_sys(resolution::Dates.TimePeriod = Hour(1); kwar spin_reserve_R2 = PSY.get_component(PSY.VariableReserve, sys, "Spin_Up_R2") spin_reserve_R3 = PSY.get_component(PSY.VariableReserve, sys, "Spin_Up_R3") for g in PSY.get_components( - x -> PSY.get_prime_mover(x) in [PSY.PrimeMovers.CT, PSY.PrimeMovers.CC], + x -> PSY.get_prime_mover_type(x) in [PSY.PrimeMovers.CT, PSY.PrimeMovers.CC], PSY.ThermalStandard, sys, ) @@ -602,7 +602,7 @@ function make_modified_RTS_GMLC_sys(resolution::Dates.TimePeriod = Hour(1); kwar end for g in PSY.get_components( - x -> PSY.get_prime_mover(x) == PSY.PrimeMovers.PVe, + x -> PSY.get_prime_mover_type(x) == PSY.PrimeMovers.PVe, PSY.RenewableDispatch, sys, ) @@ -611,7 +611,7 @@ function make_modified_RTS_GMLC_sys(resolution::Dates.TimePeriod = Hour(1); kwar end for g in PSY.get_components( - x -> PSY.get_prime_mover(x) == PSY.PrimeMovers.PVe, + x -> PSY.get_prime_mover_type(x) == PSY.PrimeMovers.PVe, PSY.RenewableFix, sys, ) @@ -855,7 +855,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 0.40, reactive_power = 0.010, rating = 0.5, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 0.40), reactive_power_limits = (min = -0.30, max = 0.30), @@ -872,7 +872,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 1.70, reactive_power = 0.20, rating = 2.2125, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 1.70), reactive_power_limits = (min = -1.275, max = 1.275), @@ -889,7 +889,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 5.2, reactive_power = 1.00, rating = 5.2, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 5.20), reactive_power_limits = (min = -3.90, max = 3.90), @@ -906,7 +906,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 2.0, reactive_power = 0.40, rating = 2.5, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 2.0), reactive_power_limits = (min = -1.5, max = 1.5), @@ -923,7 +923,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 6.0, reactive_power = 1.50, rating = 0.75, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 6.0), reactive_power_limits = (min = -4.50, max = 4.50), @@ -940,7 +940,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 0.40, reactive_power = 0.010, rating = 0.5, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 0.40), reactive_power_limits = (min = -0.30, max = 0.30), @@ -957,7 +957,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 1.70, reactive_power = 0.20, rating = 2.2125, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 1.70), reactive_power_limits = (min = -1.275, max = 1.275), @@ -974,7 +974,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 5.2, reactive_power = 1.00, rating = 5.2, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 5.20), reactive_power_limits = (min = -3.90, max = 3.90), @@ -991,7 +991,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 2.0, reactive_power = 0.40, rating = 2.5, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 2.0), reactive_power_limits = (min = -1.5, max = 1.5), @@ -1008,7 +1008,7 @@ function build_two_zone_5_bus(; kwargs...) active_power = 6.0, reactive_power = 1.50, rating = 0.75, - prime_mover = PrimeMovers.ST, + prime_mover_type = PrimeMovers.ST, fuel = ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 6.0), reactive_power_limits = (min = -4.50, max = 4.50), diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 3b72695..6e9904d 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -2866,7 +2866,7 @@ function build_c_sys5_hybrid(; kwargs...) renewables = renewable_generators5(nodes) _battery(nodes, bus, name) = PSY.BatteryEMS(; name = name, - prime_mover = PrimeMovers.BA, + prime_mover_type = PrimeMovers.BA, available = true, bus = nodes[bus], initial_energy = 5.0, @@ -3048,7 +3048,7 @@ function build_c_sys5_hybrid_uc(; kwargs...) renewables = renewable_generators5(nodes) _battery(nodes, bus, name) = PSY.BatteryEMS(; name = name, - prime_mover = PrimeMovers.BA, + prime_mover_type = PrimeMovers.BA, available = true, bus = nodes[bus], initial_energy = 5.0, @@ -3175,7 +3175,7 @@ function build_c_sys5_hybrid_ed(; kwargs...) renewables = renewable_generators5(nodes) _battery(nodes, bus, name) = PSY.BatteryEMS(; name = name, - prime_mover = PrimeMovers.BA, + prime_mover_type = PrimeMovers.BA, available = true, bus = nodes[bus], initial_energy = 5.0, @@ -3328,7 +3328,7 @@ function build_hydro_test_case_b_sys(; kwargs...) active_power = 0.0, reactive_power = 0.0, rating = 7.0, - prime_mover = PrimeMovers.HY, + prime_mover_type = PrimeMovers.HY, active_power_limits = (min = 0.0, max = 7.0), reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), @@ -3390,7 +3390,7 @@ function build_hydro_test_case_c_sys(; kwargs...) active_power = 0.0, reactive_power = 0.0, rating = 7.0, - prime_mover = PrimeMovers.HY, + prime_mover_type = PrimeMovers.HY, active_power_limits = (min = 0.0, max = 7.0), reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), @@ -3452,7 +3452,7 @@ function build_hydro_test_case_d_sys(; kwargs...) active_power = 0.0, reactive_power = 0.0, rating = 7.0, - prime_mover = PrimeMovers.HY, + prime_mover_type = PrimeMovers.HY, active_power_limits = (min = 0.0, max = 7.0), reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), @@ -3514,7 +3514,7 @@ function build_hydro_test_case_e_sys(; kwargs...) active_power = 0.0, reactive_power = 0.0, rating = 7.0, - prime_mover = PrimeMovers.HY, + prime_mover_type = PrimeMovers.HY, active_power_limits = (min = 0.0, max = 7.0), reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), @@ -3576,7 +3576,7 @@ function build_hydro_test_case_f_sys(; kwargs...) active_power = 0.0, reactive_power = 0.0, rating = 7.0, - prime_mover = PrimeMovers.HY, + prime_mover_type = PrimeMovers.HY, active_power_limits = (min = 0.0, max = 7.0), reactive_power_limits = (min = 0.0, max = 7.0), ramp_limits = (up = 7.0, down = 7.0), @@ -3647,7 +3647,7 @@ function build_batt_test_case_b_sys(; kwargs...) batt = PSY.BatteryEMS(; name = "Bat2", - prime_mover = PrimeMovers.BA, + prime_mover_type = PrimeMovers.BA, available = true, bus = node, initial_energy = 5.0, @@ -3722,7 +3722,7 @@ function build_batt_test_case_c_sys(; kwargs...) batt = PSY.BatteryEMS(; name = "Bat2", - prime_mover = PrimeMovers.BA, + prime_mover_type = PrimeMovers.BA, available = true, bus = node, initial_energy = 2.0, @@ -3797,7 +3797,7 @@ function build_batt_test_case_d_sys(; kwargs...) batt = PSY.BatteryEMS(; name = "Bat2", - prime_mover = PrimeMovers.BA, + prime_mover_type = PrimeMovers.BA, available = true, bus = node, initial_energy = 2.0, @@ -3872,7 +3872,7 @@ function build_batt_test_case_e_sys(; kwargs...) batt = PSY.BatteryEMS(; name = "Bat2", - prime_mover = PrimeMovers.BA, + prime_mover_type = PrimeMovers.BA, available = true, bus = node, initial_energy = 2.0, @@ -3947,7 +3947,7 @@ function build_batt_test_case_f_sys(; kwargs...) batt = PSY.BatteryEMS(; name = "Bat2", - prime_mover = PrimeMovers.BA, + prime_mover_type = PrimeMovers.BA, available = true, bus = node, initial_energy = 1.0, diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index 6d7ac62..92cd876 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -181,7 +181,7 @@ function build_dynamic_inverter_sys(; kwargs...) battery = PSY.GenericBattery(; name = "Battery", - prime_mover = PSY.PrimeMovers.BA, + prime_mover_type = PSY.PrimeMovers.BA, available = true, bus = nodes_OMIB[2], initial_energy = 5.0, From 0efce09c117babccf024210c56bad1c5acbc1741 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 5 Sep 2023 16:03:51 -0600 Subject: [PATCH 26/31] fix prime_mover --- src/library/psitest_library.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 6e9904d..80c2330 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -988,7 +988,7 @@ function build_sys_ramp_testing(; kwargs...) active_power = 0.20, # Active power reactive_power = 0.010, rating = 0.5, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.0, max = 0.40), reactive_power_limits = nothing, @@ -1005,7 +1005,7 @@ function build_sys_ramp_testing(; kwargs...) active_power = 0.70, # Active Power reactive_power = 0.20, rating = 2.0, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.7, max = 2.20), reactive_power_limits = nothing, @@ -2275,7 +2275,7 @@ function build_sos_test_sys(; kwargs...) active_power = 0.52, reactive_power = 0.010, rating = 0.5, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.22, max = 0.55), reactive_power_limits = nothing, @@ -2297,7 +2297,7 @@ function build_sos_test_sys(; kwargs...) active_power = 0.62, reactive_power = 0.20, rating = 2.2125, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.62, max = 1.55), reactive_power_limits = nothing, @@ -2368,7 +2368,7 @@ function build_pwl_test_sys(; kwargs...) active_power = 0.52, reactive_power = 0.010, rating = 0.5, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.22, max = 0.55), reactive_power_limits = nothing, @@ -2390,7 +2390,7 @@ function build_pwl_test_sys(; kwargs...) active_power = 0.62, reactive_power = 0.20, rating = 221.25, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.62, max = 1.55), reactive_power_limits = nothing, @@ -2443,7 +2443,7 @@ function build_duration_test_sys(; kwargs...) active_power = 0.40, reactive_power = 0.010, rating = 0.5, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.3, max = 0.9), reactive_power_limits = nothing, @@ -2461,7 +2461,7 @@ function build_duration_test_sys(; kwargs...) active_power = 1.70, reactive_power = 0.20, rating = 2.2125, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.7, max = 2.2), reactive_power_limits = nothing, @@ -2500,7 +2500,7 @@ function build_pwl_marketbid_sys(; kwargs...) active_power = 0.52, reactive_power = 0.010, rating = 0.5, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.22, max = 0.55), reactive_power_limits = nothing, @@ -2521,7 +2521,7 @@ function build_pwl_marketbid_sys(; kwargs...) active_power = 0.05, reactive_power = 0.010, rating = 0.12, - prime_mover = PSY.PrimeMovers.ST, + prime_mover_type = PSY.PrimeMovers.ST, fuel = PSY.ThermalFuels.COAL, active_power_limits = (min = 0.05, max = 0.12), reactive_power_limits = (min = -0.30, max = 0.30), From c8e3c3ff80de6edcec72b4ff7b8ff48cf8c0b799 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 5 Sep 2023 19:58:48 -0600 Subject: [PATCH 27/31] code clean up --- src/library/psitest_library.jl | 20 ++++++++++++++++---- src/system_descriptor_data.jl | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 80c2330..a143aa1 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -919,7 +919,7 @@ function build_c_sys5_reg(; kwargs...) area = PSY.Area("1") PSY.add_component!(c_sys5_reg, area) [PSY.set_area!(b, area) for b in PSY.get_components(PSY.ACBus, c_sys5_reg)] - AGC_service = PSY.AGC( + AGC_service = PSY.AGC(; name = "AGC_Area1", available = true, bias = 739.0, @@ -1068,13 +1068,25 @@ function build_sys_10bus_ac_dc(; kwargs...) for l in loads if occursin("nodeB", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusB_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) + PSY.add_time_series!( + sys, + l, + Deterministic("max_active_power", data, resolution), + ) elseif occursin("nodeC", PSY.get_name(l)) data = Dict(DateTime("2020-01-01T00:00:00") => loadbusC_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) + PSY.add_time_series!( + sys, + l, + Deterministic("max_active_power", data, resolution), + ) else data = Dict(DateTime("2020-01-01T00:00:00") => loadbusD_ts_DA) - PSY.add_time_series!(sys, l, Deterministic("max_active_power", data, resolution)) + PSY.add_time_series!( + sys, + l, + Deterministic("max_active_power", data, resolution), + ) end end diff --git a/src/system_descriptor_data.jl b/src/system_descriptor_data.jl index 19f6992..0a959f0 100644 --- a/src/system_descriptor_data.jl +++ b/src/system_descriptor_data.jl @@ -195,14 +195,14 @@ const SYSTEM_CATALOG = [ raw_data = joinpath(DATA_DIR, "psy_data", "data_5bus_pu.jl"), build_function = build_c_sys5_reg, ), - SystemDescriptor( + SystemDescriptor(; name = "sys10_pjm_ac_dc", description = "10-bus system (duplicate 5-bus PJM) with 4-DC bus system", category = PSISystems, raw_data = joinpath(DATA_DIR, "psy_data", "data_10bus_ac_dc_pu.jl"), build_function = build_sys_10bus_ac_dc, ), - SystemDescriptor( + SystemDescriptor(; name = "c_ramp_test", description = "1-bus for ramp testing", category = PSITestSystems, From 213bdc73c5659d65eb08a4862d527479c84b870d Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 5 Sep 2023 22:03:17 -0600 Subject: [PATCH 28/31] use ACBuses --- src/library/psi_library.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/library/psi_library.jl b/src/library/psi_library.jl index d93196d..80da57b 100644 --- a/src/library/psi_library.jl +++ b/src/library/psi_library.jl @@ -674,16 +674,16 @@ function build_two_zone_5_bus(; kwargs...) # Buses nodes10() = [ - Bus(1, "nodeA", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(2, "nodeB", "PQ", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(3, "nodeC", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(4, "nodeD", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(5, "nodeE", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(6, "nodeA2", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(7, "nodeB2", "PQ", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(8, "nodeC2", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(9, "nodeD2", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), - Bus(10, "nodeE2", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(1, "nodeA", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(2, "nodeB", "PQ", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(3, "nodeC", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(4, "nodeD", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(5, "nodeE", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(6, "nodeA2", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(7, "nodeB2", "PQ", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(8, "nodeC2", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(9, "nodeD2", "REF", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), + ACBus(10, "nodeE2", "PV", 0, 1.0, (min = 0.9, max = 1.05), 230, nothing, nothing), ] # Lines From a4e68d3b73d57db3653776a8da9437a9f40a3473 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 6 Sep 2023 00:35:43 -0600 Subject: [PATCH 29/31] one more fix --- src/library/psi_library.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/psi_library.jl b/src/library/psi_library.jl index 80da57b..ff93d8b 100644 --- a/src/library/psi_library.jl +++ b/src/library/psi_library.jl @@ -832,7 +832,7 @@ function build_two_zone_5_bus(; kwargs...) 2.00, (min = -0.7, max = 0.7), ), - HVDCLine( + TwoTerminalHVDCLine( "nodeC-nodeC2", true, 0.0, From fb3d98789b3a70abd3e092020d8ab41a15a2617e Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 6 Sep 2023 09:46:22 -0600 Subject: [PATCH 30/31] bump versions --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index a91a5f4..0dfcaae 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PowerSystemCaseBuilder" uuid = "f00506e0-b84f-492a-93c2-c0a9afc4364e" authors = ["Sourabh Dalvi", "Jose Daniel Lara"] -version = "1.1.0" +version = "1.2.0" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" @@ -23,7 +23,7 @@ DataFrames = "1" DataStructures = "~0.18" HDF5 = "0.16" InfrastructureSystems = "^1.21" -PowerSystems = "2" +PowerSystems = "3" PrettyTables = "2" TimeSeries = "~0.22, 0.23" julia = "^1.6" From 22662bebdd13da804b512a002523dc1b9ef8d9c3 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Mon, 11 Sep 2023 20:47:08 -0600 Subject: [PATCH 31/31] update reference to testdata --- Artifacts.toml | 6 +++--- src/definitions.jl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 2724061..802bda2 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,10 +1,10 @@ [CaseData] -git-tree-sha1 = "5b593e426b15da3f43a99e823041e9d06387fc3a" +git-tree-sha1 = "2b7013812a985ce5884696ce276ca17b2719a57a" lazy = true [[CaseData.download]] - url = "https://github.com/NREL-SIIP/PowerSystemsTestData/archive/refs/tags/2.0-alpha3.tar.gz" - sha256 = "a2db32c3ad4a4b5f2191ca6d2b7fd6210b94945ca3986341133f7fc5216901f1" + url = "https://github.com/NREL-Sienna/PowerSystemsTestData/archive/refs/tags/2.0.tar.gz" + sha256 = "cb15bf019cc1a187e430d4fe0db9c000decf07dc2cdccc6c1b53b07b136fa41c" [rts] git-tree-sha1 = "5098f357bad765bfefcff58f080818863ca776bd" diff --git a/src/definitions.jl b/src/definitions.jl index 1fe2c4d..7f554a4 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -1,5 +1,5 @@ const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder)))) -const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0-alpha3") +const DATA_DIR = joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-2.0") const RTS_DIR = joinpath(LazyArtifacts.artifact"rts", "RTS-GMLC-0.2.2") const SYSTEM_DESCRIPTORS_FILE = joinpath(PACKAGE_DIR, "src", "system_descriptor.jl")