kersulis / PowerModels.jl

A Julia/JuMP Package for Power Network Optimization
Other
1 stars 0 forks source link

SDP OPF case3375wp_k Exception #6

Open kersulis opened 6 years ago

kersulis commented 6 years ago

Stacktrace when attempting to run build_generic_model(<case3375_path>, SDPDecompPowerModel, PowerModels.post_opf):

Base.LinAlg.PosDefException(3374)
Stacktrace:
[1] #cholfact!#8(::Float64, ::Function, ::Base.SparseArrays.CHOLMOD.Factor{Float64}, ::Base.SparseArrays.CHOLMOD.Sparse{Float64}) at ./sparse/cholmod.jl:1360
[2] (::Base.LinAlg.#kw##cholfact!)(::Array{Any,1}, ::Base.LinAlg.#cholfact!, ::Base.SparseArrays.CHOLMOD.Factor{Float64}, ::Base.SparseArrays.CHOLMOD.Sparse{Float64}) at ./<missing>:0
[3] #cholfact#10(::Float64, ::Array{Int64,1}, ::Function, ::Base.SparseArrays.CHOLMOD.Sparse{Float64}) at ./sparse/cholmod.jl:1398
[4] #cholfact#11(::Array{Any,1}, ::Function, ::Hermitian{Int64,SparseMatrixCSC{Int64,Int64}}) at ./sparse/cholmod.jl:1438
[5] cholfact(::Hermitian{Int64,SparseMatrixCSC{Int64,Int64}}) at ./sparse/cholmod.jl:1438
[6] chordal_extension(::PowerModels.GenericPowerModel{PowerModels.SDPDecompForm}, ::Int64) at /Users/cjc/.julia/v0.6/PowerModels/src/form/wrm.jl:278
kersulis commented 6 years ago

Sure enough, the graph is not connected:

using LightGraphs, PowerModels
PMs = PowerModels
path = # <path to case3375>
pm = build_generic_model(path, ACPPowerModel, PMs.post_opf)
A, lookup_index = PMs.adjacency_matrix(pm)
G = Graph(A)
is_connected(G) # prints false
kersulis commented 6 years ago

Looks like bus 10287 is all by itself:

julia> connected_components(G)[2]
1-element Array{Int64,1}:
 1898

julia> lookup_bus_index = map(reverse, lookup_index)

julia> lookup_bus_index[1898]
10287