Skip to content

Commit

Permalink
debugging gmd_pf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bluejuniper committed Sep 30, 2024
1 parent fe6afbf commit 5b492e7
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 63 deletions.
2 changes: 1 addition & 1 deletion test/data/matpower/epri21.m
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
90 changes: 45 additions & 45 deletions test/gmd_pf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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



Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
30 changes: 15 additions & 15 deletions test/test_cases.jl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 5b492e7

Please sign in to comment.