Skip to content
Snippets Groups Projects
Commit 1a7b3d93 authored by Julian Stürmer's avatar Julian Stürmer
Browse files

Fix AC power flow test

parent ce9b2a7e
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@
#* PowerModels.jl (PM) agrees with the PowerWold Simulator (PWS) solution
#*------------------------------------------------------------------------------
using Test
using ITCPG
using JLD2
......@@ -17,7 +16,7 @@ using DataFrames
ndd_ac = load(
joinpath(
@__DIR__,
"../applications/Texas/Results/ACPF/Texas_init_acpf_simplified.jld2"
"../applications/Texas/Results/ACPF/Texas_init_acpf.jld2"
), "network_data"
)
......@@ -61,8 +60,28 @@ for (i, br) in enumerate(eachrow(BranchData))
ndd_ac["branch"]
)[1]
end
PM_bl[i] = ndd_ac["branch"][br_id]["MVA-loading"]
### Assign flows according to branch activities
if ndd_ac["branch"][br_id]["br_status"] == 0 # branch is inactive
PM_bl[i] = 0.0
else # branch is active
PM_bl[i] = ndd_ac["branch"][br_id]["MVA-loading"]
end
end
@test isapprox(PM_bl, PWS_bl, atol=.0001)
# PM_bl
# PWS_bl
# diff = PM_bl - PWS_bl
# minimum(diff)
# findall(i -> isnan(i) == true, diff)
# ndd_ac["branch"]["57"]
# diff[57]
# PWS_bl[57]
# PM_bl[57]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment