PowerModelsAnalytics.jl Library
PowerModelsAnalytics.default_block_connectors
— Constantdefault edge type between blocks (PowerModels, PowerModelsDistribution
PowerModelsAnalytics.default_branch_impedance_spec
— ConstantVega spec for branch impedance plot
PowerModelsAnalytics.default_colors
— ConstantDefault plot colors, including all supported component variations
PowerModelsAnalytics.default_demand_color_range
— Constantdefault color range for partially loaded buses
PowerModelsAnalytics.default_demands_eng
— Constantdefault demands (loads) for eng model (PowerModelsDistribution)
PowerModelsAnalytics.default_demands_math
— Constantdefault demands (loads) for math model (PowerModels, PowerModelsDistribution)
PowerModelsAnalytics.default_edge_label_spec
— ConstantVega spec for extension to network graph spec for labeling edges
PowerModelsAnalytics.default_edge_settings_eng
— Constantdefault edge types for eng data structure
PowerModelsAnalytics.default_edge_settings_math
— Constantdefault edge types for math data structure (PowerModels, PowerModelsDistribution
PowerModelsAnalytics.default_edge_width_limits
— Constantdefault upper and lower bound of the width of edges
PowerModelsAnalytics.default_extra_nodes_eng
— Constantdefault node object to plot for eng data structure (PowerModelsDistribution)
PowerModelsAnalytics.default_extra_nodes_math
— Constantdefault node object to plot for math data structure (PowerModels, PowerModelsDistribution)
PowerModelsAnalytics.default_fontcolor
— Constantdefault fontcolor
PowerModelsAnalytics.default_fontfamily
— Constantdefault fontfamily
PowerModelsAnalytics.default_fontsize
— Constantdefault fontsize in pt
PowerModelsAnalytics.default_network_graph_spec
— ConstantVega spec for network graph plot (base)
PowerModelsAnalytics.default_node_label_spec
— ConstantVega spec for extension to network graph spec for labeling nodes
PowerModelsAnalytics.default_node_settings_eng
— Constantdefault node information for eng model (PowerModelsDistribution)
PowerModelsAnalytics.default_node_settings_math
— Constantdefault node information for math model (PowerModels, PowerModelsDistribution)
PowerModelsAnalytics.default_node_size_limits
— Constantdefault upper and lower bound of the size of nodes
PowerModelsAnalytics.default_plot_dpi
— Constantdefault dpi of plots
PowerModelsAnalytics.default_plot_size
— Constantdefault size of plots in pixels
PowerModelsAnalytics.default_source_demand_summary_spec
— ConstantVega spec for Source Demand Summary Plot
PowerModelsAnalytics.default_sources_eng
— Constantdefault sources (generators) for the eng model (PowerModelsDistribution)
PowerModelsAnalytics.default_sources_math
— Constantdefault sources (generators) for the math model (PowerModels,PowerModelsDistribution)
PowerModelsAnalytics.default_spring_constant
— Constantdefault spring constant for spring_layout
PowerModelsAnalytics.default_textalign
— Constantdefault text alignemtn
PowerModelsAnalytics.InfrastructureGraph
— TypeInfrastructureGraph{T<:LightGraphs.AbstractGraph}
A structure containing a graph of a PowerModels or PowerModelsDistribution network in the format of a LightGraphs.AbstractGraph and corresponding metadata necessary for analysis / plotting.
PowerModelsAnalytics.InfrastructureGraph
— MethodInfrastructureGraph(nvertices)
Constructor for the InfrastructureGraph struct, given a number of vertices nvertices
PowerModelsAnalytics._cc_dfs
— MethodDFS on a graph
PowerModelsAnalytics._compute_mva_ub
— MethodPowerModelsAnalytics._convert_nan
— Methodconverts nan values to 0.0
PowerModelsAnalytics._parameter_check_branch
— MethodPowerModelsAnalytics._parameter_check_bus
— MethodPowerModelsAnalytics._parameter_check_gen
— MethodPowerModelsAnalytics._parameter_check_load
— MethodPowerModelsAnalytics._parameter_check_network
— MethodPowerModelsAnalytics._parameter_check_shunt
— MethodPowerModelsAnalytics.add_edge!
— MethodAdds an edge defined by i
& j
to graph
PowerModelsAnalytics.apply_plot_network_metadata!
— Method`apply_plot_network_metadata!(graph; kwargs...)`
Builds metadata properties, i.e. color/size of nodes/edges, for plotting based on graph metadata
Arguments:
`graph::InfrastructureGraph`: Graph of power network
`colors::Dict{String,<:Colors.Colorant}`: Dictionary of colors to be changed from `default_colors`
`load_color_range::Vector{<:Colors.Colorant}`: Range of colors for load statuses
`node_size_limitss::Vector{<:Real}`: Min/Max values for the size of nodes
`edge_width_limits::Vector{<:Real}`: Min/Max values for the width of edges
PowerModelsAnalytics.build_network_graph
— Method`graph = build_power_network_graph(case::Dict{String,<:Any}; kwargs...)`
Builds a `InfrastructureGraph` from a power network `case`.
Arguments:
`case::Dict{String,<:Any}`: Network case
`edge_types::Vector{<:String}`: Component types that are edges
`block_connector_types::Vector{<:String}`: Types of edges that connect blocks (only used when `block_graph==true`)
`node_objects::Dict{String,<:Dict{String,<:String}}`: Other non-bus components to include in the graph
`block_graph::Bool`: If `true`, return block graph
`aggregate_node_objects::Bool`: If `true`, if multiple node objects present at a bus, aggregate into a single vertex
`exclusions::Vector{Any}`: Pattern for exclusion from graph
Returns:
`graph`: InfrastructureGraph
PowerModelsAnalytics.calc_connected_components
— MethodPowerModelsAnalytics.edges
— MethodReturns an iterator of all the edges in graph
PowerModelsAnalytics.get_property
— MethodGets the property in the metadata of graph
on obj
at key
. If property doesn't exist, returns default
PowerModelsAnalytics.hasprop
— MethodReturns true if InfrastructureGraph graph
has a property
on an edge or a node obj
PowerModelsAnalytics.identify_blocks
— MethodPowerModelsAnalytics.is_active
— Method`ans = is_active`
Determines if block is "active", e.g. energized, based on criteria in `sources`
Arguements:
`case::Dict{String,<:Any}`: Network case
`block::Set{<:Any}`: block of node ids
`sources::Dict{String,<:Dict{String,<:Any}}`: sources with settings that define criteria for active
Returns:
`ans::Bool`
PowerModelsAnalytics.kamada_kawai_layout
— MethodNetworkX Kamada-Kawai layout function
PowerModelsAnalytics.layout_graph!
— Method`layout_graph!(graph::InfrastructureGraph, layout_engine::Function; kwargs...)`
A routine to assign positions to all nodes of a `graph` for plotting using `layout_engine`.
Positions are assigned to the metadata of each node at `:x` and `:y`.
Arguments:
`graph::InfrastructureGraph`: Network graph
`layout_engine`: Layout Function to use. Applies only when not using `use_coordinates`
`use_coordinates::Bool`: If `true`, `spring_layout` will be used instead of `layout_engine`
`apply_spring_layout::Bool`: If `true`, `spring_layout` will be applied after `layout_engine` to ensure separation of overlapping nodes
`spring_constant::Real`: Spring constant to be used by `spring_layout`
`kwargs`: Keyword arguments to be used in `layout_engine`
PowerModelsAnalytics.parameter_check_summary
— MethodPowerModelsAnalytics.plot_branch_impedance
— MethodPlots branch impedances
PowerModelsAnalytics.plot_graph
— Method`spec = plot_graph(graph::InfrastructureGraph; kwargs...)`
Builds a figure sepcification. Returns `Vega.VGSpec`.
Arguments:
`graph::InfrastructureGraph{<:LightGraphs.AbstractGraph}`: Network graph
`label_nodes::Bool`: Plot labels on nodes
`label_edges::Bool`: Plot labels on edges
`fontsize::Real`: Fontsize of labels
`fontfamily::String`: Font Family of labels
`fontcolor::Union{Symbol,<:Colors.Colorant}`: Color of the labels
`textalign::Symbol`: Alignment of text: "left", "center", "right"
`plot_size::Tuple{Int,Int}`: Size of the plot in pixels
`plot_dpi::Int`: Dots-per-inch of the plot
Returns:
`spec<:Vega.VGSpec`: Vega.jl figure specification
PowerModelsAnalytics.plot_load_summary
— Method`plot_load_summary(file, result, case; kwargs...)`
Plots total generation, total load served, and total forecasted load for a given `case` and `result`, saving to `file`
Arguments:
`file::String`: file path to saved figure
`result::Dict{String,Any}`: multinetwork solution data (contains load statuses)
`case::Dict{String,Any}`: Original case file (without calcuated loads) for forecasted loads
`log::Bool`: If `true`, plots y-axis on log scale
`intermediate::Bool`: If `true`, plots intermediate steps of plot (for animations).
`legend_position::Symbol`: Position of legend, accepts the following symbols: `:right`, `:left`, `:top`, `:bottom`, `:inside`, `:best`, `:legend`, `:topright`, `:topleft`, `:bottomleft`, `:bottomright`
PowerModelsAnalytics.plot_network!
— Method`graph = plot_network(case::Dict{String,<:Any}; kwargs...)`
Plots a whole network `case` at the bus-level. Returns `InfrastructureGraph` and `Plots.AbstractPlot`.
This function will build the graph from the `case`. Additional `kwargs` are passed to
`plot_network(graph; kwargs...)`.
Arguments:
`case::Dict{String,Any}`: Network case data structure
`positions::Union{Dict{Int,<:Any},InfrastructureGraph}`: Pre-set positions of graph vertices
Returns:
`fig`
PowerModelsAnalytics.plot_network!
— Method`plot_network(graph; kwargs...)`
Plots a network `graph`. Returns `InfrastructureGraph` and `Plots.AbstractPlot`.
Arguments:
`graph::InfrastructureGraph{<:LightGraphs.AbstractGraph}`: Network graph
`filename::String`: File to output the plot to, will use user-set Plots.jl backend
`label_nodes::Bool`: Plot labels on nodes
`label_edges::Bool`: Plot labels on edges
`colors::Dict{String,<:Colors.Colorant}`: Changes to default colors, see `default_colors` for available components
`load_color_range::Vector{<:Colors.Colorant}}`: Range of colors for load statuses
`node_size_limits::Vector{<:Real}`: Min/Max values for the size of nodes
`edge_width_limits::Vector{<:Real}`: Min/Max values for the width of edges
`positions::Union{Dict{Int,<:Real}, InfrastructureGraph}`: Used to specify node locations of graph (avoids running layout algorithm every time)
`use_coordinates::Bool`: Use buscoord field on buses for node positions
`spring_constant::Real`: Only used if buscoords=true. Spring constant to be used to force-direct-layout buses with no buscoord field
`apply_spring_layout::Bool`: Apply spring layout after initial layout
`fontsize::Real`: Fontsize of labels
`fontfamily::String`: Font Family of labels
`fontcolor::Union{Symbol,<:Colors.Colorant}`: Color of the labels
`textalign::Symbol`: Alignment of text
`plot_size::Tuple{Int,Int}`: Size of the plot in pixels
`plot_dpi::Int`: Dots-per-inch of the plot
Returns:
`fig`
PowerModelsAnalytics.plot_network
— Method`graph = plot_network(case::Dict{String,<:Any}; kwargs...)`
Plots a whole network `case` at the bus-level. Returns `InfrastructureGraph` and `Plots.AbstractPlot`.
This function will build the graph from the `case`. Additional `kwargs` are passed to
`plot_network(graph; kwargs...)`.
Arguments:
`case::Dict{String,Any}`: Network case data structure
`positions::Union{Dict{Int,<:Any},InfrastructureGraph}`: Pre-set positions of graph vertices
Returns:
`graph::InfrastructureGraph`: InfrastructureGraph of the network
PowerModelsAnalytics.plot_network
— Method`plot_network(graph; kwargs...)`
Plots a network `graph`. Returns `InfrastructureGraph` and `Plots.AbstractPlot`.
Arguments:
`graph::InfrastructureGraph{<:LightGraphs.AbstractGraph}`: Network graph
`filename::String`: File to output the plot to, will use user-set Plots.jl backend
`label_nodes::Bool`: Plot labels on nodes
`label_edges::Bool`: Plot labels on edges
`colors::Dict{String,<:Colors.Colorant}`: Changes to default colors, see `default_colors` for available components
`load_color_range::Vector{<:Colors.Colorant}}`: Range of colors for load statuses
`node_size_limits::Vector{<:Real}`: Min/Max values for the size of nodes
`edge_width_limits::Vector{<:Real}`: Min/Max values for the width of edges
`positions::Union{Dict{Int,<:Real}, InfrastructureGraph}`: Used to specify node locations of graph (avoids running layout algorithm every time)
`use_coordinates::Bool`: Use buscoord field on buses for node positions
`spring_constant::Real`: Only used if buscoords=true. Spring constant to be used to force-direct-layout buses with no buscoord field
`apply_spring_layout::Bool`: Apply spring layout after initial layout
`fontsize::Real`: Fontsize of labels
`fontfamily::String`: Font Family of labels
`fontcolor::Union{Symbol,<:Colors.Colorant}`: Color of the labels
`textalign::Symbol`: Alignment of text
`plot_size::Tuple{Int,Int}`: Size of the plot in pixels
`plot_dpi::Int`: Dots-per-inch of the plot
Returns:
`graph::InfrastructureGraph`: InfrastructureGraph of the network
PowerModelsAnalytics.plot_source_demand_summary
— Method`plot_source_demand_summary(file::String, mn_case::Dict{String,<:Any}; kwargs...)`
Plots the total delivery from sources (generation) and total receipts by demands (load)
Arguments:
`fileout::String`: path to file where plot will be saved
`mn_case::Dict{String,<:Any}`: a multinetwork case
`yscale::Symbol`: To set log scale, `:log10`, else `:identity`
`save_intermediate_frames::Bool`: if `true`, each frame of the multinetwork will be saved separately
`legend_position::Symbol`: Position of legend, accepts the following symbols: `:right`, `:left`, `:top`, `:bottom`, `:inside`, `:best`, `:legend`, `:topright`, `:topleft`, `:bottomleft`, `:bottomright`
`sources::Dict{String,<:Any}`: information about sources (e.g. generators)
`demands::Dict{String,<:Any}`: information about demands (e.g. loads)
`totals::Symbol`: Choose `:real`, `:imaginary`, `:complex`
PowerModelsAnalytics.properties
— MethodReturns all of the metadata for obj
in graph
PowerModelsAnalytics.set_properties!
— MethodSets multiple properties
in the metadata of graph
on obj
at key
PowerModelsAnalytics.set_property!
— MethodSets a property
in the metadata at key
of graph
on obj
PowerModelsAnalytics.spring_layout
— MethodNetworkX spring layout function
PowerModelsAnalytics.vertices
— MethodReturns an iterator of all of the nodes/vertices in graph