Internal

PowerFlows._first_choice_gen_idMethod

Try to make an informative one or two character name for the load/generator/etc.

  • "generator-1234-AB" -> "AB"
  • "123CT7" -> "7"
  • "load1234" -> "34"
source
PowerFlows._psse_bus_namesMethod

Given a vector of Sienna bus names, create a dictionary from Sienna bus name to PSS/E-compatible bus name. Guarantees determinism and minimal changes.

WRITTEN TO SPEC: PSS/E 33.3 POM 5.2.1 Bus Data

source
PowerFlows._psse_bus_numbersMethod

Given a vector of Sienna bus numbers, create a dictionary from Sienna bus number to PSS/E-compatible bus number. Assumes that the Sienna bus numbers are positive and unique. Guarantees determinism: if the input contains the same bus numbers in the same order, the output will. Guarantees minimal changes: that if an existing bus number is compliant, it will not be changed.

WRITTEN TO SPEC: PSS/E 33.3 POM 5.2.1 Bus Data

source
PowerFlows._psse_transformer_namesMethod

Given a vector of Sienna transformer names, create a dictionary from Sienna transformer name to PSS/E-compatible transformer name. Guarantees determinism and minimal changes.

WRITTEN TO SPEC: PSS/E 33.3 POM 5.2.1 Transformer Data

source
PowerFlows.convert_emptyMethod

If val is empty, returns T(); if not, asserts that val isa T and returns val. Has nice type checker semantics.

Examples

convert_empty(Vector{String}, [])  # -> String[]
convert_empty(Vector{String}, ["a"])  # -> ["a"]
convert_empty(Vector{String}, [2])  # -> TypeError: in typeassert, expected Vector{String}, got a value of type Vector{Int64}
Base.return_types(Base.Fix1(convert_empty, Vector{String}))  # -> [Vector{String}]
source
PowerFlows.create_component_idsMethod

Given a vector of component names and a corresponding vector of container IDs (e.g., bus numbers), create unique-per-container PSS/E-compatible IDs, output a dictionary from (container ID, component name) to PSS/E-compatible component ID. The "singlesto1" flag detects components that are the only one on their bus and gives them the name "1".

source
PowerFlows.flow_funcMethod

Calculates the From - To complex power flow using external data of voltages of branch of type Line

source
PowerFlows.flow_funcMethod

Calculates the From - To complex power flow using external data of voltages of branch of type TapTransformer

source
PowerFlows.flow_funcMethod

Calculates the From - To complex power flow using external data of voltages of branch of type Transformer2W

source
PowerFlows.flow_valMethod

Calculates the From - To complex power flow (Flow injected at the bus) of branch of type Line

source
PowerFlows.flow_valMethod

Calculates the From - To complex power flow (Flow injected at the bus) of branch of type Line

source
PowerFlows.flow_valMethod

Calculates the From - To complex power flow (Flow injected at the bus) of branch of type TapTransformer

source
PowerFlows.flow_valMethod

Calculates the From - To complex power flow (Flow injected at the bus) of branch of type Transformer2W

source
PowerFlows.make_power_flow_containerFunction

Create an appropriate PowerFlowContainer for the given PowerFlowEvaluationModel and initialize it from the given PSY.System.

Arguments:

  • pfem::PowerFlowEvaluationModel: power flow model to construct a container for (e.g., DCPowerFlow())
  • sys::PSY.System: the system from which to initialize the power flow container
  • time_steps::Int: number of time periods to consider (default is 1)
  • timestep_names::Vector{String}: names of the time periods defines by the argument "time_steps". Default value is String[].
  • check_connectivity::Bool: Perform connectivity check on the network matrix. Default value is true.
source
PowerFlows.penalty_factors!Method
penalty_factors!(J::SparseMatrixCSC{Float64, Int64}, dSbus_dV_ref::Vector{Float64}, destination::SubArray{Float64})

Compute the penalty factors (active power loss factors) and store the result in destination, which is the view in the loss_factorsmatrix of thePowerFlowData`. The loss factors are computed using the Jacobian matrixJand the vector of partial derivatives of slack power with respect to bus voltages (angle and magnitude)dSbusdVref`. The approach is interpreting the change in slack active power injection as the change of the grid active power losses. The function uses the KLU library for sparse matrix factorization to calculate the loss factors. The loss factors are a linear approximation of the change in slack active power injection respect to the change in active power injections at each bus.

Arguments

  • J::SparseMatrixCSC{Float64, Int64}: The Jacobian matrix in sparse format.
  • dSbus_dV_ref::Vector{Float64}: The reference vector for the change in slack bus power with respect to bus voltages (PV, PQ buses for voltage angle, PQ buses for voltage magnitude).
  • destination::SubArray{Float64}: The view in the penalty factors matrix where the computed penalty factors will be stored.
source
PowerFlows.update_system!Method

Modify the values in the given System to correspond to the given PowerFlowData such that if a new PowerFlowData is constructed from the resulting system it is the same as data. See also write_powerflow_solution!. NOTE that this assumes that data was initialized from sys and then solved with no further modifications.

source
PowerFlows.write_to_buffers!Method

WRITTEN TO SPEC: PSS/E 33.3 POM 5.2.1 Bus Data. Sienna voltage limits treated as PSS/E normal voltage limits; PSSE emergency voltage limits left as default.

source
PowerFlows.write_to_buffers!Method

If the exportsettings flag `sourcesasgeneratorsis set, exportPSY.Sourceinstances as PSS/E generators in addition toPSY.Generators. Same forstoragesas_generatorsandPSY.Storage`.

WRITTEN TO SPEC: PSS/E 33.3 POM 5.2.1 Generator Data

source