Graphs
Methods for using/analyzing the network model as a graph
CommonOPF.make_graph
— Functionmake_graph(edges::AbstractVector)
return SimpleDiGraph by inferring busses from edges
with the dicts for bus => int and int => bus (because Graphs.jl only works with integer nodes)
julia> g["13", :bus]
10
julia> g[13, :bus]
"24"
julia> get_prop(g, :int_bus_map)[13]
"24"
make_graph(busses::AbstractVector{String}, edges::AbstractVector)
return SimpleDiGraph with the dicts for bus => int and int => bus (because Graphs.jl only works with integer nodes)
julia> g["13", :bus]
10
julia> g[13, :bus]
"24"
julia> get_prop(g, :int_bus_map)[13]
"24"
CommonOPF.leaf_busses
— Functionleaf_busses(p::Inputs)
returns Vector{String}
containing all of the leaf busses in p.busses
IO methods
Inputs
CommonOPF.remove_bus!
— Methodremove_bus!(j::String, p::Inputs{SinglePhase})
Remove bus j
in the line i->j->k from the model by making an equivalent line from busses i->k
CommonOPF.remove_bus!
— Methodremove_bus!(j::String, p::Inputs{MultiPhase})
Remove bus j
in the line i->j->k from the model by making an equivalent line from busses i->k
CommonOPF.reduce_tree!
— Methodreduce_tree!(p::Inputs{SinglePhase})
combine any line sets with intermediate busses that have indegree == outdegree == 1 and is not a load bus into a single line
See remove_bus!
for how the two lines are combined.
CommonOPF.reduce_tree!
— Methodreduce_tree!(p::Inputs{MultiPhase})
combine any line sets with intermediate busses that satisfy 1. indegree == outdegree == 1 2. is not a load bus and 3. has same phases in as out into a single line.
See remove_bus!
for how the two lines are combined.
Types
Utils
CommonOPF.trim_tree!
— Functiontrim_tree!(p::Inputs)
Trim any branches that do not contain load busses.
CommonOPF.trim_tree_once!
— Functiontrim_tree_once!(p::Inputs)
A support function for trim_tree!
. When trimming the tree sometimes new leafs are created. So trim_tree!
loops over trim_tree_once!
.
CommonOPF.rij
— Methodrij(i::AbstractString, j::AbstractString, p::Inputs{SinglePhase})
The per-unit resistance of line i->j
CommonOPF.xij
— Methodxij(i::AbstractString, j::AbstractString, p::Inputs{SinglePhase})
The per-unit reacttance of line i->j
CommonOPF.zij
— Functionfunction zij(i::AbstractString, j::AbstractString, net::Network{SinglePhase})::Tuple{Real, Real}
Impedance for single phase models.
Returns (r1, x1) * length / net.Zbase
for the Conductor
at net[(i, j)]
.
TODO test TODO MultiPhase