Skip to content

Commit

Permalink
FIX: switch admittance adjustment
Browse files Browse the repository at this point in the history
Bug introduced in e5f18cc which seems to only affect numerics on windows/linux, but was incorrectly using _admittance_conversion instead of just multiplying by length
  • Loading branch information
pseudocubic committed Sep 18, 2024
1 parent be33c20 commit f8325ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
10 changes: 2 additions & 8 deletions src/data_model/transformations/dss2eng.jl
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,9 @@ function _dss2eng_line!(data_eng::Dict{String,<:Any}, data_dss::OpenDssDataModel
delete!(eng_obj, "linecode")

# ENGINEERING model switches are zero-length objects
for k in ["b_fr", "b_to", "g_fr", "g_to"]
for k in ["b_fr", "b_to", "g_fr", "g_to", "rs", "xs"]
if haskey(eng_obj, k)
_admittance_conversion(data_eng, eng_obj, k)
end
end

for k in ["rs", "xs"]
if haskey(eng_obj, k)
eng_obj[k] = _impedance_conversion(data_eng, eng_obj, k)
eng_obj[k] .*= get(eng_obj, length, 1.0)
end
end
delete!(eng_obj, "length")
Expand Down
4 changes: 2 additions & 2 deletions test/multinetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
@testset "solve_mc_opf_oltc" begin
result_mn = PowerModelsDistribution.solve_mn_mc_opf_oltc(IEEE13_Feeder_engr, ACPUPowerModel, ipopt_solver)
@test result_mn["termination_status"] == LOCALLY_SOLVED

@test all(isapprox.(result_mn["solution"]["nw"]["1"]["voltage_source"]["source"]["pg"], [738.58786, 788.38272, 787.79729]; atol=1e-5))
@test all(isapprox.(result_mn["solution"]["nw"]["1"]["voltage_source"]["source"]["qg"], [237.68517, 209.61208, 266.77223]; atol=1e-5))
@test all(isapprox.(result_mn["solution"]["nw"]["8"]["voltage_source"]["source"]["pg"], [847.77707, 889.87745, 918.34146]; atol=1e-5))
@test all(isapprox.(result_mn["solution"]["nw"]["8"]["voltage_source"]["source"]["qg"], [284.46267, 227.28860, 292.33564]; atol=1e-5))

@test all(isapprox.(result_mn["solution"]["nw"]["1"]["transformer"]["reg1"]["tap"][2], [1.02358, 1.01724, 1.02169]; atol=1e-5))
@test all(isapprox.(result_mn["solution"]["nw"]["8"]["transformer"]["reg1"]["tap"][2], [1.02719, 1.01984, 1.02414]; atol=1e-5))
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_cases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ test_trans_dy = parse_file("../test/data/en_validation_case_data/test_trans_dy.d
dist_transformer = parse_file("../test/data/opendss/dist_transformer.dss")

# IEEE13 Feeder
IEEE13_Feeder_engr = parse_file("../test/data/opendss/ieee13_feeder.dss", multinetwork=true,
time_series="daily", transformations=[remove_line_limits!, remove_transformer_limits!])
IEEE13_Feeder_engr = parse_file("../test/data/opendss/ieee13_feeder.dss", multinetwork=true,
time_series="daily", transformations=[remove_line_limits!, remove_transformer_limits!])

0 comments on commit f8325ca

Please sign in to comment.