Base

Helper functions

PowerModelsDistribution.set_lower_boundFunction
function set_lower_bound(
	x::JuMP.VariableRef,
	bound::Real
)

Local wrapper method for JuMP.setlowerbound, which skips NaN and infinite (-Inf only)

source
function set_lower_bound(
	xs::Vector{JuMP.VariableRef},
	bound::Real
)

Local wrapper method for JuMP.setlowerbound, which skips NaN and infinite (-Inf only). Note that with this signature, the bound is applied to every variable in the vector.

source
PowerModelsDistribution.set_upper_boundFunction
function set_upper_bound(
	x::JuMP.VariableRef,
	bound
)

Local wrapper method for JuMP.setupperbound, which skips NaN and infinite (+Inf only)

source
function set_upper_bound(
	xs::Vector{JuMP.VariableRef},
	bound::Real
)

Local wrapper method for JuMP.setupperbound, which skips NaN and infinite (+Inf only). Note that with this signature, the bound is applied to every variable in the vector.

source
PowerModelsDistribution.comp_start_valueFunction
comp_start_value(
  comp::Dict,
  keys::Vector{String},
  conductor::Int,
  default::Any
)

Searches for start value for a variable key in order from a list of keys of a component comp for conductor conductor, and if one does not exist, uses default

source
function comp_start_value(
	comp::Dict{String,<:Any},
	key::String,
	conductor::Int,
	default::Any
)

Searches for start value for a variable key of a component comp for conductor conductor, and if one does not exist, uses default

source
function comp_start_value(
	comp::Dict{String,<:Any},
	keys::String,
	default::Any=0.0
)

Searches for start value for a variable key in order from a list of keys of a component comp, and if one does not exist, uses default. This is the conductor-agnostic version of comp_start_value.

source
function comp_start_value(
  comp::Dict,
  key::String,
  default::Any=0.0
)

Searches for start value for a variable key of a component comp, and if one does not exist, uses default. This is the conductor-agnostic version of comp_start_value.

source

Ref Creation Functions

PowerModelsDistribution.ref_add_core!Method
ref_add_core!(ref::Dict{Symbol,Any})

Returns a dict that stores commonly used pre-computed data from of the data dictionary, primarily for converting data-types, filtering out deactivated components, and storing system-wide values that need to be computed globally. Some of the common keys include:

  • :off_angmin and :off_angmax (see calc_theta_delta_bounds(data)),
  • :bus – the set {(i, bus) in ref[:bus] : bus["bus_type"] != 4},
  • :gen – the set {(i, gen) in ref[:gen] : gen["gen_status"] == 1 && gen["gen_bus"] in keys(ref[:bus])},
  • :branch – the set of branches that are active in the network (based on the component status values),
  • :arcs_branch_from – the set [(i,b["f_bus"],b["t_bus"]) for (i,b) in ref[:branch]],
  • :arcs_branch_to – the set [(i,b["t_bus"],b["f_bus"]) for (i,b) in ref[:branch]],
  • :arcs_branch – the set of arcs from both arcs_from and arcs_to,
  • :arcs_switch_from – the set [(i,b["f_bus"],b["t_bus"]) for (i,b) in ref[:switch]],
  • :arcs_switch_to – the set [(i,b["t_bus"],b["f_bus"]) for (i,b) in ref[:switch]],
  • :arcs_switch – the set of arcs from both arcs_switch_from and arcs_switch_to,
  • :arcs_transformer_from – the set [(i,b["f_bus"],b["t_bus"]) for (i,b) in ref[:transformer]],
  • :arcs_transformer_to – the set [(i,b["t_bus"],b["f_bus"]) for (i,b) in ref[:transformer]],
  • :arcs_transformer – the set of arcs from both arcs_transformer_from and arcs_transformer_to,
  • :bus_arcs_branch – the mapping Dict(i => [(l,i,j) for (l,i,j) in ref[:arcs_branch]]),
  • :bus_arcs_transformer – the mapping Dict(i => [(l,i,j) for (l,i,j) in ref[:arcs_transformer]]),
  • :bus_arcs_switch – the mapping Dict(i => [(l,i,j) for (l,i,j) in ref[:arcs_switch]]),
  • :buspairs – (see buspair_parameters(ref[:arcs_branch_from], ref[:branch], ref[:bus])),
  • :bus_gens – the mapping Dict(i => [gen["gen_bus"] for (i,gen) in ref[:gen]]).
  • :bus_loads – the mapping Dict(i => [load["load_bus"] for (i,load) in ref[:load]]).
  • :bus_shunts – the mapping Dict(i => [shunt["shunt_bus"] for (i,shunt) in ref[:shunt]]).
source

InfrastructureModels Extensions

InfrastructureModels.build_solution_valuesFunction

custom build_solution_values for multiconductor (vector) variables

source

custom build_solution_values for multiconductor (vector) nonlinear expressions

source

custom build_solution_values for multiconductor (vector) generic affine expressions

source

custom build_solution_values for multiconductor (vector) constants

source

custom build_solution_values for generic dense axis arrays

source

custom build_solution_values for multiconductor (vector) constants

source