Solution Without Kron Reduction #384
Unanswered
dsigler1234
asked this question in
Q&A
Replies: 1 comment
-
If you want to work with non-Kron reduced data, you will need to use one of the Explicit Neutral formulations, such as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I was wondering if I can solve the ACRUPowerModel or ACPUPowerModel formulations without doing the kron reduction? I put together the small example below that fails with the error below. I was wondering if there was a way to do this?
Thanks,
Devon
import JuMP
import PowerModelsDistribution
const PMD = PowerModelsDistribution
import Ipopt
case_file = "../test/data/opendss/case3_balanced.dss"
data_eng = PMD.parse_file(
case_file,
);
data_math = PMD.transform_data_model(data_eng, multinetwork=false,kron_reduce =false);
pm = PMD.instantiate_mc_model(data_math, PMD.ACRUPowerModel, PMD.build_mc_opf);
res = PMD.optimize_model!(pm, optimizer=Ipopt.Optimizer)
ERROR: LoadError: BoundsError: attempt to access 3-element Vector{Float64} at index [4]
Stacktrace:
[1] getindex(A::Vector{Float64}, i1::Int64)
@ Base ./array.jl:801
[2] comp_start_value(comp::Dict{String, Any}, keys::Vector{String}, conductor::Int64, default::Float64)
@ PowerModelsDistribution ~/PowerModelsDistribution.jl/src/core/base.jl:165
[3] (::PowerModelsDistribution.var"#437#440"{Int64, Int64, ACPUPowerModel})(c::Int64)
@ PowerModelsDistribution ~/.julia/packages/JuMP/lnUbA/src/Containers/macro.jl:309
[4] #39
@ ~/.julia/packages/JuMP/lnUbA/src/Containers/container.jl:105 [inlined]
[5] iterate
@ ./generator.jl:47 [inlined]
[6] collect_to!
@ ./array.jl:724 [inlined]
[7] collect_to_with_first!(dest::Vector{JuMP.VariableRef}, v1::JuMP.VariableRef, itr::Base.Generator{JuMP.Containers.VectorizedProductIterator{Tuple{Vector{Int64}}}, JuMP.Containers.var"#39#40"{PowerModelsDistribution.var"#437#440"{Int64, Int64, ACPUPowerModel}}}, st::Tuple{Tuple{Int64, Int64}})
@ Base ./array.jl:702
[8] collect(itr::Base.Generator{JuMP.Containers.VectorizedProductIterator{Tuple{Vector{Int64}}}, JuMP.Containers.var"#39#40"{PowerModelsDistribution.var"#437#440"{Int64, Int64, ACPUPowerModel}}})
@ Base ./array.jl:683
[9] map
@ ./abstractarray.jl:2323 [inlined]
[10] container
@ ~/.julia/packages/JuMP/lnUbA/src/Containers/container.jl:105 [inlined]
[11] container
@ ~/.julia/packages/JuMP/lnUbA/src/Containers/container.jl:66 [inlined]
[12] #436
@ ~/PowerModelsDistribution.jl/src/core/variable.jl:793 [inlined]
[13] iterate
@ ./generator.jl:47 [inlined]
[14] _all(f::Base.var"#282#284", itr::Base.Generator{Base.KeySet{Int64, Dict{Int64, Any}}, PowerModelsDistribution.var"#436#439"{Int64, ACPUPowerModel, Dict{Int64, Vector{Int64}}}}, #unused#::Colon)
@ Base ./reduce.jl:922
[15] all
@ ./reduce.jl:918 [inlined]
[16] Dict(kv::Base.Generator{Base.KeySet{Int64, Dict{Int64, Any}}, PowerModelsDistribution.var"#436#439"{Int64, ACPUPowerModel, Dict{Int64, Vector{Int64}}}})
@ Base ./dict.jl:131
[17] variable_mc_generator_power_real(pm::ACPUPowerModel; nw::Int64, bounded::Bool, report::Bool)
@ PowerModelsDistribution ~/PowerModelsDistribution.jl/src/core/variable.jl:793
[18] #variable_mc_generator_power#433
@ ~/PowerModelsDistribution.jl/src/core/variable.jl:785 [inlined]
[19] variable_mc_generator_power
@ ~/PowerModelsDistribution.jl/src/core/variable.jl:785 [inlined]
[20] build_mc_opf(pm::ACPUPowerModel)
@ PowerModelsDistribution ~/PowerModelsDistribution.jl/src/prob/opf.jl:43
[21] instantiate_model(data::Dict{String, Any}, model_type::Type, build_method::typeof(build_mc_opf), ref_add_core!::typeof(ref_add_core!), global_keys::Set{String}, it::Symbol; ref_extensions::Vector{Function}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ InfrastructureModels ~/.julia/packages/InfrastructureModels/zufh0/src/core/base.jl:370
[22] instantiate_mc_model(data::Dict{String, Any}, model_type::Type, build_method::typeof(build_mc_opf); ref_extensions::Vector{Function}, multinetwork::Bool, global_keys::Set{String}, eng2math_extensions::Vector{Function}, eng2math_passthrough::Dict{String, Vector{String}}, make_pu_extensions::Vector{Function}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ PowerModelsDistribution ~/PowerModelsDistribution.jl/src/prob/common.jl:119
[23] instantiate_mc_model(data::Dict{String, Any}, model_type::Type, build_method::Function)
@ PowerModelsDistribution ~/PowerModelsDistribution.jl/src/prob/common.jl:107
[24] top-level scope
@ ~/PowerModelsDistribution.jl/examples/kron_issue.jl:15
[25] include
@ ./client.jl:444 [inlined]
[26] top-level scope
@ ./timing.jl:210 [inlined]
[27] top-level scope
@ ./REPL[10]:0
in expression starting at /Users/dsigler/PowerModelsDistribution.jl/examples/kron_issue.jl:15
Beta Was this translation helpful? Give feedback.
All reactions