From 5b492e70b14906453d906d6dfc7bd75e00784f5c Mon Sep 17 00:00:00 2001 From: Art Barnes Date: Mon, 30 Sep 2024 10:33:46 -0600 Subject: [PATCH] debugging gmd_pf tests --- test/data/matpower/epri21.m | 2 +- .../B4GIC_Slack_Only_Bus_1Vkm.csv | 1 + .../B4GIC_Slack_Only_GICXformer_1Vkm.csv | 1 + .../EpriCase_Mar2012_Bus_1Vkm.csv | 1 + .../EpriCase_Mar2012_GICXformer_1Vkm.csv | 1 + test/gmd_pf.jl | 90 +++++++++---------- test/runtests.jl | 4 +- test/test_cases.jl | 30 +++---- 8 files changed, 67 insertions(+), 63 deletions(-) diff --git a/test/data/matpower/epri21.m b/test/data/matpower/epri21.m index 32745d2..214114e 100644 --- a/test/data/matpower/epri21.m +++ b/test/data/matpower/epri21.m @@ -135,7 +135,7 @@ }; %% gmd_branch data -%column_names% f_bus t_bus parent_index parent_type parent_index br_status br_r br_v len_km name +%column_names% f_bus t_bus parent_type parent_index br_status br_r br_v len_km name mpc.gmd_branch = { 10 11 'branch' 1 1 1.1704125 120.60003474069319 120.81939273462899 'dc_br1' 12 13 'branch' 2 1 0.7833333333333333 131.6938150979946 161.49436872495582 'dc_br2' diff --git a/test/data/pw_csv/verification/B4GIC_Slack_Only_Bus_1Vkm.csv b/test/data/pw_csv/verification/B4GIC_Slack_Only_Bus_1Vkm.csv index 2e2db77..4d90bbb 100644 --- a/test/data/pw_csv/verification/B4GIC_Slack_Only_Bus_1Vkm.csv +++ b/test/data/pw_csv/verification/B4GIC_Slack_Only_Bus_1Vkm.csv @@ -1,3 +1,4 @@ +Bus Number,Name,AreaName,NomkV,Vpu,kV,Vangle,LoadMW,LoadMvar,GenMW,GenMvar,ShuntMvar,ActG,ActB,AreaNumber,ZoneNumber 1,Bus 1,Home,765.00,0.93431,714.746,-8.52,,,,,,0.00,0.00,1,1 2,Bus 2,Home,765.00,0.97814,748.278,-2.33,,,,,,0.00,0.00,1,1 diff --git a/test/data/pw_csv/verification/B4GIC_Slack_Only_GICXformer_1Vkm.csv b/test/data/pw_csv/verification/B4GIC_Slack_Only_GICXformer_1Vkm.csv index 5553c38..0fa4662 100644 --- a/test/data/pw_csv/verification/B4GIC_Slack_Only_GICXformer_1Vkm.csv +++ b/test/data/pw_csv/verification/B4GIC_Slack_Only_GICXformer_1Vkm.csv @@ -1,3 +1,4 @@ +GICXFormer BusNum3W,BusNum3W:1,LineCircuit,GICXFIEffective1,GICXFIEffective1PU,GICXFIBasePeak,GICXFMVABase,GICQLosses,GICXFNeutralR,GICXFCoilR1,GICXFCoilR1:1,XFConfiguration,XFConfiguration:1,GICXFConfigUsed,XFIsAutoXF,GICModelParam,GICModelParam:1,GICModelParam:2,GICModelKUsed,GICModelKUsed:1,GICModelKUsed:2,GICLineDCFlow,GICLineDCFlow:1 1,3,1,35.674,0.334,106.732,100.000,56.096,0.000,0.293,,Gwye,Delta,GWye-Delta,No,0.000,0.000,1.796,2,0.000,1.796,-35.674,0.000 2,4,1,35.674,0.334,106.732,100.000,58.727,0.000,0.293,,Gwye,Delta,GWye-Delta,No,0.000,0.000,1.796,2,0.000,1.796,35.674,0.000 diff --git a/test/data/pw_csv/verification/EpriCase_Mar2012_Bus_1Vkm.csv b/test/data/pw_csv/verification/EpriCase_Mar2012_Bus_1Vkm.csv index 8c99198..2da0701 100644 --- a/test/data/pw_csv/verification/EpriCase_Mar2012_Bus_1Vkm.csv +++ b/test/data/pw_csv/verification/EpriCase_Mar2012_Bus_1Vkm.csv @@ -1,3 +1,4 @@ +Bus Number,Name,SubNumber,AreaName,NomkV,Vpu,kV,Vangle,LoadMW,LoadMvar,GenMW,GenMvar,ShuntMvar,ActG,ActB,AreaNumber,ZoneNumber 1,1,1,1,22.00,1.05000,23.100,-2.09,,,776.83,95.93,,0.00,0.00,1,1 2,2,1,1,345.00,1.04112,359.185,-7.79,,,,,,0.00,0.00,1,1 diff --git a/test/data/pw_csv/verification/EpriCase_Mar2012_GICXformer_1Vkm.csv b/test/data/pw_csv/verification/EpriCase_Mar2012_GICXformer_1Vkm.csv index ed6e379..58202ce 100644 --- a/test/data/pw_csv/verification/EpriCase_Mar2012_GICXformer_1Vkm.csv +++ b/test/data/pw_csv/verification/EpriCase_Mar2012_GICXformer_1Vkm.csv @@ -1,3 +1,4 @@ +GICXFormer BusNum3W,BusNum3W:1,LineCircuit,GICXFIEffective1,GICXFIEffective1PU,GICXFIBasePeak,GICXFMVABase,GICQLosses,GICXFNeutralR,GICXFCoilR1,GICXFCoilR1:1,XFConfiguration,XFConfiguration:1,GICXFConfigUsed,XFIsAutoXF,GICModelParam,GICModelParam:1,GICModelParam:2,GICModelKUsed,GICModelKUsed:1,GICModelKUsed:2,GICLineDCFlow,GICLineDCFlow:1 2,1,1,0.000,0.000,236.666,100.000,0.000,0.000,0.100,0.001,Wye,Delta,Wye-Delta,No,1.183,0.000,1.183,1,0.000,1.183,0.000,0.000 4,3,2,10.518,0.064,163.299,100.000,10.998,0.000,0.200,0.100,Gwye,Gwye,GWye-GWye,No,1.633,0.000,1.633,2,0.000,1.633,-6.942,-5.183 diff --git a/test/gmd_pf.jl b/test/gmd_pf.jl index c72d7e8..5621daa 100644 --- a/test/gmd_pf.jl +++ b/test/gmd_pf.jl @@ -4,21 +4,21 @@ @testset "EPRI21 case" begin case_epri21 = _PM.parse_file(data_epri21) - case_epri21_verification_data = CSV.File(data_epri21_verification) - epri21_vm = CSV.File(data_epri21_vm) + case_epri21_verification_data = CSV.File(data_epri21_verification, header=2) + epri21_vm = CSV.File(data_epri21_vm, header=2) # Lock in voltage magnitudes to be what the powerworld verification data suggests - for row in epri21_vm - i = row[:Number] - vm = row[:Vpu] + # for row in epri21_vm + # i = row.Number + # vm = row.Vpu - case_epri21["bus"][string(i)]["vm"] = vm + # case_epri21["bus"]["$i"]["vm"] = vm - if (i == 2) - case_epri21["bus"][string(i)]["vmin"] = vm - .03 - case_epri21["bus"][string(i)]["vmax"] = vm + .03 - end - end + # if i == 2 + # case_epri21["bus"]["$i"]["vmin"] = vm - 0.03 + # case_epri21["bus"]["$i"]["vmax"] = vm + 0.03 + # end + # end local_setting = Dict{String,Any}("bound_voltage" => true) merge!(local_setting, setting) @@ -59,20 +59,20 @@ @testset "B4GIC case" begin case_b4gic = _PM.parse_file(data_b4gic) - case_b4gic_verification_data = CSV.File(data_b4gic_verification) - b4gic_vm = CSV.File(data_b4gic_vm) + case_b4gic_verification_data = CSV.File(data_b4gic_verification, header=2) + b4gic_vm = CSV.File(data_b4gic_vm, header=2) # Lock in voltage magnitudes to be what the powerworld verification data suggests - for row in b4gic_vm - i = row[:Number] - vm = row[:Vpu] - - if (i == 1 || i == 2) - case_b4gic["bus"][string(i)]["vmin"] = vm - .0001 - case_b4gic["bus"][string(i)]["vmax"] = vm + .0001 - case_b4gic["bus"][string(i)]["vm"] = vm - end - end + # for row in b4gic_vm + # i = row[:Number] + # vm = row[:Vpu] + + # if (i == 1 || i == 2) + # case_b4gic["bus"]["$i"]["vmin"] = vm - 0.0001 + # case_b4gic["bus"]["$i"]["vmax"] = vm + 0.0001 + # case_b4gic["bus"]["$i"]["vm"] = vm + # end + # end local_setting = Dict{String,Any}("bound_voltage" => true) merge!(local_setting, setting) @@ -107,19 +107,19 @@ @testset "B4GIC case decoupled" begin case_b4gic = _PM.parse_file(data_b4gic) - case_b4gic_verification_data = CSV.File(data_b4gic_verification) - b4gic_vm = CSV.File(data_b4gic_vm) + case_b4gic_verification_data = CSV.File(data_b4gic_verification, header=2) + b4gic_vm = CSV.File(data_b4gic_vm, header=2) # Lock in voltage magnitudes to be what the powerworld verification data suggests - for row in b4gic_vm - i = row[:Number] - vm = row[:Vpu] - if (i == 1 || i == 2) - case_b4gic["bus"][string(i)]["vmin"] = vm - .0001 - case_b4gic["bus"][string(i)]["vmax"] = vm + .0001 - case_b4gic["bus"][string(i)]["vm"] = vm - end - end + # for row in b4gic_vm + # i = row[:Number] + # vm = row[:Vpu] + # if (i == 1 || i == 2) + # case_b4gic["bus"]["$i"]["vmin"] = vm - 0.0001 + # case_b4gic["bus"]["$i"]["vmax"] = vm + 0.0001 + # case_b4gic["bus"]["$i"]["vm"] = vm + # end + # end @@ -156,21 +156,21 @@ @testset "EPRI 21 case decoupled" begin case_epri21 = _PM.parse_file(data_epri21) - case_epri21_verification_data = CSV.File(data_epri21_verification) - epri21_vm = CSV.File(data_epri21_vm) + case_epri21_verification_data = CSV.File(data_epri21_verification, header=2) + epri21_vm = CSV.File(data_epri21_vm, header=2) # Lock in voltage magnitudes to be what the powerworld verification data suggests - for row in epri21_vm - i = row[:Number] - vm = row[:Vpu] + # for row in epri21_vm + # i = row[:Number] + # vm = row[:Vpu] - case_epri21["bus"][string(i)]["vm"] = vm + # case_epri21["bus"]["$i"]["vm"] = vm - if (i == 2) - case_epri21["bus"][string(i)]["vmin"] = vm - .03 - case_epri21["bus"][string(i)]["vmax"] = vm + .03 - end - end + # if (i == 2) + # case_epri21["bus"]["$i"]["vmin"] = vm - 0.03 + # case_epri21["bus"]["$i"]["vmax"] = vm + 0.03 + # end + # end local_setting = Dict{String,Any}("bound_voltage" => true) merge!(local_setting, setting) diff --git a/test/runtests.jl b/test/runtests.jl index 2702e48..20b5042 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -41,9 +41,9 @@ include("test_cases.jl") # Perform automated testing of PMsGMD problem specifications: @testset "PowerModelsGMD" begin # include("ac_data.jl") - include("gmd.jl") # currently breaking + include("gmd.jl") # include("gmd_pf.jl") - # include("gmd_opf.jl") + include("gmd_opf.jl") # include("gmd_mld.jl") # include("gmd_ots.jl") # include("gmd_blocker.jl") diff --git a/test/test_cases.jl b/test/test_cases.jl index 55e03db..339403b 100644 --- a/test/test_cases.jl +++ b/test/test_cases.jl @@ -1,24 +1,24 @@ # # Parse test cases: -# data_b4gic = "../test/data/matpower/b4gic.m" -# # data_b4gic3w = "../test/data/pti/b4gic3w.raw" -# data_b6gic_nerc = "../test/data/matpower/b6gic_nerc.m" -# data_epri21 = "../test/data/matpower/epri21.m" -# data_ieee_rts_0 = "../test/data/matpower/ieee_rts_0.m" -# data_otstest = "../test/data/matpower/ots_test.m" -# data_b4gic_ne_blocker = "../test/data/matpower/b4gic_ne_blocker.m" -# data_epri21_ne_blocker = "../test/data/matpower/epri21_ne_blocker.m" -# data_b4gic_15kvm_contingency = "../test/data/matpower/b4gic_15kvm_contingency.m" -# data_epri21_15kvm_contingency = "../test/data/matpower/epri21_15kvm_contingency.m" -# # data_uiuc_150bus = "../test/data/pti/uiuc-150bus.raw" -# # data_uiuc_150bus_contigency_mods = "../test/data/suppl/uiuc-150bus_15kvm_contigency_mods.json" -# data_blocker_test = "../test/data/matpower/blocker_test.m" +data_b4gic = "../test/data/matpower/b4gic.m" +# data_b4gic3w = "../test/data/pti/b4gic3w.raw" +data_b6gic_nerc = "../test/data/matpower/b6gic_nerc.m" +data_epri21 = "../test/data/matpower/epri21.m" +data_ieee_rts_0 = "../test/data/matpower/ieee_rts_0.m" +data_otstest = "../test/data/matpower/ots_test.m" +data_b4gic_ne_blocker = "../test/data/matpower/b4gic_ne_blocker.m" +data_epri21_ne_blocker = "../test/data/matpower/epri21_ne_blocker.m" +data_b4gic_15kvm_contingency = "../test/data/matpower/b4gic_15kvm_contingency.m" +data_epri21_15kvm_contingency = "../test/data/matpower/epri21_15kvm_contingency.m" +# data_uiuc_150bus = "../test/data/pti/uiuc-150bus.raw" +# data_uiuc_150bus_contigency_mods = "../test/data/suppl/uiuc-150bus_15kvm_contigency_mods.json" +data_blocker_test = "../test/data/matpower/blocker_test.m" data_b4gic_verification = "../test/data/pw_csv/verification/B4GIC_Slack_Only_GICXformer_1Vkm.csv" data_epri21_verification = "../test/data/pw_csv/verification/EpriCase_Mar2012_GICXformer_1Vkm.csv" -# data_b4gic_vm = "../test/data/verification/B4GIC_Slack_Only_Bus_1Vkm.csv" -# data_epri21_vm = "../test/data/verification/EpriCase_Mar2012_Bus_1Vkm.csv" +data_b4gic_vm = "../test/data/pw_csv/verification/B4GIC_Slack_Only_Bus_1Vkm.csv" +data_epri21_vm = "../test/data/pw_csv/verification/EpriCase_Mar2012_Bus_1Vkm.csv" b4gic_default = "../test/data/matpower/b4gic.m" b4gic_offbase = "../test/data/matpower/b4gic_offbase.m" autotransformer = "../test/data/matpower/autotransformer.m"