diff --git a/dev/developer/contributing.html b/dev/developer/contributing.html index 2a5eac98f..7efd596f5 100644 --- a/dev/developer/contributing.html +++ b/dev/developer/contributing.html @@ -1,2 +1,2 @@ -Contributing · PowerModelsDistribution

Pull Requests

All pull requests should be reviewed by a core developer, and may include a review by a subject matter expert if the area of the PR is outside that of one of the core developers. In that case, the core developers will primarily review style and design, rather than substance.

Every PR to PowerModelsDistribution should strive to meet the following guidelines.

PR Title

  • Should be concise and clear, describing in a phrase the content of the PR
  • Should include a prefix that describes the primary type of the PR
    • ADD: feature addition
    • FIX: bugfix
    • REF: refactor
    • UPD: updates to code for e.g. version bumps of dependencies
    • STY: style changes, no changes to function names, added features, etc.
    • DOC: documentation-only additions/changes
    • RM: dead code removal

PR Body

  • If the change is breaking, it should be clearly stated up front
  • The purpose of this PR should be clearly stated right away
  • Major changes / additions to the code should be summarized. In the case where a refactor was performed, the name changes of public functions should be documented in the body of the PR
  • Any associated Issues should be referenced in the body of the PR, and it is accepted/encouraged to use Closes #XX to automatically close Issues after the PR is merged

PR Code

  • An entry should be added to CHANGELOG.md for every PR
  • Documentation should be updated (See Documentation section above for guidelines)
  • Unit tests should be added. In the case where existing unit tests were altered, an explanation for the change must be included
  • Code should be rebased to the latest version of whatever branch the PR is aimed at (no merge conflicts!)

Versions

PowerModelsDistribution follows the Semantic Versioning (SemVer) convention of Major.minor.patch, where Major indicates breaking changes, minor indicates non-breaking feature additions, and patch indicates non-breaking bugfixes.

Currently, because Major==0, minor indicates breaking changes and patch indicates any non-breaking change, including both feature additions and bugfixes. Once PowerModelsDistribution reaches v1.0.0, we will adhere strictly to the SemVer convention.

Branch Management

The main branch is a protected branch, meaning that its history will always be contiguous and can never be overwritten.

Release candidate branches of the format vM.m.0-rc are also protected branches. These branches will contain only breaking changes and will not be merged into main until a new version is ready to be tagged. Pull requests including breaking changes should be directed into the next release candidate branch available, e.g. if the current version of the package is v0.9.0, the next release candidate branch will be v0.10.0-rc.

Pull requests that include only non-breaking changes can be merged directly into main once approved, and in the case of merge conflicts arising for release candidate branches, the -rc branch will need to be updated to include the latest main.

Pull requests will generally be merged using squash and merge into the branch they are aimed at, with the exception of release candidate branches, which generally be merged using rebase and merge into main.

+Contributing · PowerModelsDistribution

Pull Requests

All pull requests should be reviewed by a core developer, and may include a review by a subject matter expert if the area of the PR is outside that of one of the core developers. In that case, the core developers will primarily review style and design, rather than substance.

Every PR to PowerModelsDistribution should strive to meet the following guidelines.

PR Title

  • Should be concise and clear, describing in a phrase the content of the PR
  • Should include a prefix that describes the primary type of the PR
    • ADD: feature addition
    • FIX: bugfix
    • REF: refactor
    • UPD: updates to code for e.g. version bumps of dependencies
    • STY: style changes, no changes to function names, added features, etc.
    • DOC: documentation-only additions/changes
    • RM: dead code removal

PR Body

  • If the change is breaking, it should be clearly stated up front
  • The purpose of this PR should be clearly stated right away
  • Major changes / additions to the code should be summarized. In the case where a refactor was performed, the name changes of public functions should be documented in the body of the PR
  • Any associated Issues should be referenced in the body of the PR, and it is accepted/encouraged to use Closes #XX to automatically close Issues after the PR is merged

PR Code

  • An entry should be added to CHANGELOG.md for every PR
  • Documentation should be updated (See Documentation section above for guidelines)
  • Unit tests should be added. In the case where existing unit tests were altered, an explanation for the change must be included
  • Code should be rebased to the latest version of whatever branch the PR is aimed at (no merge conflicts!)

Versions

PowerModelsDistribution follows the Semantic Versioning (SemVer) convention of Major.minor.patch, where Major indicates breaking changes, minor indicates non-breaking feature additions, and patch indicates non-breaking bugfixes.

Currently, because Major==0, minor indicates breaking changes and patch indicates any non-breaking change, including both feature additions and bugfixes. Once PowerModelsDistribution reaches v1.0.0, we will adhere strictly to the SemVer convention.

Branch Management

The main branch is a protected branch, meaning that its history will always be contiguous and can never be overwritten.

Release candidate branches of the format vM.m.0-rc are also protected branches. These branches will contain only breaking changes and will not be merged into main until a new version is ready to be tagged. Pull requests including breaking changes should be directed into the next release candidate branch available, e.g. if the current version of the package is v0.9.0, the next release candidate branch will be v0.10.0-rc.

Pull requests that include only non-breaking changes can be merged directly into main once approved, and in the case of merge conflicts arising for release candidate branches, the -rc branch will need to be updated to include the latest main.

Pull requests will generally be merged using squash and merge into the branch they are aimed at, with the exception of release candidate branches, which generally be merged using rebase and merge into main.

diff --git a/dev/developer/extensions.html b/dev/developer/extensions.html index 5a510465d..db67eca23 100644 --- a/dev/developer/extensions.html +++ b/dev/developer/extensions.html @@ -1,2 +1,2 @@ -Extensions · PowerModelsDistribution
+Extensions · PowerModelsDistribution
diff --git a/dev/developer/roadmap.html b/dev/developer/roadmap.html index 31ed39f50..93709e130 100644 --- a/dev/developer/roadmap.html +++ b/dev/developer/roadmap.html @@ -1,2 +1,2 @@ -Roadmap · PowerModelsDistribution
+Roadmap · PowerModelsDistribution
diff --git a/dev/developer/style.html b/dev/developer/style.html index aa91403dc..cc77b3201 100644 --- a/dev/developer/style.html +++ b/dev/developer/style.html @@ -1,4 +1,4 @@ Style Guide · PowerModelsDistribution

Style Conventions

In general, the following conventions should be adhered to when making changes or additions to the code base. These conventions should include any conventions applied across the InfrastructureModels ecosystem specific to power engineering (i.e conventions from InfrastructureModels, PowerModels, PowerModelsRestoration, etc.) with some additions specific to PowerModelsDistribution.

Functions

Function additions should meeting the following criteria:

  • All functions should be clearly named, without abbreviations, and with underscores between words, e.g. parse_file or constraint_bus_voltage_magnitude; in Python this is known as lower_case_with_underscores. The exception to the abbreviate rule is cases where abbreviations would be expected in the modeling of power systems.
  • All functions that are not prepended by an underscore _ will be exported by default (i.e. when a user uses using PowerModelsDistribution). Public functions should have a detailed docstring instructing on usage
  • All functions that modify data in place should end with an exclamation point ! and the function input that is being modified should be the first argument (or first arguments in the case where multiple inputs are being modified in place). The exceptions to this rule are constraint and variable creation functions (i.e. those functions related to JuMP model creation), which do not include the exclamation point
  • All function arguments, including keyword arguments, should have their types specified.
  • Private functions, i.e. those intended to be for internal use only, should follow the same descriptive naming conventions as functions exported by default, and should always include docstrings to describe their purpose.
  • Functions should be separated by two blank lines
"this function demonstrates how an internal, in-place data altering function should be defined"
 function _concise_descriptive_name!(data::Dict{String,<:Any}, a::Real, b::Vector{<:Real}, c::Matrix{<:Complex}; d::Bool=false, e::Vector{Function}=Function[])
-end

Types & Enums

When specifying types, i.e. when specifying the type of a function argument, or creating enums, these guidelines are recommended:

  • Prefer to use Vector{T} instead of Array{T,1}
  • Prefer to use Matrix{T} instead of Array{T,2}
  • Enums should only be used in the ENGINEERING data model, never the MATHEMATICAL data model
  • Enums must be added to the JSON parser when introduced

Constants

Whenever possible, const should be used to eliminate unnecessary re-evaluations of code, and every const should have a docstring, whether internal or public.

JuMP Variables and Constraints

For functions that create JuMP variables and constraints in particular, we follow the following naming convention as originally adopted by PowerModels:

<jump macro id>(_<phase variant>)_<comp short name>_<quantity name>(_real|_imaginary|_magnitude|_angle|_factor)(_fr|_to)(_sqr)(_on_off)

in the interest of intuitive names for users, the following special cases are also acceptable,

  • _power_real -(can be replaced with)-> _active
  • _power_imaginary -(can be replaced with)-> _reactive

In the case of PowerModelsDistribution, there are additional tags indicating that a function is a multiconductor variant, three-phase specific, etc.:

  • mc multi-conductor, with an explicit neutral (which is the last conductor by convention?)
  • mp multi-phase, for constraints that have no (explicit) neutral and multiple phases
  • 3p three-phase, when a constraint is hard-coded for three phases

Currently, all phase-aware functions use mc, but this is subject to change in the future as we refactor. If the function is not multiphase specific, these are not needed in the function name.

Formulation Styles

  • All new formulations should have clear error messages when they do not support existing components. For example, if a formulation addition which is intended to work with OPF does not support delta-wye transformers, the constraint_mc_transformer_power_dy
  • Formulation abstract type and mutable struct must be specified in CapitalizedWords, which is a subtype of camelCase with the first word also capitalized.

Problem Specification Styles

  • If a new problem specification is only needed due to the requirements of a new formulation, and is not a new type of problem, e.g. another OPF formulation, a build_ function with the same name as the existing formulation should be created that accepts a specific PowerModel (multiple dispatch)
  • If a new problem specification is a new type of problem that will e.g. accept multiple formulations, new build_ and run_ functions should be created that do not collide with existing problem specification functions

Metaprogramming

In general, it is better to avoid metaprogramming patterns, like creating functions algorithmically, in order to aid in the debugging of code. Metaprogramming can create significant challenges in interpreting stacktraces upon errors.

Markdown

Markdown files should be properly formatted, particularly when including tables. Developers are encouraged to use markdownlint and a markdown formatter (such as in VSCode).

File Structure

It is important that new functions, variables, constraints, etc. all go into appropriate places in the code base so that future maintenance and debugging is easier. Pay attention to the current file structure and attempt to conform as best as possible to it. In general

  • /src/core contains the core logic of the package, including variable creation and constraint templates, i.e. things that are agnostic to the formulation
  • /src/data_model contains all of the logic to transform between the ENGINEERING and MATHEMATICAL data models and model creation helper tools
  • src/form contains formulation specific variable and constraint functions, organized under separate files for different formulations
  • src/io contains all of the tools to parse and save files, in particular all of the logic necessary to parse dss files and output json files
  • src/prob contains all problem specifications
  • docs/src contains all source markdown files for the documentation
  • examples contains Jupyter notebooks with walkthroughs of PowerModelsDistribution for new users

Dependencies (Project.toml)

All new dependencies should be carefully considered before being added. It is important to keep the number of external dependencies low to avoid reliance on features that may not be maintained in the future. If possible, Julia Standard Library should be used, particularly in the case where reproducing the desired feature is trivial. There will be cases where it is not simple to duplicate a feature and subsequently maintain it within the package, so adding a dependency would be appropriate in such cases.

All new dependencies are are ultimately approved should also include an entry under [compat] indicating the acceptable versions (Julia automerge requirement). This includes test-only dependencies that appear under [extras]

The Manifest.toml should not be included in the repo.

+end

Types & Enums

When specifying types, i.e. when specifying the type of a function argument, or creating enums, these guidelines are recommended:

Constants

Whenever possible, const should be used to eliminate unnecessary re-evaluations of code, and every const should have a docstring, whether internal or public.

JuMP Variables and Constraints

For functions that create JuMP variables and constraints in particular, we follow the following naming convention as originally adopted by PowerModels:

<jump macro id>(_<phase variant>)_<comp short name>_<quantity name>(_real|_imaginary|_magnitude|_angle|_factor)(_fr|_to)(_sqr)(_on_off)

in the interest of intuitive names for users, the following special cases are also acceptable,

In the case of PowerModelsDistribution, there are additional tags indicating that a function is a multiconductor variant, three-phase specific, etc.:

Currently, all phase-aware functions use mc, but this is subject to change in the future as we refactor. If the function is not multiphase specific, these are not needed in the function name.

Formulation Styles

Problem Specification Styles

Metaprogramming

In general, it is better to avoid metaprogramming patterns, like creating functions algorithmically, in order to aid in the debugging of code. Metaprogramming can create significant challenges in interpreting stacktraces upon errors.

Markdown

Markdown files should be properly formatted, particularly when including tables. Developers are encouraged to use markdownlint and a markdown formatter (such as in VSCode).

File Structure

It is important that new functions, variables, constraints, etc. all go into appropriate places in the code base so that future maintenance and debugging is easier. Pay attention to the current file structure and attempt to conform as best as possible to it. In general

Dependencies (Project.toml)

All new dependencies should be carefully considered before being added. It is important to keep the number of external dependencies low to avoid reliance on features that may not be maintained in the future. If possible, Julia Standard Library should be used, particularly in the case where reproducing the desired feature is trivial. There will be cases where it is not simple to duplicate a feature and subsequently maintain it within the package, so adding a dependency would be appropriate in such cases.

All new dependencies are are ultimately approved should also include an entry under [compat] indicating the acceptable versions (Julia automerge requirement). This includes test-only dependencies that appear under [extras]

The Manifest.toml should not be included in the repo.

diff --git a/dev/index.html b/dev/index.html index 93f573de4..170cca33e 100644 --- a/dev/index.html +++ b/dev/index.html @@ -11,4 +11,4 @@ author = "David M. Fobes and Sander Claeys and Frederik Geth and Carleton Coffrin", keywords = "Nonlinear optimization, Convex optimization, AC optimal power flow, Julia language, Open-source", abstract = "In this work we introduce PowerModelsDistribution, a free, open-source toolkit for distribution power network optimization, whose primary focus is establishing a baseline implementation of steady-state multi-conductor unbalanced distribution network optimization problems, which includes implementations of Power Flow and Optimal Power Flow problem types. Currently implemented power flow formulations for these problem types include AC (polar and rectangular), a second-order conic relaxation of the Branch Flow Model (BFM) and Bus Injection Model (BIM), a semi-definite relaxation of BFM, and several linear approximations, such as the simplified unbalanced BFM. The results of AC power flow have been validated against OpenDSS, an open-source “electric power distribution system simulator”, using IEEE distribution test feeders (13, 34, 123 bus and LVTestCase), all parsed using a built-in OpenDSS parser. This includes support for standard distribution system components as well as novel resource models such as generic energy storage (multi-period) and photovoltaic systems, with the intention to add support for additional components in the future." -}

The associated Power Systems Computation Conference talk can be found on YouTube.

License

This code is provided under a BSD license as part of the Multi-Infrastructure Control and Optimization Toolkit (MICOT) project, LA-CC-13-108.

+}

The associated Power Systems Computation Conference talk can be found on YouTube.

License

This code is provided under a BSD license as part of the Multi-Infrastructure Control and Optimization Toolkit (MICOT) project, LA-CC-13-108.

diff --git a/dev/installation.html b/dev/installation.html index 654f9d241..b9d727d4e 100644 --- a/dev/installation.html +++ b/dev/installation.html @@ -1,4 +1,4 @@ Installation Guide · PowerModelsDistribution

Installation Guide

From Julia, PowerModelsDistribution is installed using the built-in package manager:

import Pkg
 Pkg.add("PowerModelsDistribution")

Or, within the Julia REPL:

]add PowerModelsDistribution

Installing an Optimizer

PowerModelsDistribution depends on optimizers to solve Optimization problems, e.g., solve_mc_opf. The table below lists the optimizer packages that have been tested with PowerModelsDistribution, and have been found to work by the team; this list is not exhaustive, there are probably more optimizers that will work.

Install an optimizer using the Julia Package Manager, e.g.,

import Pkg
-Pkg.add("Ipopt")

Known Working Optimizers

The table below contains a truncated list of optimizers from the JuMP documentation that have been used by the development team and are confirmed to work with our package. There may be other Optimizers that work, and the Optimizers listed below are not guaranteed to work with all problems; they must be selected for the appropriate problems.

SolverJulia PackageInstallationLicenseSupports
Artelys KnitroKNITRO.jlManualComm.(MI)LP, (MI)SOCP, (MI)NLP
CbcCbc.jlEPL(MI)LP
CPLEXCPLEX.jlManualComm.(MI)LP, (MI)SOCP
GurobiGurobi.jlManualComm.(MI)LP, (MI)SOCP
IpoptIpopt.jlEPLLP, QP, NLP
Juniper.jlJuniper.jlMIT(MI)SOCP, (MI)NLP
SCSSCS.jlMITLP, SOCP, SDP

Where:

  • LP = Linear programming
  • QP = Quadratic programming
  • SOCP = Second-order conic programming (including problems with convex quadratic constraints and/or objective)
  • NLP = Nonlinear programming
  • SDP = Semidefinite programming
  • (MI)XXX = Mixed-integer equivalent of problem type XXX

For a complete list of JuMP supported optimizers, see JuMP Documentation.

Unsatisfiable requirements detected

Did you get an error like Unsatisfiable requirements detected for package D [756980fe]:?

The Pkg documentation has a section on how to understand and manage these conflicts.

+Pkg.add("Ipopt")

Known Working Optimizers

The table below contains a truncated list of optimizers from the JuMP documentation that have been used by the development team and are confirmed to work with our package. There may be other Optimizers that work, and the Optimizers listed below are not guaranteed to work with all problems; they must be selected for the appropriate problems.

SolverJulia PackageInstallationLicenseSupports
Artelys KnitroKNITRO.jlManualComm.(MI)LP, (MI)SOCP, (MI)NLP
CbcCbc.jlEPL(MI)LP
CPLEXCPLEX.jlManualComm.(MI)LP, (MI)SOCP
GurobiGurobi.jlManualComm.(MI)LP, (MI)SOCP
IpoptIpopt.jlEPLLP, QP, NLP
Juniper.jlJuniper.jlMIT(MI)SOCP, (MI)NLP
SCSSCS.jlMITLP, SOCP, SDP

Where:

For a complete list of JuMP supported optimizers, see JuMP Documentation.

Unsatisfiable requirements detected

Did you get an error like Unsatisfiable requirements detected for package D [756980fe]:?

The Pkg documentation has a section on how to understand and manage these conflicts.

diff --git a/dev/manual/connections.html b/dev/manual/connections.html index f2184ec0d..cd52896e5 100644 --- a/dev/manual/connections.html +++ b/dev/manual/connections.html @@ -1,2 +1,2 @@ -Connecting Components · PowerModelsDistribution

Connecting Components

One of the main goals of a network model, is specifying how constituent components are connected together. The patterns explained here, are equally applicable to the engineering and mathematical data model.

The available connections of each component connect to bus terminals. Take for example a bus with four terminals, terminals=["a","b","c","n"].

Node objects

Node objects always connect to a single bus (and perhaps also the universal ground, as can be the case for shunts). Therefore, they always have at least two key fields controlling the connectivity: bus and connections. Most node objects also have a configuration field, which affects the interpretation of the values supplied in connections. We will illustrate this for loads below.

Loads

A multi-phase load consists of several individual loads, the number of which is implied by the length of properties such as pd_nom, qd_nom etc. The table below illustrates how the length of the field connections and the value of the field configuration determines the layout of the load.

connectionsconfiguration==WYEconfiguration==DELTA
22 connections, wye2 connections, delta
33 connections, wye3 connections, delta
44 connections, wyeundefined

For example, we wish to connect a wye-connected load consisting of 2 individual loads (|connections|=3 and configuration=WYE) to our example bus with four available terminals. If we specify connections=["a","c","n"], this leads to

loads connection example.

Edge objects

Edge objects connect two buses (except for generic transformers, which can connect N buses). Therefore, they have the fields

  • f_bus and f_connections, specifying the from-side bus and how the object connects to it;
  • t_bus and t_connections, specifying the same for the to-side.

Lines

A line can have a variable number of conductors, which is implied by the size of the fields rs, xs, g_fr, b_fr, g_to and b_to. The fields f_connections and t_connections should specify for each conductor, to which terminals it connects. The figure below illustrates this for a line with 2 conductors,

line connection example.

Transformers

Transformers also have a configuration field. For

  • generic transformers, this is specified per winding, and configuration is therefore a vector of ConnConfig enums (WYE or DELTA);
  • AL2W transformers however are always two-winding, and the secondary is always wye-connected. Therefore, configuration is a scalar, specifying the configuration of the from-side winding.

Generic transformers have a field buses, a Vector containing the buses to which each winding connects respectively (these do not have to be unique; a split-phase transformer is typically represented by having two windings connect to the same bus). The AL2W transformer however, since it is always two-winding, follows the f_connections/t_connections pattern.

+Connecting Components · PowerModelsDistribution

Connecting Components

One of the main goals of a network model, is specifying how constituent components are connected together. The patterns explained here, are equally applicable to the engineering and mathematical data model.

The available connections of each component connect to bus terminals. Take for example a bus with four terminals, terminals=["a","b","c","n"].

Node objects

Node objects always connect to a single bus (and perhaps also the universal ground, as can be the case for shunts). Therefore, they always have at least two key fields controlling the connectivity: bus and connections. Most node objects also have a configuration field, which affects the interpretation of the values supplied in connections. We will illustrate this for loads below.

Loads

A multi-phase load consists of several individual loads, the number of which is implied by the length of properties such as pd_nom, qd_nom etc. The table below illustrates how the length of the field connections and the value of the field configuration determines the layout of the load.

connectionsconfiguration==WYEconfiguration==DELTA
22 connections, wye2 connections, delta
33 connections, wye3 connections, delta
44 connections, wyeundefined

For example, we wish to connect a wye-connected load consisting of 2 individual loads (|connections|=3 and configuration=WYE) to our example bus with four available terminals. If we specify connections=["a","c","n"], this leads to

loads connection example.

Edge objects

Edge objects connect two buses (except for generic transformers, which can connect N buses). Therefore, they have the fields

  • f_bus and f_connections, specifying the from-side bus and how the object connects to it;
  • t_bus and t_connections, specifying the same for the to-side.

Lines

A line can have a variable number of conductors, which is implied by the size of the fields rs, xs, g_fr, b_fr, g_to and b_to. The fields f_connections and t_connections should specify for each conductor, to which terminals it connects. The figure below illustrates this for a line with 2 conductors,

line connection example.

Transformers

Transformers also have a configuration field. For

  • generic transformers, this is specified per winding, and configuration is therefore a vector of ConnConfig enums (WYE or DELTA);
  • AL2W transformers however are always two-winding, and the secondary is always wye-connected. Therefore, configuration is a scalar, specifying the configuration of the from-side winding.

Generic transformers have a field buses, a Vector containing the buses to which each winding connects respectively (these do not have to be unique; a split-phase transformer is typically represented by having two windings connect to the same bus). The AL2W transformer however, since it is always two-winding, follows the f_connections/t_connections pattern.

diff --git a/dev/manual/eng-data-model.html b/dev/manual/eng-data-model.html index de67097f2..bda90e707 100644 --- a/dev/manual/eng-data-model.html +++ b/dev/manual/eng-data-model.html @@ -9,4 +9,4 @@ ... ), ... -)

Valid component types are those that are documented in the sections below. Each component object is identified by an id, which must be a string (id <: String), but id does not appear inside of the component dictionary, and only appears as keys to the component dictionaries under each component type. Note that this requirement is so that data structures will be JSON serializable.

Each edge or node component (i.e. all those that are not data objects or buses), is expected to have status fields to specify whether the component is active or disabled, bus or f_bus and t_bus, to specify the buses that are connected to the component, and connections or f_connections and t_connections, to specify the terminals of the buses that are actively connected in an ordered list. NOTE: terminals, connections, f_connections, and t_connections, must be type Vector{Int}.

Parameter values on components are expected to be specified in SI units by default (where applicable) in the engineering data model. Relevant expected units are noted in the sections below. It is possible for the user to select universal scalar factors for power and voltages. For example, if power_scalar_factor and voltage_scalar_factor are their default values given below, where units is listed as watt or var, real units will be kW and kvar. Where units are listed as volt, real units will be kV (multiplied by vm_nom, where that value exists).

The Used column describes the situations where certain parameters are used. "always" indicates those values are used in all contexts, opf, mld, or any other problem name abbreviation indicate they are used in particular for those problems. "solution" indicates that those parameters are outputs from the solvers. "multinetwork" indicates these values are only used to build multinetwork problems.

Those parameters that have a default may be omitted by the user from the data model, they will be populated by the specified default values.

Components that support "codes", such as lines, switches, and transformers, behave such that any property on said object that conflicts with a value in the code will override the value given in the code object. This is noted on each object where this is relevant.

Root-Level Properties

At the root level of the data structure, the following fields can be found.

NameDefaultTypeUsedDescription
nameStringCase name
data_modelENGINEERINGDataModelalwaysENGINEERING, MATHEMATICAL, or DSS. Type of the data model (this document describes data_model==ENGINEERING)
settingsDict()Dict{String,<:Any}alwaysBase settings for the data model, see Settings section below for details

Settings (settings)

At the root-level of the data model a settings dictionary object is expected, containing the following fields.

NameDefaultTypeUnitsUsedDescription
voltage_scale_factor1e3RealalwaysScalar multiplier for voltage values
power_scale_factor1e3RealalwaysScalar multiplier for power values
vbases_defaultDict{String,Real}alwaysInstruction to set the vbase at a number of buses for non-dimensionalization
sbase_defaultRealalwaysInstruction to set the power base for non-dimensionalization
base_frequency60.0RealHzalwaysFrequency base, i.e. the base frequency of the whole circuit

The parameters voltage_scale_factor and power_scale_factordetermine the base for all voltage and power parameters in this data model. For example,

where the mentioned fields vm_nom, pd_nom and qd_nom are sample voltage and power variables which are defined later.

On the other hand,vbase_default and sbase_default provide default values for a 'per unit' conversion; these do not affect the interpretation of the parameters in this model, like the scale factors do. Note that vbase_default is a Dict{Any,Real}, with pairs of bus ids and voltage magnitude levels, since in per unit conversion, the voltage base can change from bus to bus. The power base is the same everywhere, and therefore sbase_default has a single value.

Buses (bus)

The data model below allows us to include buses of arbitrary many terminals (i.e., more than the usual four). This would be useful for

NameDefaultTypeUnitsUsedDescription
terminals[1,2,3,4]Vector{Int}alwaysTerminals for which the bus has active connections
vm_lbVector{Real}voltopfMinimum conductor-to-ground voltage magnitude, size=nphases
vm_ubVector{Real}voltopfMaximum conductor-to-ground voltage magnitude, size=nphases
vm_pair_ubVector{Tuple}opfe.g. [(1,2,210)] means |U1-U2|>210
vm_pair_lbVector{Tuple}opfe.g. [(1,2,230)] means |U1-U2|<230
grounded[]Vector{Int}alwaysList of terminals which are grounded
rg[]Vector{Real}alwaysResistance of each defined grounding, size=length(grounded)
xg[]Vector{Real}alwaysReactance of each defined grounding, size=length(grounded)
vmVector{Real}voltalwaysVoltage magnitude at bus. If set, voltage magnitude at bus is fixed
vaVector{Real}degreealwaysVoltage angle at bus. If set, voltage angle at bus is fixed
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

Each terminal c of the bus has an associated complex voltage phasor v[c]. There are two types of voltage magnitude bounds. The first type bounds the voltage magnitude of each v[c] individually,

However, especially in four-wire networks, bounds are more naturally imposed on the difference of two terminal voltages instead, e.g. for terminals c and d,

This is why we introduce the fields vm_pair_lb and vm_pair_ub, which define bounds for pairs of terminals,

Finally, we give an example of how grounding impedances should be entered. If terminal 4 is grounded through an impedance Z=1+j2, we write

Special Case: three-phase bus

For three-phase buses, instead of specifying bounds explicitly for each pair of windings, often we want to specify 'phase-to-phase', 'phase-to-neutral' and 'neutral-to-ground' bounds. This can be done conveniently with a number of additional fields. First, phases is a list of the phase terminals, and neutral designates a single terminal to be the neutral.

If all of these are specified, these bounds also imply valid bounds for the individual voltage magnitudes,

Instead of defining the bounds directly, they can be specified through an associated voltage zone.

NameDefaultTypeUnitsUsedDescription
phasesVector{Int}alwaysIdentifies the terminal that represents the neutral conductor
neutralIntalwaysIdentifies the terminal that represents the neutral conductor
vm_pn_lbRealopfMinimum phase-to-neutral voltage magnitude for all phases
vm_pn_ubRealopfMaximum phase-to-neutral voltage magnitude for all phases
vm_pp_lbRealopfMinimum phase-to-phase voltage magnitude for all phases
vm_pp_ubRealopfMaximum phase-to-phase voltage magnitude for all phases
vm_ng_ubRealopfMaximum neutral-to-ground voltage magnitude

Edge Objects

These objects represent edges on the power grid and therefore require f_bus and t_bus (or buses in the case of transformers), and f_connections and t_connections (or connections in the case of transformers).

Lines (line)

This is a pi-model branch. When a linecode is given, and any of rs, xs, b_fr, b_to, g_fr or g_to are specified, any of those overwrite the values on the linecode.

NameDefaultTypeUnitsUsedDescription
f_busStringalwaysid of from-side bus connection
t_busStringalwaysid of to-side bus connection
f_connectionsVector{Int}alwaysIndicates for each conductor, to which terminal of the f_bus it connects
t_connectionsVector{Int}alwaysIndicates for each conductor, to which terminal of the t_bus it connects
linecodeStringalwaysid of an associated linecode
rsMatrix{Real}ohm/meteralwaysSeries resistance matrix, size=(nconductors,nconductors)
xsMatrix{Real}ohm/meteralwaysSeries reactance matrix, size=(nconductors,nconductors)
g_frzeros(nconductors, nconductors)Matrix{Real}siemens/meter/HzalwaysFrom-side conductance, size=(nconductors,nconductors)
b_frzeros(nconductors, nconductors)Matrix{Real}siemens/meter/HzalwaysFrom-side susceptance, size=(nconductors,nconductors)
g_tozeros(nconductors, nconductors)Matrix{Real}siemens/meter/HzalwaysTo-side conductance, size=(nconductors,nconductors)
b_tozeros(nconductors, nconductors)Matrix{Real}siemens/meter/HzalwaysTo-side susceptance, size=(nconductors,nconductors)
length1.0RealmeteralwaysLength of the line
cm_ubVector{Real}ampopfSymmetrically applicable current rating, size=nconductors
sm_ubVector{Real}wattopfSymmetrically applicable power rating, size=nconductors
vad_lbVector{Real}degreeopfVoltage angle difference lower bound
vad_ubVector{Real}degreeopfVoltage angle difference upper bound
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively

Transformers (transformer)

These are n-winding (nwinding), n-phase (nphase), lossy transformers. Note that most properties are now Vectors (or Vectors of Vectors), indexed over the windings.

NameDefaultTypeUnitsUsedDescription
busVector{String}alwaysList of bus for each winding, size=nwindings
connectionsVector{Vector{Int}}alwaysList of connection for each winding, size=((nconductors),nwindings)
configurationsfill(WYE, nwindings)Vector{ConnConfig}alwaysWYE or DELTA. List of configuration for each winding, size=nwindings
xfmrcodeStringalwaysid of
xsczeros(nwindings*(nwindings-1)/2)Vector{Real}sm_nom[1]alwaysList of short-circuit reactances between each pair of windings, relative to the VA rating of the first winding; enter as a list of the upper-triangle elements
rwzeros(nwindings)Vector{Real}sm_nom[1]alwaysActive power lost due to resistance of each winding, relative to the VA rating of each winding winding
cmag0.0Realsm_nom[1]alwaysTotal no-load reactive power drawn by the transformer, relative to VA rating of the first winding (magnetizing current)
noloadloss0.0Realsm_nom[1]alwaysTotal no-load active power drawn by the transformer, relative to VA rating of the first winding
tm_nomones(nwindings)Vector{Real}alwaysNominal tap ratio for the transformer, size=nwindings (multiplier)
tm_ubVector{Vector{Real}}opfMaximum tap ratio for each winding and phase, size=((nphases),nwindings) (base=tm_nom)
tm_lbVector{Vector{Real}}opfMinimum tap ratio for for each winding and phase, size=((nphases),nwindings) (base=tm_nom)
tm_setfill(fill(1.0,nphases),nwindings)Vector{Vector{Real}}alwaysSet tap ratio for each winding and phase, size=((nphases),nwindings) (base=tm_nom)
tm_fixfill(fill(true,nphases),nwindings)Vector{Vector{Bool}}oltcIndicates for each winding and phase whether the tap ratio is fixed, size=((nphases),nwindings)
polarityfill(1,nwindings)Vector{Int}always
vm_nomVector{Real}voltalways
sm_nomVector{Real}wattalways
sm_ubRealwattopfRating for the total apparent power magnitude at each winding
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively

Asymmetric, Lossless, Two-Winding (AL2W) Transformers (transformer)

Special case of the Generic transformer, which is still a transformer object, but has a simplified method for its definition. These are transformers are asymmetric (A), lossless (L) and two-winding (2W). Asymmetric refers to the fact that the secondary is always has a WYE configuration, whilst the primary can be DELTA. The table below indicates alternate, more simple ways to specify the special case of an AL2W Transformer. xsc and rw cannot be specified for an AL2W transformer, because it is lossless. To use this definition format, all of f_bus, t_bus, f_connections, t_connections, and configuration must be used, and none of buses, connections, configurations may be used. xfmrcode is ignored for this component.

NameDefaultTypeUnitsUsedDescription
f_busStringalwaysAlternative way to specify buses, requires both f_bus and t_bus
t_busStringalwaysAlternative way to specify buses, requires both f_bus and t_bus
f_connectionsVector{Int}alwaysAlternative way to specify connections, requires both f_connections and t_connections, size=nphases
t_connectionsVector{Int}alwaysAlternative way to specify connections, requires both f_connections and t_connections, size=nphases
configurationWYEConnConfigalwaysWYE or DELTA. Alternative way to specify the from-side configuration, to-side is always WYE
tm_nom1.0RealalwaysNominal tap ratio for the transformer (multiplier)
tm_ubVector{Real}opfMaximum tap ratio for each phase (base=tm_nom), size=nphases
tm_lbVector{Real}opfMinimum tap ratio for each phase (base=tm_nom), size=nphases
tm_setfill(1.0,nphases)Vector{Real}alwaysSet tap ratio for each phase (base=tm_nom), size=nphases
tm_fixfill(true,nphases)Vector{Bool}oltcIndicates for each phase whether the tap ratio is fixed, size=nphases
sm_ubRealopfRating for the total apparent power magnitude at each winding

Transformers with voltage regulator control (controls)

Special case of the Generic transformer, which is part of the transformer object, and emulates a standard utility voltage regulator. The taps of these transformers can be controlled by modelling a line drop compensator.

NameDefaultTypeUnitsUsedDescription
vregVector{Vector{Real}}voltoltcVoltage regulator reference, default value is 120.0 for the controlled winding, 0.0 for winding without regulator control, size=((nphases),nwindings)
bandVector{Vector{Real}}voltoltcVoltage bandwidth, default value is 3.0 for the controlled winding, 0.0 for winding without regulator control, size=((nphases),nwindings)
ptratioVector{Vector{Real}}oltcVoltage ratio of the potential transformer, default value is 60.0 for the controlled winding, 0.0 for winding without regulator control, size=((nphases),nwindings)
ctprimVector{Vector{Real}}ampoltcCurrent transformer rating on primary side, default value is 300.0 for the controlled winding, 0.0 for winding without regulator control, size=((nphases),nwindings)
rVector{Vector{Real}}voltoltcResistance setting on line drop compensator, default value is 0.0 for both controlled winding and winding without regulator control, size=((nphases),nwindings)
xVector{Vector{Real}}voltoltcReactance setting on line drop compensator, default value is 0.0 for both controlled winding and winding without regulator control, size=((nphases),nwindings)

Switches (switch)

Switches without rs, xs or a linecode (conductance/susceptance not considered), defined the switch will be treated as lossless. If lossy parameters are defined, switch objects will be decomposed into virtual branch & bus, and an ideal switch.

NameDefaultTypeUnitsUsedDescription
f_busStringalwaysid of from-side bus connection
t_busStringalwaysid of to-side bus connection
f_connectionsVector{Int}alwaysIndicates for each conductor, to which terminal of the f_bus it connects
t_connectionsVector{Int}alwaysIndicates for each conductor, to which terminal of the t_bus it connects
cm_ubVector{Real}ampopfSymmetrically applicable current rating
sm_ubVector{Real}wattopfSymmetrically applicable power rating
linecodeStringalwaysid of an associated linecode, does not take into account conductance/susceptance
rszeros(nphases,nphases)Matrix{Real}ohmalwaysSeries resistance matrix, size=(nphases,nphases)
xszeros(nphases,nphases)Matrix{Real}ohmalwaysSeries reactance matrix, size=(nphases,nphases)
dispatchableNODispatchableNO or YES, indicates whether switch state can be changed in a switching optimization problem
stateCLOSEDSwitchStatealwaysCLOSED: closed or OPEN: open, to indicate state of switch
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively

Node Objects

These are objects that have single bus connections. Every object will have at least bus, connections, and status.

Shunts (shunt)

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
gsMatrix{Real}siemensalwaysConductance, size=(nconductors,nconductors)
bsMatrix{Real}siemensalwaysSusceptance, size=(nconductors,nconductors)
modelGENERICShuntModelGENERIC, CAPACITOR, or REACTOR. Indicates the type of shunt which may be necessary for transient stability analysis
dispatchableNODispatchablemldNO or YES, indicates whether a shunt can be shed
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,Any}multinetworkDictionary containing time series parameters.

Shunts with capacitor control (controls)

Special case of the shunt capacitors, which is part of the shunt object, and emulates a typical utility capacitor control (CapControl) by sending switching messages.

NameDefaultTypeUnitsUsedDescription
typeVector{String}capcControl type, default is current for controlled phase, `for uncontrolled phase,size=1forkvartype, otherwisesize=(nphases)`
elementStringcapcsource_id of element (typically line or transformer) to which CapControl is connected
terminalVector{Int}capcNumber of the terminal of circuit element to which CapControl is connected, default is 1 for controlled phase, 0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)
onsettingVector{Real}capcValue at which the CapControl switches the capacitor on, default is 300.0 for controlled phase, 0.0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)
offsettingVector{Real}capcValue at which the CapControl switches the capacitor off, default is 200.0 for controlled phase, 0.0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)
voltoverrideVector{Bool}capcIndicate whether voltage over ride is enabled, default is false for both controlled and uncontrolled phases, size=1 for kvar type, otherwise size=(nphases)
ptratioVector{Real}capcRatio of potential transformer, default is 60.0 for controlled phase, 0.0 for uncontrolled phase, size=(nphases)
ctratioVector{Real}capcRatio of current transformer, default is 60.0 for controlled phase, 0.0 for uncontrolled phase, size=(nphases)
vminVector{Real}voltcapcMinimum voltage below which CapControl switches the capacitor on, default is 115.0 for controlled phase, 0.0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)
vmaxVector{Real}voltcapcMaximum voltage above which CapControl switches the capacitor off, default is 126.0 for controlled phase, 0.0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)

Loads (load)

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
modelPOWERLoadModelalwaysPOWER, IMPEDANCE, CURRENT, EXPONENTIAL, or ZIP. Indicates the type of voltage-dependency
pd_nomVector{Real}wattalwaysNominal active load, with respect to vm_nom, size=nphases
qd_nomVector{Real}varalwaysNominal reactive load, with respect to vm_nom, size=nphases
vm_nomRealvoltmodel!=POWERNominal voltage (multiplier)
dispatchableNODispatchablemldNO or YES, indicates whether a load can be shed
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

Multi-phase loads define a number of individual loads connected between two terminals each. How they are connected, is defined both by configuration and connections. The table below indicates the value of configuration and lengths of the other properties for a consistent definition,

configurationconnectionspd_nom | qd_nom | pd_exp
DELTA21
DELTA33
WYE21
WYE32
WYENN-1

Note that for delta loads, only 2 and 3 connections are allowed. Each individual load i is connected between two terminals, exposed to a voltage magnitude v[i], which leads to a consumption pd[i]+j*qd[i]. The model then defines the relationship between these quantities,

modelpd[i]/pd_nom[i]=qd[i]/qd_nom[i]=
POWER11
CURRENT(v[i]/vm_nom)(v[i]/vm_nom)
IMPEDANCE(v[i]/vm_nom)^2(v[i]/vm_nom)^2

Two more model types are supported, which need additional fields and are defined below.

model == EXPONENTIAL

NameDefaultTypeUnitsUsedDescription
pd_expRealmodel==EXPONENTIAL
qd_expRealmodel==EXPONENTIAL

model == ZIP

ZIP load models are split into IMPEDANCE, CURRENT, POWER models.

NameDefaultTypeUnitsUsedDescription
zipvVector{Real}model==ZIPFirst 3 are ZIP weighting factors for active power (pd_cz,pd_ci,pd_cp), next 3 are ZIP weighting factors for reactive power (qd_cz,qd_ci,qd_cp), last 1 is cut-off voltage in p.u. of base kV; load is 0 below this cut-off

Generators (generator)

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
vgVector{Real}voltcontrol_mode==ISOCHRONOUSVoltage magnitude setpoint
pg_lbzeros(nphases)Vector{Real}wattopfLower bound on active power generation per phase, size=nphases
pg_ubfill(Inf, nphases)Vector{Real}wattopfUpper bound on active power generation per phase, size=nphases
qg_lb-pg_ubVector{Real}varopfLower bound on reactive power generation per phase, size=nphases
qg_ubpg_ubVector{Real}varopfUpper bound on reactive power generation per phase, size=nphases
pgVector{Real}wattsolutionPresent active power generation per phase, size=nphases
qgVector{Real}varsolutionPresent reactive power generation per phase, size=nphases
control_modeFREQUENCYDROOPControlModeFREQUENCYDROOP or ISOCHRONOUS
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

generator Cost Model

The generator cost model is currently specified by the following fields.

NameDefaultTypeUnitsUsedDescription
cost_pg_model2IntopfCost model type, 1 = piecewise-linear, 2 = polynomial
cost_pg_parameters[0.0, 1.0, 0.0]Vector{Real}/MVAopfCost model polynomial

Photovoltaic Systems (solar)

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
pg_lbVector{Real}wattopfLower bound on active power generation per phase, size=nphases
pg_ubVector{Real}wattopfUpper bound on active power generation per phase, size=nphases
qg_lbVector{Real}varopfLower bound on reactive power generation per phase, size=nphases
qg_ubVector{Real}varopfUpper bound on reactive power generation per phase, size=nphases
pgVector{Real}wattsolutionPresent active power generation per phase, size=nphases
qgVector{Real}varsolutionPresent reactive power generation per phase, size=nphases
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

solar Cost Model

The cost model for a photovoltaic system currently matches that of generators.

NameDefaultTypeUnitsUsedDescription
cost_pg_model2IntopfCost model type, 1 = piecewise-linear, 2 = polynomial
cost_pg_parameters[0.0, 1.0, 0.0]Vector{Real}/MVAopfCost model polynomial

Wind Turbine Systems (wind)

Wind turbine systems are most closely approximated by induction machines, also known as asynchronous machines. These are not currently supported, but there is plans to support them in the future.

Storage (storage)

A storage object is a flexible component that can represent a variety of energy storage objects, like Li-ion batteries, hydrogen fuel cells, flywheels, etc.

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
energyRealwatt-hralwaysStored energy
energy_ubRealopfmaximum energy rating
charge_ubRealopfmaximum charge rating
discharge_ubRealopfmaximum discharge rating
sm_ubRealwattopfPower rating,
cm_ubRealampopfCurrent rating,
charge_efficiencyRealpercentalwayscharging efficiency (losses)
discharge_efficiencyRealpercentalwaysdischarging efficiency (losses)
qs_ubRealopfMaximum reactive power injection,
qs_lbRealopfMinimum reactive power injection,
rsRealohmalwaysconverter resistance
xsRealohmalwaysconverter reactance
pexRealalwaysTotal active power standby exogenous flow (loss)
qexRealalwaysTotal reactive power standby exogenous flow (loss)
psVector{Real}wattsolutionPresent active power injection
qsVector{Real}varsolutionPresent reactive power injection
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

Voltage Sources (voltage_source)

A voltage source is a source of power at a set voltage magnitude and angle connected to a slack bus. If rs or xs are not specified, the voltage source is assumed to be lossless, otherwise virtual branch and bus will be created in the mathematical model to represent the internal losses of the voltage source.

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
vmones(nphases)Vector{Real}voltalwaysVoltage magnitude set at slack bus, size=nphases
vazeros(nphases)RealdegreealwaysVoltage angle offsets at slack bus, applies symmetrically to each phase angle
rszeros(nconductors,nconductors)Matrix{Real}ohmalwaysInternal series resistance of voltage source, size=(nconductors,nconductors)
xszeros(nconductors,nconductors)Matrix{Real}ohmalwaysInternal series reactance of voltage soure, size=(nconductors,nconductors)
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

Data Objects (codes, time series, etc.)

These objects are referenced by node and edge objects, but are not part of the network themselves, only containing data.

Linecodes (linecode)

Linecodes are easy ways to specify properties common to multiple lines.

NameDefaultTypeUnitsUsedDescription
rsMatrix{Real}ohm/meteralwaysSeries resistance, size=(nconductors,nconductors)
xsMatrix{Real}ohm/meteralwaysSeries reactance, size=(nconductors,nconductors)
g_frzeros(nconductors,nconductors)Matrix{Real}siemens/meter/HzalwaysFrom-side conductance, size=(nconductors,nconductors)
b_frzeros(nconductors,nconductors)Matrix{Real}siemens/meter/HzalwaysFrom-side susceptance, size=(nconductors,nconductors)
g_tozeros(nconductors,nconductors)Matrix{Real}siemens/meter/HzalwaysTo-side conductance, size=(nconductors,nconductors)
b_tozeros(nconductors,nconductors)Matrix{Real}siemens/meter/HzalwaysTo-side susceptance, size=(nconductors,nconductors)
cm_ubfill(Inf,nconductors)Vector{Real}ampereopfmaximum current per conductor, symmetrically applicable
sm_ubfill(Inf,nconductors)Vector{Real}wattopfmaximum power per conductor, symmetrically applicable

Transformer Codes (xfmrcode)

Transformer codes are easy ways to specify properties common to multiple transformers

NameDefaultTypeUnitsUsedDescription
configurationsfill(WYE, nwindings)Vector{ConnConfig}alwaysWYE or DELTA. List of configuration for each winding, size=nwindings
xsc[0.0]Vector{Real}ohmalwaysList of short-circuit reactances between each pair of windings; enter as a list of the upper-triangle elements, size=(nwindings == 2 ? 1 : 3)
rwzeros(nwindings)Vector{Real}ohmalwaysList of the winding resistance for each winding, size=nwindings
tm_nomones(nwindings)Vector{Real}alwaysNominal tap ratio for the transformer, size=nwindings (multiplier)
tm_ubVector{Vector{Real}}opfMaximum tap ratio for each winding and phase, size=((nphases), nwindings) (base=tm_nom)
tm_lbVector{Vector{Real}}opfMinimum tap ratio for for each winding and phase, size=((nphases), nwindings) (base=tm_nom)
tm_setfill(fill(1.0, nphases), nwindings)Vector{Vector{Real}}alwaysSet tap ratio for each winding and phase, size=((nphases), nwindings) (base=tm_nom)
tm_fixfill(fill(true, nphases), nwindings)Vector{Vector{Bool}}alwaysIndicates for each winding and phase whether the tap ratio is fixed, size=((nphases), nwindings)

Time Series (time_series)

Time series objects are used to specify time series for e.g. load or generation forecasts.

Some parameters for components specified in this document can support a time series by inserting a reference to a time_series object into the time_series dictionary inside a component under the relevant parameter name. For example, for a load, if pd_nom is supposed to be a time series, the user would specify "time_series" => Dict("pd_nom" => time_series_id) where time_series_id is the id of an object in time_series, and has type Any.

NameDefaultTypeUnitsUsedDescription
timeUnion{Vector{Real},Vector{String}}houralwaysTime points at which values are specified. If time is specified in String, units not required to be in hours.
valuesVector{Real}alwaysMultipers at each time step given in time
offset0RealhouralwaysStart time offset
replacetrueBoolalwaysIndicates to replace with data, instead of multiply. Will only work on non-Array data

Fuses (fuse)

Fuses can be defined on any terminal of any physical component

NameDefaultTypeUnitsUsedDescription
component_typeString
component_idString
terminalsVector{Int}
fuse_curveArray{Vector{Real},2}specifies the fuse blowing condition
minimum_melting_curveArray{Vector{Real},2}specifies the minimum melting conditions of the fuse
+)

Valid component types are those that are documented in the sections below. Each component object is identified by an id, which must be a string (id <: String), but id does not appear inside of the component dictionary, and only appears as keys to the component dictionaries under each component type. Note that this requirement is so that data structures will be JSON serializable.

Each edge or node component (i.e. all those that are not data objects or buses), is expected to have status fields to specify whether the component is active or disabled, bus or f_bus and t_bus, to specify the buses that are connected to the component, and connections or f_connections and t_connections, to specify the terminals of the buses that are actively connected in an ordered list. NOTE: terminals, connections, f_connections, and t_connections, must be type Vector{Int}.

Parameter values on components are expected to be specified in SI units by default (where applicable) in the engineering data model. Relevant expected units are noted in the sections below. It is possible for the user to select universal scalar factors for power and voltages. For example, if power_scalar_factor and voltage_scalar_factor are their default values given below, where units is listed as watt or var, real units will be kW and kvar. Where units are listed as volt, real units will be kV (multiplied by vm_nom, where that value exists).

The Used column describes the situations where certain parameters are used. "always" indicates those values are used in all contexts, opf, mld, or any other problem name abbreviation indicate they are used in particular for those problems. "solution" indicates that those parameters are outputs from the solvers. "multinetwork" indicates these values are only used to build multinetwork problems.

Those parameters that have a default may be omitted by the user from the data model, they will be populated by the specified default values.

Components that support "codes", such as lines, switches, and transformers, behave such that any property on said object that conflicts with a value in the code will override the value given in the code object. This is noted on each object where this is relevant.

Root-Level Properties

At the root level of the data structure, the following fields can be found.

NameDefaultTypeUsedDescription
nameStringCase name
data_modelENGINEERINGDataModelalwaysENGINEERING, MATHEMATICAL, or DSS. Type of the data model (this document describes data_model==ENGINEERING)
settingsDict()Dict{String,<:Any}alwaysBase settings for the data model, see Settings section below for details

Settings (settings)

At the root-level of the data model a settings dictionary object is expected, containing the following fields.

NameDefaultTypeUnitsUsedDescription
voltage_scale_factor1e3RealalwaysScalar multiplier for voltage values
power_scale_factor1e3RealalwaysScalar multiplier for power values
vbases_defaultDict{String,Real}alwaysInstruction to set the vbase at a number of buses for non-dimensionalization
sbase_defaultRealalwaysInstruction to set the power base for non-dimensionalization
base_frequency60.0RealHzalwaysFrequency base, i.e. the base frequency of the whole circuit

The parameters voltage_scale_factor and power_scale_factordetermine the base for all voltage and power parameters in this data model. For example,

where the mentioned fields vm_nom, pd_nom and qd_nom are sample voltage and power variables which are defined later.

On the other hand,vbase_default and sbase_default provide default values for a 'per unit' conversion; these do not affect the interpretation of the parameters in this model, like the scale factors do. Note that vbase_default is a Dict{Any,Real}, with pairs of bus ids and voltage magnitude levels, since in per unit conversion, the voltage base can change from bus to bus. The power base is the same everywhere, and therefore sbase_default has a single value.

Buses (bus)

The data model below allows us to include buses of arbitrary many terminals (i.e., more than the usual four). This would be useful for

NameDefaultTypeUnitsUsedDescription
terminals[1,2,3,4]Vector{Int}alwaysTerminals for which the bus has active connections
vm_lbVector{Real}voltopfMinimum conductor-to-ground voltage magnitude, size=nphases
vm_ubVector{Real}voltopfMaximum conductor-to-ground voltage magnitude, size=nphases
vm_pair_ubVector{Tuple}opfe.g. [(1,2,210)] means |U1-U2|>210
vm_pair_lbVector{Tuple}opfe.g. [(1,2,230)] means |U1-U2|<230
grounded[]Vector{Int}alwaysList of terminals which are grounded
rg[]Vector{Real}alwaysResistance of each defined grounding, size=length(grounded)
xg[]Vector{Real}alwaysReactance of each defined grounding, size=length(grounded)
vmVector{Real}voltalwaysVoltage magnitude at bus. If set, voltage magnitude at bus is fixed
vaVector{Real}degreealwaysVoltage angle at bus. If set, voltage angle at bus is fixed
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

Each terminal c of the bus has an associated complex voltage phasor v[c]. There are two types of voltage magnitude bounds. The first type bounds the voltage magnitude of each v[c] individually,

However, especially in four-wire networks, bounds are more naturally imposed on the difference of two terminal voltages instead, e.g. for terminals c and d,

This is why we introduce the fields vm_pair_lb and vm_pair_ub, which define bounds for pairs of terminals,

Finally, we give an example of how grounding impedances should be entered. If terminal 4 is grounded through an impedance Z=1+j2, we write

Special Case: three-phase bus

For three-phase buses, instead of specifying bounds explicitly for each pair of windings, often we want to specify 'phase-to-phase', 'phase-to-neutral' and 'neutral-to-ground' bounds. This can be done conveniently with a number of additional fields. First, phases is a list of the phase terminals, and neutral designates a single terminal to be the neutral.

If all of these are specified, these bounds also imply valid bounds for the individual voltage magnitudes,

Instead of defining the bounds directly, they can be specified through an associated voltage zone.

NameDefaultTypeUnitsUsedDescription
phasesVector{Int}alwaysIdentifies the terminal that represents the neutral conductor
neutralIntalwaysIdentifies the terminal that represents the neutral conductor
vm_pn_lbRealopfMinimum phase-to-neutral voltage magnitude for all phases
vm_pn_ubRealopfMaximum phase-to-neutral voltage magnitude for all phases
vm_pp_lbRealopfMinimum phase-to-phase voltage magnitude for all phases
vm_pp_ubRealopfMaximum phase-to-phase voltage magnitude for all phases
vm_ng_ubRealopfMaximum neutral-to-ground voltage magnitude

Edge Objects

These objects represent edges on the power grid and therefore require f_bus and t_bus (or buses in the case of transformers), and f_connections and t_connections (or connections in the case of transformers).

Lines (line)

This is a pi-model branch. When a linecode is given, and any of rs, xs, b_fr, b_to, g_fr or g_to are specified, any of those overwrite the values on the linecode.

NameDefaultTypeUnitsUsedDescription
f_busStringalwaysid of from-side bus connection
t_busStringalwaysid of to-side bus connection
f_connectionsVector{Int}alwaysIndicates for each conductor, to which terminal of the f_bus it connects
t_connectionsVector{Int}alwaysIndicates for each conductor, to which terminal of the t_bus it connects
linecodeStringalwaysid of an associated linecode
rsMatrix{Real}ohm/meteralwaysSeries resistance matrix, size=(nconductors,nconductors)
xsMatrix{Real}ohm/meteralwaysSeries reactance matrix, size=(nconductors,nconductors)
g_frzeros(nconductors, nconductors)Matrix{Real}siemens/meter/HzalwaysFrom-side conductance, size=(nconductors,nconductors)
b_frzeros(nconductors, nconductors)Matrix{Real}siemens/meter/HzalwaysFrom-side susceptance, size=(nconductors,nconductors)
g_tozeros(nconductors, nconductors)Matrix{Real}siemens/meter/HzalwaysTo-side conductance, size=(nconductors,nconductors)
b_tozeros(nconductors, nconductors)Matrix{Real}siemens/meter/HzalwaysTo-side susceptance, size=(nconductors,nconductors)
length1.0RealmeteralwaysLength of the line
cm_ubVector{Real}ampopfSymmetrically applicable current rating, size=nconductors
sm_ubVector{Real}wattopfSymmetrically applicable power rating, size=nconductors
vad_lbVector{Real}degreeopfVoltage angle difference lower bound
vad_ubVector{Real}degreeopfVoltage angle difference upper bound
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively

Transformers (transformer)

These are n-winding (nwinding), n-phase (nphase), lossy transformers. Note that most properties are now Vectors (or Vectors of Vectors), indexed over the windings.

NameDefaultTypeUnitsUsedDescription
busVector{String}alwaysList of bus for each winding, size=nwindings
connectionsVector{Vector{Int}}alwaysList of connection for each winding, size=((nconductors),nwindings)
configurationsfill(WYE, nwindings)Vector{ConnConfig}alwaysWYE or DELTA. List of configuration for each winding, size=nwindings
xfmrcodeStringalwaysid of
xsczeros(nwindings*(nwindings-1)/2)Vector{Real}sm_nom[1]alwaysList of short-circuit reactances between each pair of windings, relative to the VA rating of the first winding; enter as a list of the upper-triangle elements
rwzeros(nwindings)Vector{Real}sm_nom[1]alwaysActive power lost due to resistance of each winding, relative to the VA rating of each winding winding
cmag0.0Realsm_nom[1]alwaysTotal no-load reactive power drawn by the transformer, relative to VA rating of the first winding (magnetizing current)
noloadloss0.0Realsm_nom[1]alwaysTotal no-load active power drawn by the transformer, relative to VA rating of the first winding
tm_nomones(nwindings)Vector{Real}alwaysNominal tap ratio for the transformer, size=nwindings (multiplier)
tm_ubVector{Vector{Real}}opfMaximum tap ratio for each winding and phase, size=((nphases),nwindings) (base=tm_nom)
tm_lbVector{Vector{Real}}opfMinimum tap ratio for for each winding and phase, size=((nphases),nwindings) (base=tm_nom)
tm_setfill(fill(1.0,nphases),nwindings)Vector{Vector{Real}}alwaysSet tap ratio for each winding and phase, size=((nphases),nwindings) (base=tm_nom)
tm_fixfill(fill(true,nphases),nwindings)Vector{Vector{Bool}}oltcIndicates for each winding and phase whether the tap ratio is fixed, size=((nphases),nwindings)
polarityfill(1,nwindings)Vector{Int}always
vm_nomVector{Real}voltalways
sm_nomVector{Real}wattalways
sm_ubRealwattopfRating for the total apparent power magnitude at each winding
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively

Asymmetric, Lossless, Two-Winding (AL2W) Transformers (transformer)

Special case of the Generic transformer, which is still a transformer object, but has a simplified method for its definition. These are transformers are asymmetric (A), lossless (L) and two-winding (2W). Asymmetric refers to the fact that the secondary is always has a WYE configuration, whilst the primary can be DELTA. The table below indicates alternate, more simple ways to specify the special case of an AL2W Transformer. xsc and rw cannot be specified for an AL2W transformer, because it is lossless. To use this definition format, all of f_bus, t_bus, f_connections, t_connections, and configuration must be used, and none of buses, connections, configurations may be used. xfmrcode is ignored for this component.

NameDefaultTypeUnitsUsedDescription
f_busStringalwaysAlternative way to specify buses, requires both f_bus and t_bus
t_busStringalwaysAlternative way to specify buses, requires both f_bus and t_bus
f_connectionsVector{Int}alwaysAlternative way to specify connections, requires both f_connections and t_connections, size=nphases
t_connectionsVector{Int}alwaysAlternative way to specify connections, requires both f_connections and t_connections, size=nphases
configurationWYEConnConfigalwaysWYE or DELTA. Alternative way to specify the from-side configuration, to-side is always WYE
tm_nom1.0RealalwaysNominal tap ratio for the transformer (multiplier)
tm_ubVector{Real}opfMaximum tap ratio for each phase (base=tm_nom), size=nphases
tm_lbVector{Real}opfMinimum tap ratio for each phase (base=tm_nom), size=nphases
tm_setfill(1.0,nphases)Vector{Real}alwaysSet tap ratio for each phase (base=tm_nom), size=nphases
tm_fixfill(true,nphases)Vector{Bool}oltcIndicates for each phase whether the tap ratio is fixed, size=nphases
sm_ubRealopfRating for the total apparent power magnitude at each winding

Transformers with voltage regulator control (controls)

Special case of the Generic transformer, which is part of the transformer object, and emulates a standard utility voltage regulator. The taps of these transformers can be controlled by modelling a line drop compensator.

NameDefaultTypeUnitsUsedDescription
vregVector{Vector{Real}}voltoltcVoltage regulator reference, default value is 120.0 for the controlled winding, 0.0 for winding without regulator control, size=((nphases),nwindings)
bandVector{Vector{Real}}voltoltcVoltage bandwidth, default value is 3.0 for the controlled winding, 0.0 for winding without regulator control, size=((nphases),nwindings)
ptratioVector{Vector{Real}}oltcVoltage ratio of the potential transformer, default value is 60.0 for the controlled winding, 0.0 for winding without regulator control, size=((nphases),nwindings)
ctprimVector{Vector{Real}}ampoltcCurrent transformer rating on primary side, default value is 300.0 for the controlled winding, 0.0 for winding without regulator control, size=((nphases),nwindings)
rVector{Vector{Real}}voltoltcResistance setting on line drop compensator, default value is 0.0 for both controlled winding and winding without regulator control, size=((nphases),nwindings)
xVector{Vector{Real}}voltoltcReactance setting on line drop compensator, default value is 0.0 for both controlled winding and winding without regulator control, size=((nphases),nwindings)

Switches (switch)

Switches without rs, xs or a linecode (conductance/susceptance not considered), defined the switch will be treated as lossless. If lossy parameters are defined, switch objects will be decomposed into virtual branch & bus, and an ideal switch.

NameDefaultTypeUnitsUsedDescription
f_busStringalwaysid of from-side bus connection
t_busStringalwaysid of to-side bus connection
f_connectionsVector{Int}alwaysIndicates for each conductor, to which terminal of the f_bus it connects
t_connectionsVector{Int}alwaysIndicates for each conductor, to which terminal of the t_bus it connects
cm_ubVector{Real}ampopfSymmetrically applicable current rating
sm_ubVector{Real}wattopfSymmetrically applicable power rating
linecodeStringalwaysid of an associated linecode, does not take into account conductance/susceptance
rszeros(nphases,nphases)Matrix{Real}ohmalwaysSeries resistance matrix, size=(nphases,nphases)
xszeros(nphases,nphases)Matrix{Real}ohmalwaysSeries reactance matrix, size=(nphases,nphases)
dispatchableNODispatchableNO or YES, indicates whether switch state can be changed in a switching optimization problem
stateCLOSEDSwitchStatealwaysCLOSED: closed or OPEN: open, to indicate state of switch
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively

Node Objects

These are objects that have single bus connections. Every object will have at least bus, connections, and status.

Shunts (shunt)

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
gsMatrix{Real}siemensalwaysConductance, size=(nconductors,nconductors)
bsMatrix{Real}siemensalwaysSusceptance, size=(nconductors,nconductors)
modelGENERICShuntModelGENERIC, CAPACITOR, or REACTOR. Indicates the type of shunt which may be necessary for transient stability analysis
dispatchableNODispatchablemldNO or YES, indicates whether a shunt can be shed
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,Any}multinetworkDictionary containing time series parameters.

Shunts with capacitor control (controls)

Special case of the shunt capacitors, which is part of the shunt object, and emulates a typical utility capacitor control (CapControl) by sending switching messages.

NameDefaultTypeUnitsUsedDescription
typeVector{String}capcControl type, default is current for controlled phase, `for uncontrolled phase,size=1forkvartype, otherwisesize=(nphases)`
elementStringcapcsource_id of element (typically line or transformer) to which CapControl is connected
terminalVector{Int}capcNumber of the terminal of circuit element to which CapControl is connected, default is 1 for controlled phase, 0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)
onsettingVector{Real}capcValue at which the CapControl switches the capacitor on, default is 300.0 for controlled phase, 0.0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)
offsettingVector{Real}capcValue at which the CapControl switches the capacitor off, default is 200.0 for controlled phase, 0.0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)
voltoverrideVector{Bool}capcIndicate whether voltage over ride is enabled, default is false for both controlled and uncontrolled phases, size=1 for kvar type, otherwise size=(nphases)
ptratioVector{Real}capcRatio of potential transformer, default is 60.0 for controlled phase, 0.0 for uncontrolled phase, size=(nphases)
ctratioVector{Real}capcRatio of current transformer, default is 60.0 for controlled phase, 0.0 for uncontrolled phase, size=(nphases)
vminVector{Real}voltcapcMinimum voltage below which CapControl switches the capacitor on, default is 115.0 for controlled phase, 0.0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)
vmaxVector{Real}voltcapcMaximum voltage above which CapControl switches the capacitor off, default is 126.0 for controlled phase, 0.0 for uncontrolled phase, size=1 for kvar type, otherwise size=(nphases)

Loads (load)

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
modelPOWERLoadModelalwaysPOWER, IMPEDANCE, CURRENT, EXPONENTIAL, or ZIP. Indicates the type of voltage-dependency
pd_nomVector{Real}wattalwaysNominal active load, with respect to vm_nom, size=nphases
qd_nomVector{Real}varalwaysNominal reactive load, with respect to vm_nom, size=nphases
vm_nomRealvoltmodel!=POWERNominal voltage (multiplier)
dispatchableNODispatchablemldNO or YES, indicates whether a load can be shed
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

Multi-phase loads define a number of individual loads connected between two terminals each. How they are connected, is defined both by configuration and connections. The table below indicates the value of configuration and lengths of the other properties for a consistent definition,

configurationconnectionspd_nom | qd_nom | pd_exp
DELTA21
DELTA33
WYE21
WYE32
WYENN-1

Note that for delta loads, only 2 and 3 connections are allowed. Each individual load i is connected between two terminals, exposed to a voltage magnitude v[i], which leads to a consumption pd[i]+j*qd[i]. The model then defines the relationship between these quantities,

modelpd[i]/pd_nom[i]=qd[i]/qd_nom[i]=
POWER11
CURRENT(v[i]/vm_nom)(v[i]/vm_nom)
IMPEDANCE(v[i]/vm_nom)^2(v[i]/vm_nom)^2

Two more model types are supported, which need additional fields and are defined below.

model == EXPONENTIAL

NameDefaultTypeUnitsUsedDescription
pd_expRealmodel==EXPONENTIAL
qd_expRealmodel==EXPONENTIAL

model == ZIP

ZIP load models are split into IMPEDANCE, CURRENT, POWER models.

NameDefaultTypeUnitsUsedDescription
zipvVector{Real}model==ZIPFirst 3 are ZIP weighting factors for active power (pd_cz,pd_ci,pd_cp), next 3 are ZIP weighting factors for reactive power (qd_cz,qd_ci,qd_cp), last 1 is cut-off voltage in p.u. of base kV; load is 0 below this cut-off

Generators (generator)

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
vgVector{Real}voltcontrol_mode==ISOCHRONOUSVoltage magnitude setpoint
pg_lbzeros(nphases)Vector{Real}wattopfLower bound on active power generation per phase, size=nphases
pg_ubfill(Inf, nphases)Vector{Real}wattopfUpper bound on active power generation per phase, size=nphases
qg_lb-pg_ubVector{Real}varopfLower bound on reactive power generation per phase, size=nphases
qg_ubpg_ubVector{Real}varopfUpper bound on reactive power generation per phase, size=nphases
pgVector{Real}wattsolutionPresent active power generation per phase, size=nphases
qgVector{Real}varsolutionPresent reactive power generation per phase, size=nphases
control_modeFREQUENCYDROOPControlModeFREQUENCYDROOP or ISOCHRONOUS
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

generator Cost Model

The generator cost model is currently specified by the following fields.

NameDefaultTypeUnitsUsedDescription
cost_pg_model2IntopfCost model type, 1 = piecewise-linear, 2 = polynomial
cost_pg_parameters[0.0, 1.0, 0.0]Vector{Real}/MVAopfCost model polynomial

Photovoltaic Systems (solar)

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
pg_lbVector{Real}wattopfLower bound on active power generation per phase, size=nphases
pg_ubVector{Real}wattopfUpper bound on active power generation per phase, size=nphases
qg_lbVector{Real}varopfLower bound on reactive power generation per phase, size=nphases
qg_ubVector{Real}varopfUpper bound on reactive power generation per phase, size=nphases
pgVector{Real}wattsolutionPresent active power generation per phase, size=nphases
qgVector{Real}varsolutionPresent reactive power generation per phase, size=nphases
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

solar Cost Model

The cost model for a photovoltaic system currently matches that of generators.

NameDefaultTypeUnitsUsedDescription
cost_pg_model2IntopfCost model type, 1 = piecewise-linear, 2 = polynomial
cost_pg_parameters[0.0, 1.0, 0.0]Vector{Real}/MVAopfCost model polynomial

Wind Turbine Systems (wind)

Wind turbine systems are most closely approximated by induction machines, also known as asynchronous machines. These are not currently supported, but there is plans to support them in the future.

Storage (storage)

A storage object is a flexible component that can represent a variety of energy storage objects, like Li-ion batteries, hydrogen fuel cells, flywheels, etc.

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
energyRealwatt-hralwaysStored energy
energy_ubRealopfmaximum energy rating
charge_ubRealopfmaximum charge rating
discharge_ubRealopfmaximum discharge rating
sm_ubRealwattopfPower rating,
cm_ubRealampopfCurrent rating,
charge_efficiencyRealpercentalwayscharging efficiency (losses)
discharge_efficiencyRealpercentalwaysdischarging efficiency (losses)
qs_ubRealopfMaximum reactive power injection,
qs_lbRealopfMinimum reactive power injection,
rsRealohmalwaysconverter resistance
xsRealohmalwaysconverter reactance
pexRealalwaysTotal active power standby exogenous flow (loss)
qexRealalwaysTotal reactive power standby exogenous flow (loss)
psVector{Real}wattsolutionPresent active power injection
qsVector{Real}varsolutionPresent reactive power injection
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

Voltage Sources (voltage_source)

A voltage source is a source of power at a set voltage magnitude and angle connected to a slack bus. If rs or xs are not specified, the voltage source is assumed to be lossless, otherwise virtual branch and bus will be created in the mathematical model to represent the internal losses of the voltage source.

NameDefaultTypeUnitsUsedDescription
busStringalwaysid of bus connection
connectionsVector{Int}alwaysOrdered list of connected conductors, size=nconductors
configurationWYEConnConfigalwaysWYE or DELTA. If WYE, connections[end]=neutral
vmones(nphases)Vector{Real}voltalwaysVoltage magnitude set at slack bus, size=nphases
vazeros(nphases)RealdegreealwaysVoltage angle offsets at slack bus, applies symmetrically to each phase angle
rszeros(nconductors,nconductors)Matrix{Real}ohmalwaysInternal series resistance of voltage source, size=(nconductors,nconductors)
xszeros(nconductors,nconductors)Matrix{Real}ohmalwaysInternal series reactance of voltage soure, size=(nconductors,nconductors)
statusENABLEDStatusalwaysENABLED or DISABLED. Indicates if component is enabled or disabled, respectively
time_seriesDict{String,String}multinetworkDictionary containing time series parameters.

Data Objects (codes, time series, etc.)

These objects are referenced by node and edge objects, but are not part of the network themselves, only containing data.

Linecodes (linecode)

Linecodes are easy ways to specify properties common to multiple lines.

NameDefaultTypeUnitsUsedDescription
rsMatrix{Real}ohm/meteralwaysSeries resistance, size=(nconductors,nconductors)
xsMatrix{Real}ohm/meteralwaysSeries reactance, size=(nconductors,nconductors)
g_frzeros(nconductors,nconductors)Matrix{Real}siemens/meter/HzalwaysFrom-side conductance, size=(nconductors,nconductors)
b_frzeros(nconductors,nconductors)Matrix{Real}siemens/meter/HzalwaysFrom-side susceptance, size=(nconductors,nconductors)
g_tozeros(nconductors,nconductors)Matrix{Real}siemens/meter/HzalwaysTo-side conductance, size=(nconductors,nconductors)
b_tozeros(nconductors,nconductors)Matrix{Real}siemens/meter/HzalwaysTo-side susceptance, size=(nconductors,nconductors)
cm_ubfill(Inf,nconductors)Vector{Real}ampereopfmaximum current per conductor, symmetrically applicable
sm_ubfill(Inf,nconductors)Vector{Real}wattopfmaximum power per conductor, symmetrically applicable

Transformer Codes (xfmrcode)

Transformer codes are easy ways to specify properties common to multiple transformers

NameDefaultTypeUnitsUsedDescription
configurationsfill(WYE, nwindings)Vector{ConnConfig}alwaysWYE or DELTA. List of configuration for each winding, size=nwindings
xsc[0.0]Vector{Real}ohmalwaysList of short-circuit reactances between each pair of windings; enter as a list of the upper-triangle elements, size=(nwindings == 2 ? 1 : 3)
rwzeros(nwindings)Vector{Real}ohmalwaysList of the winding resistance for each winding, size=nwindings
tm_nomones(nwindings)Vector{Real}alwaysNominal tap ratio for the transformer, size=nwindings (multiplier)
tm_ubVector{Vector{Real}}opfMaximum tap ratio for each winding and phase, size=((nphases), nwindings) (base=tm_nom)
tm_lbVector{Vector{Real}}opfMinimum tap ratio for for each winding and phase, size=((nphases), nwindings) (base=tm_nom)
tm_setfill(fill(1.0, nphases), nwindings)Vector{Vector{Real}}alwaysSet tap ratio for each winding and phase, size=((nphases), nwindings) (base=tm_nom)
tm_fixfill(fill(true, nphases), nwindings)Vector{Vector{Bool}}alwaysIndicates for each winding and phase whether the tap ratio is fixed, size=((nphases), nwindings)

Time Series (time_series)

Time series objects are used to specify time series for e.g. load or generation forecasts.

Some parameters for components specified in this document can support a time series by inserting a reference to a time_series object into the time_series dictionary inside a component under the relevant parameter name. For example, for a load, if pd_nom is supposed to be a time series, the user would specify "time_series" => Dict("pd_nom" => time_series_id) where time_series_id is the id of an object in time_series, and has type Any.

NameDefaultTypeUnitsUsedDescription
timeUnion{Vector{Real},Vector{String}}houralwaysTime points at which values are specified. If time is specified in String, units not required to be in hours.
valuesVector{Real}alwaysMultipers at each time step given in time
offset0RealhouralwaysStart time offset
replacetrueBoolalwaysIndicates to replace with data, instead of multiply. Will only work on non-Array data

Fuses (fuse)

Fuses can be defined on any terminal of any physical component

NameDefaultTypeUnitsUsedDescription
component_typeString
component_idString
terminalsVector{Int}
fuse_curveArray{Vector{Real},2}specifies the fuse blowing condition
minimum_melting_curveArray{Vector{Real},2}specifies the minimum melting conditions of the fuse
diff --git a/dev/manual/eng2math.html b/dev/manual/eng2math.html index eff047689..2689fc8bd 100644 --- a/dev/manual/eng2math.html +++ b/dev/manual/eng2math.html @@ -1,2 +1,2 @@ -Conversion to Mathematical Model · PowerModelsDistribution

Engineering to Mathematical Data Model Mapping

In this document we define the mapping from the engineering data model down to the mathematical data model for each physical component.

bus objects

Buses are parsed into bus and potentially shunt objects.

The mathematical bus model contains only lossless connections to ground. All other connections to grounds are converted to equivalent shunts at that bus. For example, take a bus defined as

bus_eng = Dict("grounded"=>[4, 5], "rg"=>[1.0, 0.0], "xg"=>[2.0, 0.0],...).

This is equivalent to a shunt g+im*b = 1/(1.0+im*2.0) connected to terminal 4, and a lossless grounding at terminal 5 (since rg[2]==xg[2]==0.0). This is mapped to

bus_math = Dict("grounded"=>[5], ...),

shunt_math = Dict("connections"=>[4], "b"=>[b], "g"=>[g]...).

This simplifies the mathematical model, as the modeller does no longer have to consider lossy groundings explicitly.

line objects

Lines are parsed into branch objects with transformer=false

switch objects

Switches are parsed into switch. If there are loss parameters provided (i.e. rs and/or xs) then a virtual branch and virtual bus are created to model the impedance

transformer objects

A transformer can have N windings, each with its own configuration (delta or wye are supported). This is decomposed to a network of N lossless, two-winding transformers which connect to an internal loss model. The to-winding is always wye-connected, hence we refer to these transformers as 'asymmetric'.

The internal loss model is a function of

  • the winding resistance rw,
  • the short-circuit reactance xsc,
  • the no-load loss properties noloadloss (resistive) and magnetizing current imag (reactive).

If all of these are non-zero, this leads to an internal loss model consisting of N virtual buses, (N^2+N)/2 virtual branches, and 1 shunt. These virtual buses and branches are automatically merged and simplified whenever possible; e.g., when all these loss parameters are zero, this simplifies to a single virtual bus, to which all two-winding transformers connect.

For more detail, please refer to [upcoming technical paper]. #TODO add link to paper

shunt objects

Shunts are parsed directly into shunt objects.

load objects

Loads are parsed into load objects. See the discussion under the Load Model documentation on the sidebar, for a detailed discussion of the various load models.

generator objects

Generators are parsed into gen objects.

solar objects

Solar objects (photovoltaic systems) are parsed into gen objects.

voltage_source objects

Voltage sources are parsed into gen objects. If loss parameters are specified (i.e. rs and/or xs) then a virtual bus and branch are created to model the internal impedance.

+Conversion to Mathematical Model · PowerModelsDistribution

Engineering to Mathematical Data Model Mapping

In this document we define the mapping from the engineering data model down to the mathematical data model for each physical component.

bus objects

Buses are parsed into bus and potentially shunt objects.

The mathematical bus model contains only lossless connections to ground. All other connections to grounds are converted to equivalent shunts at that bus. For example, take a bus defined as

bus_eng = Dict("grounded"=>[4, 5], "rg"=>[1.0, 0.0], "xg"=>[2.0, 0.0],...).

This is equivalent to a shunt g+im*b = 1/(1.0+im*2.0) connected to terminal 4, and a lossless grounding at terminal 5 (since rg[2]==xg[2]==0.0). This is mapped to

bus_math = Dict("grounded"=>[5], ...),

shunt_math = Dict("connections"=>[4], "b"=>[b], "g"=>[g]...).

This simplifies the mathematical model, as the modeller does no longer have to consider lossy groundings explicitly.

line objects

Lines are parsed into branch objects with transformer=false

switch objects

Switches are parsed into switch. If there are loss parameters provided (i.e. rs and/or xs) then a virtual branch and virtual bus are created to model the impedance

transformer objects

A transformer can have N windings, each with its own configuration (delta or wye are supported). This is decomposed to a network of N lossless, two-winding transformers which connect to an internal loss model. The to-winding is always wye-connected, hence we refer to these transformers as 'asymmetric'.

The internal loss model is a function of

  • the winding resistance rw,
  • the short-circuit reactance xsc,
  • the no-load loss properties noloadloss (resistive) and magnetizing current imag (reactive).

If all of these are non-zero, this leads to an internal loss model consisting of N virtual buses, (N^2+N)/2 virtual branches, and 1 shunt. These virtual buses and branches are automatically merged and simplified whenever possible; e.g., when all these loss parameters are zero, this simplifies to a single virtual bus, to which all two-winding transformers connect.

For more detail, please refer to [upcoming technical paper]. #TODO add link to paper

shunt objects

Shunts are parsed directly into shunt objects.

load objects

Loads are parsed into load objects. See the discussion under the Load Model documentation on the sidebar, for a detailed discussion of the various load models.

generator objects

Generators are parsed into gen objects.

solar objects

Solar objects (photovoltaic systems) are parsed into gen objects.

voltage_source objects

Voltage sources are parsed into gen objects. If loss parameters are specified (i.e. rs and/or xs) then a virtual bus and branch are created to model the internal impedance.

diff --git a/dev/manual/enums.html b/dev/manual/enums.html index ec84f4c8a..407928a94 100644 --- a/dev/manual/enums.html +++ b/dev/manual/enums.html @@ -1,2 +1,2 @@ -Enums in Engineering Model · PowerModelsDistribution

PowerModelsDistribution Enum Types

Within the PowerModelsDistribution Engineering Model we have included the use of Enums. Here we document the fields for which Enums are expected and the possible Enums available.

Data Model

Any place in PowerModelsDistribution that calls for specifying the data_model, either in function calls or the "data_model" field inside the data structure itself, will expect a DataModel type.

The DSS data model is an output of parse_dss, and is an untranslated raw parse of a DSS file. This Enum exists for use by count_nodes, where the method to count the number of active nodes is different between all three models.

Component Status

All "status" fields in the ENGINEERING model expect a Status type.

Connection Configuration

All "configuration" fields in the ENGINEERING model expect a ConnConfig type.

Load Model

For load objects, the "model" field expects a LoadModel type to specify the type of load model to use, where

  • POWER indicates constant power,
  • CURRENT indicates constant current,
  • IMPEDANCE indicates constant impedance,
  • EXPONENTIAL indicates an exponential load model, and
  • ZIP indicates a ZIP model

Shunt Model

For shunt objects, the "model" field expects a ShuntModel type to specify the origin of the shunt object, which is important for transient analysis.

Switch State

For switch objects, the "state" field expects a SwitchState type to specify whether the switch is currently open or closed.

Dispatchable Component

Some components can be Dispatchable, e.g. if a switch is dispatchable that means it is free to open or close, but if not then it is fixed in place, or if a load is dispatchable it implies that it can be shed in a run_mc_mld problem.

Generator Control Mode

For generator objects, the "control_mode" field expects a ControlMode type to specify whether the generator is operating in an isochronous mode (i.e. is frequency forming) or droop mode (i.e. is frequency following).

+Enums in Engineering Model · PowerModelsDistribution

PowerModelsDistribution Enum Types

Within the PowerModelsDistribution Engineering Model we have included the use of Enums. Here we document the fields for which Enums are expected and the possible Enums available.

Data Model

Any place in PowerModelsDistribution that calls for specifying the data_model, either in function calls or the "data_model" field inside the data structure itself, will expect a DataModel type.

The DSS data model is an output of parse_dss, and is an untranslated raw parse of a DSS file. This Enum exists for use by count_nodes, where the method to count the number of active nodes is different between all three models.

Component Status

All "status" fields in the ENGINEERING model expect a Status type.

Connection Configuration

All "configuration" fields in the ENGINEERING model expect a ConnConfig type.

Load Model

For load objects, the "model" field expects a LoadModel type to specify the type of load model to use, where

  • POWER indicates constant power,
  • CURRENT indicates constant current,
  • IMPEDANCE indicates constant impedance,
  • EXPONENTIAL indicates an exponential load model, and
  • ZIP indicates a ZIP model

Shunt Model

For shunt objects, the "model" field expects a ShuntModel type to specify the origin of the shunt object, which is important for transient analysis.

Switch State

For switch objects, the "state" field expects a SwitchState type to specify whether the switch is currently open or closed.

Dispatchable Component

Some components can be Dispatchable, e.g. if a switch is dispatchable that means it is free to open or close, but if not then it is fixed in place, or if a load is dispatchable it implies that it can be shed in a run_mc_mld problem.

Generator Control Mode

For generator objects, the "control_mode" field expects a ControlMode type to specify whether the generator is operating in an isochronous mode (i.e. is frequency forming) or droop mode (i.e. is frequency following).

diff --git a/dev/manual/external-data-formats.html b/dev/manual/external-data-formats.html index 1389c3ed3..de1b4e58e 100644 --- a/dev/manual/external-data-formats.html +++ b/dev/manual/external-data-formats.html @@ -1,2 +1,2 @@ -External Data Formats · PowerModelsDistribution

External Data Formats

OpenDSS

PowerModelsDistribution supports parsing OpenDSS format files. In particular, we support a raw parsing of all OpenDSS specified components into a dictionary (serializable) structure, and support converting the data values of a smaller subsection of components into their expected types. Those include

  • Line
  • Load
  • Generator
  • Capactior (shunt capacitors only)
  • Reactor
  • Transformer
  • Linecode
  • Xfmrcode
  • Loadshape
  • XYCurve
  • Circuit
  • VSource
  • PVSystem
  • Storage

Of those, a subset of configurations are converted into a PowerModelsDistribution internal data model, namely:

Edge Elements

  • line (from lines and line reactors)
  • transformer (arbitrary winding, all connections except zig-zag)
  • switch (from lines w/ switch=y)

Node Elements

  • generator
  • voltage_source
  • solar (from PVSystem)
  • load (incl. support for constant POWER, constant IMPEDANCE, constant CURRENT, and EXPONENTIAL models)
  • shunt (from shunt capacitors and shunt reactors)
  • storage

Data Elements

  • linecode
  • xfmrcode
  • time_series (from loadshapes)

Several notes about the specific design choices w.r.t. OpenDSS are explained below.

Circuit

The default connection to the transmission system is modeled as an ideal voltage source named "source" in OpenDSS, which is connected by default to a node named "sourcebus", but this can be changed.

Lines

Although Lines and Linecodes are supported, the more generic LineGeometry is not yet supported.

Transformers

Unfortunately, in the OpenDSS format, multi-phase transformers with different taps for each phase are not explicitly supported, so to work around this limitation multiple single phase transformers should be defined, which are then "banked" together using the bank property.

Capacitors and Reactors

Capacitors and reactors are supported as shunts, although shunts to ground via delta connections are not yet supported. Furthermore, generic reactors are not supported, only those whose second terminal is connected to ground (default for unspecified second terminal). Reactors are also supported as a resistanceless line if their second terminal is connected, but only for topological continuity of the network.

PowerModelsDistribution JSON

You can export a PowerModelsDistribution data structure to a JSON file using the print_file command and parse one in using the parse_file command

+External Data Formats · PowerModelsDistribution

External Data Formats

OpenDSS

PowerModelsDistribution supports parsing OpenDSS format files. In particular, we support a raw parsing of all OpenDSS specified components into a dictionary (serializable) structure, and support converting the data values of a smaller subsection of components into their expected types. Those include

  • Line
  • Load
  • Generator
  • Capactior (shunt capacitors only)
  • Reactor
  • Transformer
  • Linecode
  • Xfmrcode
  • Loadshape
  • XYCurve
  • Circuit
  • VSource
  • PVSystem
  • Storage

Of those, a subset of configurations are converted into a PowerModelsDistribution internal data model, namely:

Edge Elements

  • line (from lines and line reactors)
  • transformer (arbitrary winding, all connections except zig-zag)
  • switch (from lines w/ switch=y)

Node Elements

  • generator
  • voltage_source
  • solar (from PVSystem)
  • load (incl. support for constant POWER, constant IMPEDANCE, constant CURRENT, and EXPONENTIAL models)
  • shunt (from shunt capacitors and shunt reactors)
  • storage

Data Elements

  • linecode
  • xfmrcode
  • time_series (from loadshapes)

Several notes about the specific design choices w.r.t. OpenDSS are explained below.

Circuit

The default connection to the transmission system is modeled as an ideal voltage source named "source" in OpenDSS, which is connected by default to a node named "sourcebus", but this can be changed.

Lines

Although Lines and Linecodes are supported, the more generic LineGeometry is not yet supported.

Transformers

Unfortunately, in the OpenDSS format, multi-phase transformers with different taps for each phase are not explicitly supported, so to work around this limitation multiple single phase transformers should be defined, which are then "banked" together using the bank property.

Capacitors and Reactors

Capacitors and reactors are supported as shunts, although shunts to ground via delta connections are not yet supported. Furthermore, generic reactors are not supported, only those whose second terminal is connected to ground (default for unspecified second terminal). Reactors are also supported as a resistanceless line if their second terminal is connected, but only for topological continuity of the network.

PowerModelsDistribution JSON

You can export a PowerModelsDistribution data structure to a JSON file using the print_file command and parse one in using the parse_file command

diff --git a/dev/manual/formulations.html b/dev/manual/formulations.html index 8163745de..eef812402 100644 --- a/dev/manual/formulations.html +++ b/dev/manual/formulations.html @@ -48,4 +48,4 @@ EN-ACR (AbstractExplicitNeutralIVRModel) | -|-- ACRENPowerModel +|-- ACRENPowerModel diff --git a/dev/manual/load-model.html b/dev/manual/load-model.html index bef644dce..0c14c8583 100644 --- a/dev/manual/load-model.html +++ b/dev/manual/load-model.html @@ -3,4 +3,4 @@ S^d&=\text{pd}+j.\text{qd} & S^\text{bus}&=\text{pd_bus}+j.\text{qd_bus}\\ I^d&=\text{crd}+j.\text{cid} & I^\text{bus}&=\text{crd_bus}+j.\text{cid_bus}\\ U^d&=\text{vrd}+j.\text{vid} & U^\text{bus}&=\text{vr}+j.\text{vi}\\ -\end{align}\]

Voltage dependency

The general, exponential load model is defined as

\[P^d_i = P^{d,0}_i \left(\frac{V^d_i}{V^{d,0}_i}\right)^{\alpha_i} = a_i \left(V^d_i\right)^{\alpha_i}\]

\[Q^d_i = Q^{d,0}_i \left(\frac{V^d_i}{V^{d,0}_i}\right)^{\beta_i} = b_i \left(V^d_i\right)^{\beta_i}.\]

There are a few cases which get a special name: constant power ($\alpha=\beta=0$), constant current ($\alpha=\beta=1$), and constant impedance ($\alpha=\beta=2$).

Wye-connected Loads

A wye-connected load connects between a set of phases $\mathcal{P}$ and a neutral conductor $n$. The voltage as seen by each individual load is then

\[U^d = U^\text{bus}_\mathcal{P}-U^\text{bus}_n,\]

whilst the current

\[I^\text{bus}_\mathcal{P} = I^\text{d},\;\;\;I^\text{bus}_n=-1^TI^d\]

We now develop the expression for the power drawn at the bus for the phase conductors

\[S^\text{bus}_\mathcal{P} = (U^d+U^\text{bus}_n)\odot(I^d)^* = S^d+U^\text{bus}_n S^d\oslash U^d.\]

From conservation of power or simply the formulas above,

\[S^\text{bus}_n = -1^TS^\text{bus}_\mathcal{P}+1^TS^d.\]

Grounded neutral

Note that when the neutral is grounded, i.e. $U^\text{bus}_n=0$, these formulas simplify to

\[S^\text{bus}_\mathcal{P}=S^d,\;\;\;S^\text{bus}_n=0,\]

which is why in Kron-reduced unbalanced networks, you can directly insert the power consumed by the loads, in the nodal power balance equations.

Delta-connected Loads

Firstly, define the three-phase delta transformation matrix

\[M^\Delta_3 = \begin{bmatrix}\;\;\;1 & -1 & \;\;0\\ \;\;\;0 & \;\;\;1 & -1\\ -1 & \;\;\;0 & \;\;\;1\end{bmatrix},\]

which can be extended to more phases in a straight-forward manner. For loads connected between split-phase terminals of triplex nodes (usually located on the secondary side of center-tapped transformers), we define a single-phase delta transformation matrix

\[M^\Delta_1 = \begin{bmatrix} 1 & -1 \end{bmatrix}.\]

Now,

\[U^d = M^\Delta U^\text{bus},\;\;\; I^\text{bus} = \left(M^\Delta\right)^T I^d.\]

We can related $S^\text{bus}$ to $U^\text{bus}$ and $I^d$

\[S^\text{bus} = U^\text{bus}\odot \left(I^\text{bus}\right)^* = U^\text{bus}\odot \left(M^\Delta\right)^T\left(I^d\right)^*,\]

and using the fact that $\left(I^d\right)^*=S^d \oslash U^d$, and the expression above for $U^d$,

\[S^\text{bus} = U^\text{bus}\left(M^\Delta\right)^T S^d \oslash M^\Delta U^\text{bus}\]

+\end{align}\]

Voltage dependency

The general, exponential load model is defined as

\[P^d_i = P^{d,0}_i \left(\frac{V^d_i}{V^{d,0}_i}\right)^{\alpha_i} = a_i \left(V^d_i\right)^{\alpha_i}\]

\[Q^d_i = Q^{d,0}_i \left(\frac{V^d_i}{V^{d,0}_i}\right)^{\beta_i} = b_i \left(V^d_i\right)^{\beta_i}.\]

There are a few cases which get a special name: constant power ($\alpha=\beta=0$), constant current ($\alpha=\beta=1$), and constant impedance ($\alpha=\beta=2$).

Wye-connected Loads

A wye-connected load connects between a set of phases $\mathcal{P}$ and a neutral conductor $n$. The voltage as seen by each individual load is then

\[U^d = U^\text{bus}_\mathcal{P}-U^\text{bus}_n,\]

whilst the current

\[I^\text{bus}_\mathcal{P} = I^\text{d},\;\;\;I^\text{bus}_n=-1^TI^d\]

We now develop the expression for the power drawn at the bus for the phase conductors

\[S^\text{bus}_\mathcal{P} = (U^d+U^\text{bus}_n)\odot(I^d)^* = S^d+U^\text{bus}_n S^d\oslash U^d.\]

From conservation of power or simply the formulas above,

\[S^\text{bus}_n = -1^TS^\text{bus}_\mathcal{P}+1^TS^d.\]

Grounded neutral

Note that when the neutral is grounded, i.e. $U^\text{bus}_n=0$, these formulas simplify to

\[S^\text{bus}_\mathcal{P}=S^d,\;\;\;S^\text{bus}_n=0,\]

which is why in Kron-reduced unbalanced networks, you can directly insert the power consumed by the loads, in the nodal power balance equations.

Delta-connected Loads

Firstly, define the three-phase delta transformation matrix

\[M^\Delta_3 = \begin{bmatrix}\;\;\;1 & -1 & \;\;0\\ \;\;\;0 & \;\;\;1 & -1\\ -1 & \;\;\;0 & \;\;\;1\end{bmatrix},\]

which can be extended to more phases in a straight-forward manner. For loads connected between split-phase terminals of triplex nodes (usually located on the secondary side of center-tapped transformers), we define a single-phase delta transformation matrix

\[M^\Delta_1 = \begin{bmatrix} 1 & -1 \end{bmatrix}.\]

Now,

\[U^d = M^\Delta U^\text{bus},\;\;\; I^\text{bus} = \left(M^\Delta\right)^T I^d.\]

We can related $S^\text{bus}$ to $U^\text{bus}$ and $I^d$

\[S^\text{bus} = U^\text{bus}\odot \left(I^\text{bus}\right)^* = U^\text{bus}\odot \left(M^\Delta\right)^T\left(I^d\right)^*,\]

and using the fact that $\left(I^d\right)^*=S^d \oslash U^d$, and the expression above for $U^d$,

\[S^\text{bus} = U^\text{bus}\left(M^\Delta\right)^T S^d \oslash M^\Delta U^\text{bus}\]

diff --git a/dev/manual/math-model.html b/dev/manual/math-model.html index e9a8314c8..72d9348b0 100644 --- a/dev/manual/math-model.html +++ b/dev/manual/math-model.html @@ -61,4 +61,4 @@ & |diag(\mathbf{S}_{ij})| \leq \mathbf{s}^u_{ij} \;\; \forall (i,j) \in E \cup E^R \\ & \theta^{\Delta l}_{ij,c} \leq \angle (V_{i,c} V^*_{j,c}) \leq \theta^{\Delta u}_{ij,c} \;\; \forall (i,j) \in E, \forall c \in C % -\end{align}\]

+\end{align}\]

diff --git a/dev/manual/power-flow.html b/dev/manual/power-flow.html index 67c10e47c..d40359e87 100644 --- a/dev/manual/power-flow.html +++ b/dev/manual/power-flow.html @@ -1,5 +1,5 @@ -Power Flow Computations · PowerModelsDistribution

Power Flow Computations

The typical goal of PowerModelsDistribution is to build a JuMP model that is used to solve distribution power network optimization problems. The JuMP model abstraction enables PowerModelsDistribution to have state-of-the-art performance on a wide range of problem formulations. That said, for the specific case of power flow computations, in some specific applications performance gains can be had by avoiding the JuMP model abstraction and solving the problem more directly. To that end, PowerModelsDistribution includes Julia-native solvers for AC power flow in rectangular voltage coordinates. This section provides an overview of the different power flow options that are available in PowerModelsDistribution and under what circumstances they may be beneficial.

Generic Power Flow

The general purpose power flow solver in PowerModelsDistribution is,

This function builds a JuMP model for a wide variety of unbalanced power flow formulations supported by PowerModelsDistribution. For example it supports,

  • ACPUPowerModel - a non-convex nonlinear AC unbalanced power flow using complex voltages in polar coordinates
  • ACRPowerModel - a non-convex nonlinear AC unbalanced power flow using complex voltages in rectangular coordinates
  • ACRENPowerModel - a non-convex nonlinear AC unbalanced power flow using complex voltages in rectangular coordinates with explicit neutral conductor
  • IVRUPowerModel - a non-convex nonlinear AC power unbalanced flow using current voltage variables in rectangular coordinates
  • IVRENPowerModel - a non-convex nonlinear AC unbalanced power flow using current voltage variables in rectangular coordinates with explicit neutral conductor

The solve_mc_pf solution method is both formulation and solver agnostic and can leverage the wide range of solvers that are available in the JuMP ecosystem. Many of these solvers are commercial-grade, which in turn makes solve_mc_pf the most reliable power flow solution method in PowerModelsDistribution.

Warm Starting

In some applications an initial guess of the power flow solution may be available. In such a case, this information may be able to decrease a solver's time to convergence, especially when solving systems of nonlinear equations. The _start postfix can be used in the network data to initialize the solver's variables and provide a suitable solution guess. The most common values are as follows,

For each generator,

  • pg_start - active power injection starting point
  • qg_start - reactive power injection starting point

For each bus,

  • vm_start - voltage magnitude starting point for the ACPUPowerModel model
  • va_start - voltage angle starting point for the ACPUPowerModel model
  • vr_start - real voltage starting point for the IVRUPowerModel model
  • vi_start - imaginary voltage starting point for the IVRUPowerModel model

The following helper function can be used to use the solution point in the network data as the starting point for solve_mc_pf.

PowerModelsDistribution.add_start_voltage!Function
add_start_voltage!(
+Power Flow Computations · PowerModelsDistribution

Power Flow Computations

The typical goal of PowerModelsDistribution is to build a JuMP model that is used to solve distribution power network optimization problems. The JuMP model abstraction enables PowerModelsDistribution to have state-of-the-art performance on a wide range of problem formulations. That said, for the specific case of power flow computations, in some specific applications performance gains can be had by avoiding the JuMP model abstraction and solving the problem more directly. To that end, PowerModelsDistribution includes Julia-native solvers for AC power flow in rectangular voltage coordinates. This section provides an overview of the different power flow options that are available in PowerModelsDistribution and under what circumstances they may be beneficial.

Generic Power Flow

The general purpose power flow solver in PowerModelsDistribution is,

This function builds a JuMP model for a wide variety of unbalanced power flow formulations supported by PowerModelsDistribution. For example it supports,

  • ACPUPowerModel - a non-convex nonlinear AC unbalanced power flow using complex voltages in polar coordinates
  • ACRPowerModel - a non-convex nonlinear AC unbalanced power flow using complex voltages in rectangular coordinates
  • ACRENPowerModel - a non-convex nonlinear AC unbalanced power flow using complex voltages in rectangular coordinates with explicit neutral conductor
  • IVRUPowerModel - a non-convex nonlinear AC power unbalanced flow using current voltage variables in rectangular coordinates
  • IVRENPowerModel - a non-convex nonlinear AC unbalanced power flow using current voltage variables in rectangular coordinates with explicit neutral conductor

The solve_mc_pf solution method is both formulation and solver agnostic and can leverage the wide range of solvers that are available in the JuMP ecosystem. Many of these solvers are commercial-grade, which in turn makes solve_mc_pf the most reliable power flow solution method in PowerModelsDistribution.

Warm Starting

In some applications an initial guess of the power flow solution may be available. In such a case, this information may be able to decrease a solver's time to convergence, especially when solving systems of nonlinear equations. The _start postfix can be used in the network data to initialize the solver's variables and provide a suitable solution guess. The most common values are as follows,

For each generator,

  • pg_start - active power injection starting point
  • qg_start - reactive power injection starting point

For each bus,

  • vm_start - voltage magnitude starting point for the ACPUPowerModel model
  • va_start - voltage angle starting point for the ACPUPowerModel model
  • vr_start - real voltage starting point for the IVRUPowerModel model
  • vi_start - imaginary voltage starting point for the IVRUPowerModel model

The following helper function can be used to use the solution point in the network data as the starting point for solve_mc_pf.

PowerModelsDistribution.add_start_voltage!Function
add_start_voltage!(
     data_math::Dict{String,Any};
     coordinates=:rectangular,
     uniform_v_start=missing,
@@ -8,7 +8,7 @@
     vm_default=0.0,
     va_default=0.0,
     epsilon::Number=1E-3,
-)::Dict{String,Any}

Adds start values for the voltage to the buses. For a multinetwork data model, you can calculate the start voltages for a representative network through 'calcstartvoltage', and pass the result as 'uniformvstart' to use the same values for all networks and avoid recalculating it for each network. The argument 'epsilon' controls the offset added to ungrounded terminals which would otherwise be set to zero.

source
Warning

Warm starting a solver is a very delicate task and can easily result in degraded performance. Using PowerModelsDistribution' default flat-start values is recommended before experimenting with warm starting a solver.

Native Power Flow

The AC Unbalanced Power Flow problem is ubiquitous in power system analysis. The problem requires solving a system of nonlinear equations, usually via a Newton-Raphson type of algorithm. In PowerModelsDistribution, the standard Julia library is used for solving this system of nonlinear equations. The following function is used to solve Unbalanced Power Flow problem with voltages in rectangular coordinates.

PowerModelsDistribution.compute_mc_pfFunction
compute_mc_pf(
+)::Dict{String,Any}

Adds start values for the voltage to the buses. For a multinetwork data model, you can calculate the start voltages for a representative network through 'calcstartvoltage', and pass the result as 'uniformvstart' to use the same values for all networks and avoid recalculating it for each network. The argument 'epsilon' controls the offset added to ungrounded terminals which would otherwise be set to zero.

source
Warning

Warm starting a solver is a very delicate task and can easily result in degraded performance. Using PowerModelsDistribution' default flat-start values is recommended before experimenting with warm starting a solver.

Native Power Flow

The AC Unbalanced Power Flow problem is ubiquitous in power system analysis. The problem requires solving a system of nonlinear equations, usually via a Newton-Raphson type of algorithm. In PowerModelsDistribution, the standard Julia library is used for solving this system of nonlinear equations. The following function is used to solve Unbalanced Power Flow problem with voltages in rectangular coordinates.

PowerModelsDistribution.compute_mc_pfFunction
compute_mc_pf(
     data::Dict{String,<:Any};
     explicit_neutral::Bool=false,
     max_iter::Int=100,
@@ -26,13 +26,13 @@
     make_si::Bool=!get(data, "per_unit", false),
     make_si_extensions::Vector{<:Function}=Function[],
     dimensionalize_math_extensions::Dict{String,Dict{String,Vector{String}}}=Dict{String,Dict{String,Vector{String}}}(),
-)::Dict{String,Any}

Takes data in either the ENGINEERING or MATHEMATICAL model, a model type (e.g., ACRUPowerModel), and model builder function (e.g., build_mc_opf), and returns a solution in the original data model defined by data.

Technical description of the native power flow can be found at https://arxiv.org/abs/2305.04405 where implementation fo the fixed-point current injection algorithm, inspired by the existing open-source implementation in OpenDSS. The current injection method is commonly conceived as a system of nonlinear equalities solved by Newton’s method. However, the fixed point iteration variant commonly outperforms most methods, while supporting meshed topologies from the ground up

If make_si is false, data will remain in per-unit.

For an explanation of multinetwork and global_keys, see make_multinetwork

For an explanation of eng2math_extensions and eng2math_passthrough, see transform_data_model

For an explanation of make_pu_extensions, see make_per_unit!

For an explanation of ref_extensions, see instantiate_mc_model

For an explanation of map_math2eng_extensions, make_si, make_si_extensions, and dimensionalize_math_extensions, see solution_make_si

source
compute_mc_pf(
+)::Dict{String,Any}

Takes data in either the ENGINEERING or MATHEMATICAL model, a model type (e.g., ACRUPowerModel), and model builder function (e.g., build_mc_opf), and returns a solution in the original data model defined by data.

Technical description of the native power flow can be found at https://arxiv.org/abs/2305.04405 where implementation fo the fixed-point current injection algorithm, inspired by the existing open-source implementation in OpenDSS. The current injection method is commonly conceived as a system of nonlinear equalities solved by Newton’s method. However, the fixed point iteration variant commonly outperforms most methods, while supporting meshed topologies from the ground up

If make_si is false, data will remain in per-unit.

For an explanation of multinetwork and global_keys, see make_multinetwork

For an explanation of eng2math_extensions and eng2math_passthrough, see transform_data_model

For an explanation of make_pu_extensions, see make_per_unit!

For an explanation of ref_extensions, see instantiate_mc_model

For an explanation of map_math2eng_extensions, make_si, make_si_extensions, and dimensionalize_math_extensions, see solution_make_si

source
compute_mc_pf(
   pdf::PowerFlowData,
   max_iter::Int,
   stat_tol::Float,
   verbose::Bool
-)

Computes native power flow and requires PowerFlowData (See https://arxiv.org/abs/2305.04405).

source

compute_mc_pf is based on the current injection method and is inspired by OpenDSS's algorithm. compute_mc_pf will typically provide an identical result to solve_mc_pf. However, the existence of solution degeneracy around generator injection assignments and multiple power flow solutions can yield different results. The primary advantage of compute_mc_pf over solve_mc_pf is that it does not require building a JuMP model. If the initial point for the Unbalanced Power Flow solution is near-feasible then compute_mc_pf can result in a significant runtime saving by converging quickly and reducing data-wrangling and memory allocation overheads. This initial guess is provided using the standard _start values. The add_start_voltage! function provides a convenient way of setting a suitable starting point.

Tip

If compute_mc_pf fails to converge try solve_mc_pf instead.

The table below reports the accuracy of the native power flow with respect to OpenDSS native solver tested on three IEEE testcases: | IEEE testcases | maximum voltage p.u difference with OpenDSS power flow solver | | –––––––-| ––––––––––––––––––––––––––––––- | | IEEE13 | 3.765096388188572e-6 | | IEEE34 | 6.805369850332029e-8 | | IEEE123 | 4.021326251365659e-8 |

Input arguments

compute_mc_pf receives input arguments as follows,

  • data_math - network data in MATHEMATICAL format
  • explicit_neutral - a boolean input indication wether or not the neutral is explicitly modelled
  • v_start - warm start if different from in-built initialization algorithm
  • max_iter - maximum iterations
  • stat_tol - statistical tolerance

Outputs

compute_mc_pf provides the following outputs,

  • solution - solution dictionary
  • iterations - number of iterations
  • time_build - time spent on building the power flow data
  • time_solve - time spent on solving the native power flow
  • time_post - time spent to generate solutions
  • time_total - total time
  • termination_status - termination status

Limitations

compute_mc_pf has the following limitations,

  • starting from the math dictionary means that transformer decomposition is already done, which is different from what OpenDSS does
  • we calculate the primitive admittance matrix in p.u. whereas OpenDSS algorithm works with actual units
  • no load model relaxation is performed
  • inspired by OpenDSS, we add small ppm values to certain component primitive admittance values to avoid singularity issues
  • inspired by OpenDSS, switch primitive admittance has specific values

Network Admittance Matrix

Internally compute_mc_pf utilizes an admittance matrix representation of the network data, which may be useful in other contexts. The foundational type for the admittance matrix representations is SparseMatrixCSC.

The following function can be used to compute the admittance matrix from PowerModelsDistribution network data.

compute_mc_pf is based on the current injection method and is inspired by OpenDSS's algorithm. compute_mc_pf will typically provide an identical result to solve_mc_pf. However, the existence of solution degeneracy around generator injection assignments and multiple power flow solutions can yield different results. The primary advantage of compute_mc_pf over solve_mc_pf is that it does not require building a JuMP model. If the initial point for the Unbalanced Power Flow solution is near-feasible then compute_mc_pf can result in a significant runtime saving by converging quickly and reducing data-wrangling and memory allocation overheads. This initial guess is provided using the standard _start values. The add_start_voltage! function provides a convenient way of setting a suitable starting point.

Tip

If compute_mc_pf fails to converge try solve_mc_pf instead.

The table below reports the accuracy of the native power flow with respect to OpenDSS native solver tested on three IEEE testcases: | IEEE testcases | maximum voltage p.u difference with OpenDSS power flow solver | | –––––––-| ––––––––––––––––––––––––––––––- | | IEEE13 | 3.765096388188572e-6 | | IEEE34 | 6.805369850332029e-8 | | IEEE123 | 4.021326251365659e-8 |

Input arguments

compute_mc_pf receives input arguments as follows,

  • data_math - network data in MATHEMATICAL format
  • explicit_neutral - a boolean input indication wether or not the neutral is explicitly modelled
  • v_start - warm start if different from in-built initialization algorithm
  • max_iter - maximum iterations
  • stat_tol - statistical tolerance

Outputs

compute_mc_pf provides the following outputs,

  • solution - solution dictionary
  • iterations - number of iterations
  • time_build - time spent on building the power flow data
  • time_solve - time spent on solving the native power flow
  • time_post - time spent to generate solutions
  • time_total - total time
  • termination_status - termination status

Limitations

compute_mc_pf has the following limitations,

  • starting from the math dictionary means that transformer decomposition is already done, which is different from what OpenDSS does
  • we calculate the primitive admittance matrix in p.u. whereas OpenDSS algorithm works with actual units
  • no load model relaxation is performed
  • inspired by OpenDSS, we add small ppm values to certain component primitive admittance values to avoid singularity issues
  • inspired by OpenDSS, switch primitive admittance has specific values

Network Admittance Matrix

Internally compute_mc_pf utilizes an admittance matrix representation of the network data, which may be useful in other contexts. The foundational type for the admittance matrix representations is SparseMatrixCSC.

The following function can be used to compute the admittance matrix from PowerModelsDistribution network data.

+)

Calculates the admittance matrix from PowerFlowData struct.

source
diff --git a/dev/manual/quickguide.html b/dev/manual/quickguide.html index 2385996a9..66b2f32d9 100644 --- a/dev/manual/quickguide.html +++ b/dev/manual/quickguide.html @@ -12,4 +12,4 @@ [c in 1:ncnds], base_name="$(nw)_vm_$(i)", start = comp_start_value(ref(pm, nw, :bus, i), "vm_start", c, 1.0) ) for i in ids(pm, nw, :bus) -)

Finally, it should be noted that if va_start and vm_start are present in a data dictionary which is passed to the ACR or IVR formulation, these are converted to their rectangular equivalents and used as vr_start and vi_start.

Examples

More examples of working with the engineering data model can be found in the /examples folder of the PowerModelsDistribution.jl repository. These are Pluto Notebooks; instructions for running them can be found in the Pluto documentation.

+)

Finally, it should be noted that if va_start and vm_start are present in a data dictionary which is passed to the ACR or IVR formulation, these are converted to their rectangular equivalents and used as vr_start and vi_start.

Examples

More examples of working with the engineering data model can be found in the /examples folder of the PowerModelsDistribution.jl repository. These are Pluto Notebooks; instructions for running them can be found in the Pluto documentation.

diff --git a/dev/manual/specifications.html b/dev/manual/specifications.html index 2b69eab88..f58e8af29 100644 --- a/dev/manual/specifications.html +++ b/dev/manual/specifications.html @@ -20,4 +20,4 @@ & z^g_i S^{gl}_{i,c} \leq S^g_{i,c} \leq z^g_i S^{gu}_{i,c}\ \ \forall i \in G,\forall c \in C \\ & \sum_{\substack{k\in G_i,c\in C}} S^g_{k,c} - \sum_{\substack{k\in L_i,c\in C}} z^d_k S^d_{k,c}- \sum_{\substack{k\in H_i,c\in C}} z^s_k Y^s_{k,c}\left | V_{i,c} \right |^2 \nonumber \\ & = \sum_{\substack{(i,j)\in E_i\cup E_i^R,c\in C}} S_{ij,c}\ \forall i \in N -\end{align}\]

+\end{align}\]

diff --git a/dev/reference/base.html b/dev/reference/base.html index 0731c3af1..4a60e64ef 100644 --- a/dev/reference/base.html +++ b/dev/reference/base.html @@ -1,32 +1,32 @@ -Base · PowerModelsDistribution

Base

Helper functions

PowerModelsDistribution.set_lower_boundFunction
function set_lower_bound(
+Base · PowerModelsDistribution

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(
+)

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(
+)

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(
+)

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(
+)

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(
+)

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(
+)

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(
+)

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
+)

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
diff --git a/dev/reference/constants.html b/dev/reference/constants.html index a2bd22a02..4970146c9 100644 --- a/dev/reference/constants.html +++ b/dev/reference/constants.html @@ -1,2 +1,2 @@ -Constants · PowerModelsDistribution

Constants

+Constants · PowerModelsDistribution

Constants

diff --git a/dev/reference/constraints.html b/dev/reference/constraints.html index 1980069f6..46c406056 100644 --- a/dev/reference/constraints.html +++ b/dev/reference/constraints.html @@ -1,31 +1,31 @@ -Constraints · PowerModelsDistribution

Constraints

PowerModelsDistribution.constraint_SWL_psdMethod

Take a multi-conductor voltage variable V and a current variable I. The associated power is then defined as S = VI^H Define the lifted variables as W and L as W = VV^H, L = I*I^H Then, it is equally valid that [W S; S^H L] ∈ PSDCone, rank([W S; S^H L])=1 This function adds this PSD constraint for the rectangular coordinates of S, W and L.

source
PowerModelsDistribution.constraint_capacitor_on_offMethod
constraint_capacitor_on_off(pm::AbstractUnbalancedACPModel, i::Int; nw::Int=nw_id_default)

Add constraints to model capacitor switching

\[\begin{align} +Constraints · PowerModelsDistribution

Constraints

PowerModelsDistribution.constraint_SWL_psdMethod

Take a multi-conductor voltage variable V and a current variable I. The associated power is then defined as S = VI^H Define the lifted variables as W and L as W = VV^H, L = I*I^H Then, it is equally valid that [W S; S^H L] ∈ PSDCone, rank([W S; S^H L])=1 This function adds this PSD constraint for the rectangular coordinates of S, W and L.

source
PowerModelsDistribution.constraint_capacitor_on_offMethod
constraint_capacitor_on_off(pm::AbstractUnbalancedACPModel, i::Int; nw::Int=nw_id_default)

Add constraints to model capacitor switching

\[\begin{align} &\text{kvar control (ON): } q-q_\text{on} ≤ M_q ⋅ z - ϵ ⋅ (1-z), \\ &\text{kvar control (OFF): } q-q_\text{off} ≥ -M_q ⋅ (1-z) - ϵ ⋅ z, \\ &\text{voltage control (ON): } v-v_\text{min} ≥ -M_v ⋅ z + ϵ ⋅ (1-z), \\ &\text{voltage control (OFF): } v-v_\text{max} ≤ M_v ⋅ (1-z) - ϵ ⋅ z. -\end{align}\]

source
PowerModelsDistribution.constraint_capacitor_on_offMethod
constraint_capacitor_on_off(pm::AbstractUnbalancedACRModel, i::Int; nw::Int=nw_id_default)

Add constraints to model capacitor switching

\[\begin{align} &\text{kvar control (ON): } q-q_\text{on} ≤ M_q ⋅ z - ϵ ⋅ (1-z), \\ &\text{kvar control (OFF): } q-q_\text{off} ≥ -M_q ⋅ (1-z) - ϵ ⋅ z, \\ &\text{voltage control (ON): } v_r^2 + v_i^2 - v_\text{min}^2 ≥ -M_v ⋅ z + ϵ ⋅ (1-z), \\ &\text{voltage control (OFF): } v_r^2 + v_i^2 - v_\text{max}^2 ≤ M_v ⋅ (1-z) - ϵ ⋅ z. -\end{align}\]

source
PowerModelsDistribution.constraint_capacitor_on_offMethod
constraint_capacitor_on_off(pm::AbstractUnbalancedIVRModel, i::Int; nw::Int=nw_id_default)

Add constraints to model capacitor switching

\[\begin{align} &\text{kvar control: } s = (vr_fr+im*vi_fr).*(cr_fr-im*ci_fr),\\ &\text{kvar control (ON): } \Im{s}-q_\text{on} ≤ M_q ⋅ z - ϵ ⋅ (1-z), \\ &\text{kvar control (OFF): } \Im{s}-q_\text{off} ≥ -M_q ⋅ (1-z) - ϵ ⋅ z, \\ &\text{voltage control (ON): } v_r^2 + v_i^2 - v_\text{min}^2 ≥ -M_v ⋅ z + ϵ ⋅ (1-z), \\ &\text{voltage control (OFF): } v_r^2 + v_i^2 - v_\text{max}^2 ≤ M_v ⋅ (1-z) - ϵ ⋅ z. -\end{align}\]

source
PowerModelsDistribution.constraint_capacitor_on_offMethod
constraint_capacitor_on_off(pm::FBSUBFPowerModel, i::Int; nw::Int=nw_id_default)

Add constraints to model capacitor switching

\[\begin{align} &\text{kvar control (ON): } q-q_\text{on} ≤ M_q ⋅ z - ϵ ⋅ (1-z), \\ &\text{kvar control (OFF): } q-q_\text{off} ≥ -M_q ⋅ (1-z) - ϵ ⋅ z, \\ &\text{voltage control (ON): } 2 ⋅ v_{r0} ⋅ v_r + 2 ⋅ v_{i0} ⋅ v_i - v_{r0}^2 - v_{i0}^2 - v_\text{min}^2 ≥ -M_v ⋅ z + ϵ ⋅ (1-z), \\ &\text{voltage control (OFF): } 2 ⋅ v_{r0} ⋅ v_r + 2 ⋅ v_{i0} ⋅ v_i - v_{r0}^2 - v_{i0}^2 - v_\text{max}^2 ≤ M_v ⋅ (1-z) - ϵ ⋅ z. -\end{align}\]

source
PowerModelsDistribution.constraint_capacitor_on_offMethod
constraint_capacitor_on_off(pm::LPUBFDiagModel, i::Int; nw::Int=nw_id_default)

Add constraints to model capacitor switching

\[\begin{align} &\text{kvar control (ON): } q-q_\text{on} ≤ M_q ⋅ z - ϵ ⋅ (1-z), \\ &\text{kvar control (OFF): } q-q_\text{off} ≥ -M_q ⋅ (1-z) - ϵ ⋅ z, \\ &\text{voltage control (ON): } w - v_\text{min}^2 ≥ -M_v ⋅ z + ϵ ⋅ (1-z), \\ &\text{voltage control (OFF): } w - v_\text{max}^2 ≤ M_v ⋅ (1-z) - ϵ ⋅ z. -\end{align}\]

source
PowerModelsDistribution.constraint_mc_ampacity_fromMethod
constraint_mc_ampacity_from(pm::AbstractUnbalancedACPModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches from-side

mathp_{fr}^2 + q_{fr}^2 \leq vm_{fr}^2 i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_fromMethod
constraint_mc_ampacity_from(pm::AbstractUnbalancedRectangularModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches from-side

mathp_{fr}^2 + q_{fr}^2 \leq (vr_{fr}^2 + vi_{fr}^2) i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_fromMethod
constraint_mc_ampacity_from(pm::AbstractUnbalancedWModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches from-side

mathp_{fr}^2 + q_{fr}^2 \leq w_{fr} i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_fromMethod
constraint_mc_ampacity_from(pm::AbstractUnbalancedWModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})

ACP current limit constraint on branches from-side

mathp_{fr}^2 + q_{fr}^2 \leq w_{fr} i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_toMethod
constraint_mc_ampacity_to(pm::AbstractUnbalancedACPModel, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches to-side

mathp_{to}^2 + q_{to}^2 \leq vm_{to}^2 i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_toMethod
constraint_mc_ampacity_to(pm::AbstractUnbalancedRectangularModels, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches to-side

mathp_{to}^2 + q_{to}^2 \leq (vr_{to}^2 + vi_{to}^2) i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_toMethod
constraint_mc_ampacity_to(pm::AbstractUnbalancedWModels, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches to-side

mathp_{to}^2 + q_{to}^2 \leq w_{to} i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_toMethod
constraint_mc_ampacity_to(pm::AbstractUnbalancedWModels, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, c_rating::Vector{<:Real})

ACP current limit constraint on branches to-side

mathp_{to}^2 + q_{to}^2 \leq w_{to} i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_fromMethod
constraint_mc_ampacity_from(pm::AbstractUnbalancedACPModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches from-side

mathp_{fr}^2 + q_{fr}^2 \leq vm_{fr}^2 i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_fromMethod
constraint_mc_ampacity_from(pm::AbstractUnbalancedRectangularModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches from-side

mathp_{fr}^2 + q_{fr}^2 \leq (vr_{fr}^2 + vi_{fr}^2) i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_fromMethod
constraint_mc_ampacity_from(pm::AbstractUnbalancedWModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches from-side

mathp_{fr}^2 + q_{fr}^2 \leq w_{fr} i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_fromMethod
constraint_mc_ampacity_from(pm::AbstractUnbalancedWModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})

ACP current limit constraint on branches from-side

mathp_{fr}^2 + q_{fr}^2 \leq w_{fr} i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_toMethod
constraint_mc_ampacity_to(pm::AbstractUnbalancedACPModel, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches to-side

mathp_{to}^2 + q_{to}^2 \leq vm_{to}^2 i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_toMethod
constraint_mc_ampacity_to(pm::AbstractUnbalancedRectangularModels, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches to-side

mathp_{to}^2 + q_{to}^2 \leq (vr_{to}^2 + vi_{to}^2) i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_toMethod
constraint_mc_ampacity_to(pm::AbstractUnbalancedWModels, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on branches to-side

mathp_{to}^2 + q_{to}^2 \leq w_{to} i_{max}^2

source
PowerModelsDistribution.constraint_mc_ampacity_toMethod
constraint_mc_ampacity_to(pm::AbstractUnbalancedWModels, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, c_rating::Vector{<:Real})

ACP current limit constraint on branches to-side

mathp_{to}^2 + q_{to}^2 \leq w_{to} i_{max}^2

source
PowerModelsDistribution.constraint_mc_branch_current_limitMethod
function constraint_mc_branch_current_limit(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
@@ -35,7 +35,7 @@
 	c_rating::Vector{<:Real};
 	report::Bool=true
 )

For ACR models with explicit neutrals, imposes a bound on the total current magnitude per conductor.

p_fr^2 + q_fr^2 <= r^2 * (vr_fr^2 + vi_fr^2)
-p_to^2 + q_to^2 <= r^2 * (vr_to^2 + vi_to^2)
source
PowerModelsDistribution.constraint_mc_branch_current_limitMethod
function constraint_mc_branch_current_limit(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
@@ -45,13 +45,13 @@
 	c_rating::Vector{<:Real};
 	report::Bool=true
 )

For IVR models with explicit neutrals, imposes a bound on the current magnitude per conductor at both ends of the branch (total current, i.e. including shunt contributions).

cr_fr^2 + ci_fr^2 <= c_rating^2
-cr_to^2 + ci_to^2 <= c_rating^2
source
PowerModelsDistribution.constraint_mc_branch_current_limitMethod
function constraint_mc_branch_current_limit(
 	pm::ExplicitNeutralModels,
 	id::Int;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true,
-)

For models with explicit neutrals, imposes a bound on the current magnitude per conductor at both ends of the branch (total current, i.e. including shunt contributions)

source
PowerModelsDistribution.constraint_mc_branch_flowMethod
constraint_mc_branch_flow(pm::AbstractUnbalancedPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int})

For superconducting branch flow (brr and brx all zeros)

source
PowerModelsDistribution.constraint_mc_bus_voltage_balanceMethod
constraint_mc_bus_voltage_balance(pm::AbstractUnbalancedPowerModel, bus_id::Int; nw=nw_id_default)::Nothing

Template function for bus voltage balance constraints.

Impose all balance related constraints for which key present in data model of bus. For a discussion of sequence components and voltage unbalance factor (VUF), see @INPROCEEDINGS{girigoudarmolzahnroald-2019, author={K. Girigoudar and D. K. Molzahn and L. A. Roald}, booktitle={submitted}, title={{Analytical and Empirical Comparisons of Voltage Unbalance Definitions}}, year={2019}, month={}, url={https://molzahn.github.io/pubs/girigoudarmolzahnroald-2019.pdf} }

source
PowerModelsDistribution.constraint_mc_branch_flowMethod
constraint_mc_branch_flow(pm::AbstractUnbalancedPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int})

For superconducting branch flow (brr and brx all zeros)

source
PowerModelsDistribution.constraint_mc_bus_voltage_balanceMethod
constraint_mc_bus_voltage_balance(pm::AbstractUnbalancedPowerModel, bus_id::Int; nw=nw_id_default)::Nothing

Template function for bus voltage balance constraints.

Impose all balance related constraints for which key present in data model of bus. For a discussion of sequence components and voltage unbalance factor (VUF), see @INPROCEEDINGS{girigoudarmolzahnroald-2019, author={K. Girigoudar and D. K. Molzahn and L. A. Roald}, booktitle={submitted}, title={{Analytical and Empirical Comparisons of Voltage Unbalance Definitions}}, year={2019}, month={}, url={https://molzahn.github.io/pubs/girigoudarmolzahnroald-2019.pdf} }

source
PowerModelsDistribution.constraint_mc_bus_voltage_dropMethod
function constraint_mc_bus_voltage_drop(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	i::Int,
@@ -63,7 +63,7 @@
 	r::Matrix{<:Real},
 	x::Matrix{<:Real}
 )

For IVR models with explicit neutrals, defines voltage drop over a branch, linking from and to side complex voltage.

vr_to == vr_fr - r*csr_fr + x*csi_fr
-vi_to == vi_fr - r*csi_fr - x*csr_fr
source
PowerModelsDistribution.constraint_mc_current_balanceMethod
function constraint_mc_current_balance(
 	pm::RectangularVoltageExplicitNeutralModels,
 	nw::Int,
 	i::Int,
@@ -76,7 +76,7 @@
 	bus_storage::Vector{Tuple{Int,Vector{Int}}},
 	bus_loads::Vector{Tuple{Int,Vector{Int}}},
 	bus_shunts::Vector{Tuple{Int,Vector{Int}}}
-)

Kirchhoff's current law applied to buses sum(cr + im*ci) = 0

source
PowerModelsDistribution.constraint_mc_current_balance_capcMethod
constraint_mc_current_balance_capc(pm::AbstractUnbalancedIVRModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Current balance constraints with capacitor control.

source
PowerModelsDistribution.constraint_mc_current_balance_capcMethod
constraint_mc_current_balance_capc(pm::AbstractUnbalancedIVRModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Current balance constraints with capacitor control.

source
PowerModelsDistribution.constraint_mc_current_fromMethod
function constraint_mc_current_from(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	f_bus::Int,
@@ -86,7 +86,7 @@
 	b_sh_fr::Matrix{<:Real};
 	report::Bool=true
 )

For IVR models with explicit neutrals, defines how current distributes over series and shunt impedances of a pi-model branch.

cr_fr == csr_fr + g_sh_fr*vr_fr - b_sh_fr*vi_fr
-ci_fr == csi_fr + g_sh_fr*vi_fr + b_sh_fr*vr_fr
source
PowerModelsDistribution.constraint_mc_current_fromMethod
function constraint_mc_current_from(
 	pm::ReducedExplicitNeutralIVRModels,
 	nw::Int,
 	f_bus::Int,
@@ -96,7 +96,7 @@
 	b_sh_fr::Matrix{<:Real};
 	report::Bool=true
 )

For branch-reduced IVR models with explicit neutrals, defines how current distributes over series and shunt impedances of a pi-model branch.

cr_fr = csr_fr + g_sh_fr*vr_fr - b_sh_fr*vi_fr
-ci_fr = csi_fr + g_sh_fr*vi_fr + b_sh_fr*vr_fr
source
PowerModelsDistribution.constraint_mc_current_toMethod
function constraint_mc_current_to(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	t_bus,
@@ -108,7 +108,7 @@
 	b_sh_to::Matrix{<:Real};
 	report::Bool=true
 )

For IVR models with explicit neutrals, defines how current distributes over series and shunt impedances of a pi-model branch.

cr_to == csr_to + g_sh_to*vr_to - b_sh_to*vi_to
-ci_to == csi_to + g_sh_to*vi_to + b_sh_to*vr_to
source
PowerModelsDistribution.constraint_mc_current_toMethod
function constraint_mc_current_to(
 	pm::ReducedExplicitNeutralIVRModels,
 	nw::Int,
 	t_bus,
@@ -120,35 +120,35 @@
 	b_sh_to::Matrix{<:Real};
 	report::Bool=true
 )

For branch-reduced IVR models with explicit neutrals, defines how current distributes over series and shunt impedances of a pi-model branch.

cr_to = csr_to + g_sh_to*vr_to - b_sh_to*vi_to
-ci_to = csi_to + g_sh_to*vi_to + b_sh_to*vr_to
source
PowerModelsDistribution.constraint_mc_generator_currentMethod
function constraint_mc_generator_current(
 	pm::AbstractExplicitNeutralIVRModel,
 	id::Int;
 	nw::Int=nw_id_default,
 	report::Bool=true,
 	bounded::Bool=true
-)

For IVR models with explicit neutrals, creates expressions for the terminal current flows :crg_bus and :cig_bus.

source
PowerModelsDistribution.constraint_mc_generator_current_deltaMethod
function constraint_mc_generator_current_delta(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
 	connections::Vector{Int};
 	report::Bool=true,
 	bounded::Bool=true
-)

For IVR models with explicit neutrals, creates expressions for the terminal current flows :crg_bus and :cig_bus of delta-connected generators

source
PowerModelsDistribution.constraint_mc_generator_current_wyeMethod
function constraint_mc_generator_current_wye(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
 	connections::Vector{Int};
 	report::Bool=true,
 	bounded::Bool=true
-)

For IVR models with explicit neutrals, creates expressions for the terminal current flows :crg_bus and :cig_bus of wye-connected generators

source
PowerModelsDistribution.constraint_mc_generator_powerMethod
constraint_mc_generator_power(pm::AbstractUnbalancedPowerModel, id::Int; nw::Int=nw_id_default, report::Bool=true, bounded::Bool=true)::Nothing

Template function for generator power constraints

DELTA

When connected in delta, the load power gives the reference in the delta reference frame. This means

\[sd_1 = v_ab.conj(i_ab) = (v_a-v_b).conj(i_ab)\]

We can relate this to the per-phase power by

\[sn_a = v_a.conj(i_a) +)

For IVR models with explicit neutrals, creates expressions for the terminal current flows :crg_bus and :cig_bus of wye-connected generators

source
PowerModelsDistribution.constraint_mc_generator_powerMethod
constraint_mc_generator_power(pm::AbstractUnbalancedPowerModel, id::Int; nw::Int=nw_id_default, report::Bool=true, bounded::Bool=true)::Nothing

Template function for generator power constraints

DELTA

When connected in delta, the load power gives the reference in the delta reference frame. This means

\[sd_1 = v_ab.conj(i_ab) = (v_a-v_b).conj(i_ab)\]

We can relate this to the per-phase power by

\[sn_a = v_a.conj(i_a) = v_a.conj(i_ab-i_ca) = v_a.conj(conj(s_ab/v_ab) - conj(s_ca/v_ca)) - = v_a.(s_ab/(v_a-v_b) - s_ca/(v_c-v_a))\]

So for delta, sn is constrained indirectly.

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
function constraint_mc_generator_power_delta(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	id::Int,
@@ -160,7 +160,7 @@
 	qmax::Vector{<:Real};
 	report::Bool=true,
 	bounded::Bool=true
-)

For ACR models with explicit neutrals, links the terminal power flows :pg_bus and :qg_bus to the power variables :pg and :qg for delta-connected generators

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
function constraint_mc_generator_power_delta(
 	pm::AbstractNLExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -171,7 +171,7 @@
 	qmin::Vector{<:Real},
 	qmax::Vector{<:Real};
 	report::Bool=true
-)

For IVR models with explicit neutrals, creates non-linear expressions for the generator power :pd and :qd of delta-connected generators as a function of voltage and current

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
function constraint_mc_generator_power_delta(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -183,7 +183,7 @@
 	qmax::Vector{<:Real};
 	report::Bool=true,
 	bounded::Bool=true
-)

For quadratic IVR models with explicit neutrals, links the generator power variables :pd and :qd of delta-connected generators to the voltage and current

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::FBSUBFPowerModel, nw::Int, id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (zero-order approximation).

\[\begin{align} +)

For quadratic IVR models with explicit neutrals, links the generator power variables :pd and :qd of delta-connected generators to the voltage and current

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::FBSUBFPowerModel, nw::Int, id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (zero-order approximation).

\[\begin{align} &\text{Initial line-neutral voltage: } V_0 = V_{r0} +j V_{i0}\\ &\text{Three-phase delta transformation matrix: } M^\Delta = \begin{bmatrix}\;\;\;1 & -1 & \;\;0\\ \;\;\;0 & \;\;\;1 & -1\\ -1 & \;\;\;0 & \;\;\;1\end{bmatrix} \\ &\text{Single-phase delta transformation matrix (triple nodes): } M^\Delta = \begin{bmatrix}\;1 & -1 \end{bmatrix} \\ @@ -191,7 +191,7 @@ &\text{Line-line current: } (I^\Delta)^* = S^\Delta \oslash V_0^\Delta \\ &\text{Line-neutral current: } I_{bus} = (M^\Delta)^T I^\Delta \\ &\text{Bus generation power: } S_{bus} = V_0 \oslash I_{bus}^* -\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::FOTPUPowerModel, nw::Int, id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (zero-order approximation).

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::FOTPUPowerModel, nw::Int, id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (zero-order approximation).

\[\begin{align} &\text{Initial line-neutral voltage: } V_0 = V_{m0} \angle V_{a0}\\ &\text{Three-phase delta transformation matrix: } M^\Delta = \begin{bmatrix}\;\;\;1 & -1 & \;\;0\\ \;\;\;0 & \;\;\;1 & -1\\ -1 & \;\;\;0 & \;\;\;1\end{bmatrix} \\ &\text{Single-phase delta transformation matrix (triple nodes): } M^\Delta = \begin{bmatrix}\;1 & -1 \end{bmatrix} \\ @@ -199,7 +199,7 @@ &\text{Line-line current: } (I^\Delta)^* = S^\Delta \oslash V_0^\Delta \\ &\text{Line-neutral current: } I_{bus} = (M^\Delta)^T I^\Delta \\ &\text{Line-neutral generation power: } S_{bus} = V_0 \oslash I_{bus}^* -\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::FOTRUPowerModel, nw::Int, id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (zero-order approximation).

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::FOTRUPowerModel, nw::Int, id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (zero-order approximation).

\[\begin{align} &\text{Initial line-neutral voltage: } V_0 = V_{r0} +j V_{i0}\\ &\text{Three-phase delta transformation matrix: } M^\Delta = \begin{bmatrix}\;\;\;1 & -1 & \;\;0\\ \;\;\;0 & \;\;\;1 & -1\\ -1 & \;\;\;0 & \;\;\;1\end{bmatrix} \\ &\text{Single-phase delta transformation matrix (triple nodes): } M^\Delta = \begin{bmatrix}\;1 & -1 \end{bmatrix} \\ @@ -207,17 +207,17 @@ &\text{Line-line current: } (I^\Delta)^* = S^\Delta \oslash V_0^\Delta \\ &\text{Line-neutral current: } I_{bus} = (M^\Delta)^T I^\Delta \\ &\text{Line-neutral generation power: } S_{bus} = V_0 \oslash I_{bus}^* -\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::LPUBFDiagModel, nw::Int, gen_id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (using auxilary variable X).

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::LPUBFDiagModel, nw::Int, gen_id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (using auxilary variable X).

\[\begin{align} &\text{Three-phase delta transformation matrix: } T^\Delta = \begin{bmatrix}\;\;\;1 & -1 & \;\;0\\ \;\;\;0 & \;\;\;1 & -1\\ -1 & \;\;\;0 & \;\;\;1\end{bmatrix} \\ &\text{Single-phase delta transformation matrix (triple nodes): } T^\Delta = \begin{bmatrix}\;1 & -1 \end{bmatrix} \\ &\text{Line-neutral generation power: } S_{bus} = diag(T^\Delta X_g) \\ &\text{Line-line generation power: } S^\Delta = diag(X_g T^\Delta) -\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::SOCUBFModels, nw::Int, gen_id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (using auxilary variable X).

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_deltaMethod
constraint_mc_generator_power_delta(pm::SOCUBFModels, nw::Int, gen_id::Int, bus_id::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real}; report::Bool=true, bounded::Bool=true)

Adds constraints for delta-connected generators similar to delta-connected loads (using auxilary variable X).

\[\begin{align} &\text{Three-phase delta transformation matrix: } T^\Delta = \begin{bmatrix}\;\;\;1 & -1 & \;\;0\\ \;\;\;0 & \;\;\;1 & -1\\ -1 & \;\;\;0 & \;\;\;1\end{bmatrix} \\ &\text{Single-phase delta transformation matrix (triple nodes): } T^\Delta = \begin{bmatrix}\;1 & -1 \end{bmatrix} \\ &\text{Line-neutral generation power: } S_{bus} = diag(T^\Delta X_g) \\ &\text{Line-line generation power: } S^\Delta = diag(X_g T^\Delta) -\end{align}\]

source
PowerModelsDistribution.constraint_mc_generator_power_wyeMethod
function constraint_mc_generator_power_wye(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	id::Int,
@@ -229,7 +229,7 @@
 	qmax::Vector{<:Real};
 	report::Bool=true,
 	bounded::Bool=true
-)

For ACR models with explicit neutrals, links the terminal power flows :pg_bus and :qg_bus to the power variables :pg and :qg for wye-connected generators

source
PowerModelsDistribution.constraint_mc_generator_power_wyeMethod
function constraint_mc_generator_power_wye(
 	pm::AbstractNLExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -240,7 +240,7 @@
 	qmin::Vector{<:Real},
 	qmax::Vector{<:Real};
 	report::Bool=true
-)

For IVR models with explicit neutrals, creates non-linear expressions for the generator power :pd and :qd of wye-connected generators as a function of voltage and current

source
PowerModelsDistribution.constraint_mc_generator_power_wyeMethod
function constraint_mc_generator_power_wye(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -252,18 +252,18 @@
 	qmax::Vector{<:Real};
 	report::Bool=true,
 	bounded::Bool=true
-)

For quadratic IVR models with explicit neutrals, links the generator power variables :pd and :qd of wye-connected generators to the voltage and current

source
PowerModelsDistribution.constraint_mc_load_currentMethod
function constraint_mc_load_current(
 	pm::AbstractExplicitNeutralIVRModel,
 	id::Int;
 	nw::Int=nw_id_default,
 	report::Bool=true
-)

For IVR models with explicit neutrals, create non-linear expressions for the terminal current flows :crd_bus and :cid_bus

source
PowerModelsDistribution.constraint_mc_load_currentMethod
function constraint_mc_load_current(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	id::Int;
 	nw::Int=nw_id_default,
 	report::Bool=true,
 	bounded::Bool=true
-)

For quadratic IVR models with explicit neutrals, create expressions for the terminal current flows :crd_bus and :cid_bus

source
PowerModelsDistribution.constraint_mc_load_current_deltaMethod
function constraint_mc_load_current_delta(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -274,14 +274,14 @@
 	b::Vector{<:Real},
 	beta::Vector{<:Real};
 	report::Bool=true
-)

For IVR models with explicit neutrals, create non-linear expressions for the terminal current flows :crd_bus and :cid_bus of delta-connected loads

source
PowerModelsDistribution.constraint_mc_load_current_deltaMethod
function constraint_mc_load_current_delta(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
 	connections::Vector{Int};
 	report::Bool=true,
 	bounded::Bool=true
-)

For quadratic IVR models with explicit neutrals, create expressions for the terminal current flows :crd_bus and :cid_bus for delta-connected loads

source
PowerModelsDistribution.constraint_mc_load_current_deltaMethod
constraint_mc_load_current_delta(pm::FOTPUPowerModel, nw::Int, load_id::Int, load_bus_id::Int, cp::Vector, cq::Vector)

No loads require a current variable. Delta loads are zero-order approximations and wye loads are first-order approximations around the initial operating point.

source
PowerModelsDistribution.constraint_mc_load_current_deltaMethod
constraint_mc_load_current_delta(pm::FOTPUPowerModel, nw::Int, load_id::Int, load_bus_id::Int, cp::Vector, cq::Vector)

No loads require a current variable. Delta loads are zero-order approximations and wye loads are first-order approximations around the initial operating point.

source
PowerModelsDistribution.constraint_mc_load_current_wyeMethod
function constraint_mc_load_current_wye(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -292,56 +292,56 @@
 	b::Vector{<:Real},
 	beta::Vector{<:Real};
 	report::Bool=true
-)

For IVR models with explicit neutrals, create non-linear expressions for the terminal current flows :crd_bus and :cid_bus of wye-connected loads

source
PowerModelsDistribution.constraint_mc_load_current_wyeMethod
function constraint_mc_load_current_wye(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
 	connections::Vector{Int};
 	report::Bool=true,
 	bounded::Bool=true
-)

For quadratic IVR models with explicit neutrals, create expressions for the terminal current flows :crd_bus and :cid_bus for wye-connected loads

source
PowerModelsDistribution.constraint_mc_load_powerMethod
function constraint_mc_load_power(
 	pm::AbstractExplicitNeutralIVRModel,
 	id::Int;
 	nw::Int=nw_id_default,
 	report::Bool=true
-)

For IVR models with explicit neutrals, the load power does not require any constraints.

source
PowerModelsDistribution.constraint_mc_load_powerMethod
function constraint_mc_load_power(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	id::Int;
 	nw::Int=nw_id_default,
 	report::Bool=true
-)

For quadratic IVR models with explicit neutrals, link the load power variables :pd and :qd to the voltage, and link together the power, voltage and current variables

source
PowerModelsDistribution.constraint_mc_load_powerMethod
constraint_mc_load_power(pm::AbstractUnbalancedPowerModel, id::Int; nw::Int=nw_id_default, report::Bool=true)::Nothing

Template function for load constraints.

CONSTANT POWER

Fixes the load power sd.

\[sd = [sd_1, sd_2, sd_3]\]

What is actually fixed, depends on whether the load is connected in delta or wye. When connected in wye, the load power equals the per-phase power sn drawn at the bus to which the load is connected.

\[sd_1 = v_a.conj(i_a) = sn_a\]

CONSTANT CURRENT

Sets the active and reactive load power sd to be proportional to the the voltage magnitude.

\[pd = cp.|vm| +)

For quadratic IVR models with explicit neutrals, link the load power variables :pd and :qd to the voltage, and link together the power, voltage and current variables

source
PowerModelsDistribution.constraint_mc_load_powerMethod
constraint_mc_load_power(pm::AbstractUnbalancedPowerModel, id::Int; nw::Int=nw_id_default, report::Bool=true)::Nothing

Template function for load constraints.

CONSTANT POWER

Fixes the load power sd.

\[sd = [sd_1, sd_2, sd_3]\]

What is actually fixed, depends on whether the load is connected in delta or wye. When connected in wye, the load power equals the per-phase power sn drawn at the bus to which the load is connected.

\[sd_1 = v_a.conj(i_a) = sn_a\]

CONSTANT CURRENT

Sets the active and reactive load power sd to be proportional to the the voltage magnitude.

\[pd = cp.|vm| qd = cq.|vm| sd = cp.|vm| + j.cq.|vm|\]

CONSTANT IMPEDANCE

Sets the active and reactive power drawn by the load to be proportional to the square of the voltage magnitude.

\[pd = cp.|vm|^2 qd = cq.|vm|^2 sd = cp.|vm|^2 + j.cq.|vm|^2\]

DELTA

When connected in delta, the load power gives the reference in the delta reference frame. This means

\[sd_1 = v_ab.conj(i_ab) = (v_a-v_b).conj(i_ab)\]

We can relate this to the per-phase power by

\[sn_a = v_a.conj(i_a) = v_a.conj(i_ab-i_ca) = v_a.conj(conj(s_ab/v_ab) - conj(s_ca/v_ca)) - = v_a.(s_ab/(v_a-v_b) - s_ca/(v_c-v_a))\]

So for delta, sn is constrained indirectly.

source
PowerModelsDistribution.constraint_mc_load_powerMethod
constraint_mc_load_power(pm::FBSUBFPowerModel, load_id::Int; nw::Int=nw_id_default, report::Bool=true)

Load model is linearized around initial operating point. Wye loads are first-order and delta loads are zero-order approximations.

\[\begin{align} + = v_a.(s_ab/(v_a-v_b) - s_ca/(v_c-v_a))\]

So for delta, sn is constrained indirectly.

source
PowerModelsDistribution.constraint_mc_load_powerMethod
constraint_mc_load_power(pm::FBSUBFPowerModel, load_id::Int; nw::Int=nw_id_default, report::Bool=true)

Load model is linearized around initial operating point. Wye loads are first-order and delta loads are zero-order approximations.

\[\begin{align} &\text{Initial operating point: } v_{rd}^0 + j ⋅ v_{id}^0~\text{where}~{(v_m^0)}^2 = {(v_{rd}^0)}^2 + {(v_{id}^0)}^2\\ &\text{Constant power: } P^d = P^{d0},~Q^d = Q^{d0} \\ &\text{Constant impedance: } P^d = a ⋅ \left(2\cdot v_{rd} ⋅ v_{rd}^0+2 ⋅ v_{id}*v_{id}^0-{(v_{m}^0)}^2\right),\\ & Q^d = b ⋅ \left(2\cdot v_{rd} ⋅ v_{rd}^0+2 ⋅ v_{id}*v_{id}^0-{(v_{m}^0)}^2\right), \\ &\text{Constant current: } P^d = a ⋅ \left(v_{m}^0 + \frac{v_{rd} ⋅ v_{rd}^0+ v_{id}*v_{id}^0-{(v_{m}^0)}^2}{v_{m}^0} \right),\\ & Q^d = b ⋅ \left(v_{m}^0 + \frac{v_{rd} ⋅ v_{rd}^0+ v_{id}*v_{id}^0-{(v_{m}^0)}^2}{v_{m}^0} \right). -\end{align}\]

source
PowerModelsDistribution.constraint_mc_load_powerMethod
constraint_mc_load_power(pm::FOTPUPowerModel, load_id::Int; nw::Int=nw_id_default, report::Bool=true)

Load model is linearized around initial operating point. Wye loads are first-order and delta loads are zero-order approximations.

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_load_powerMethod
constraint_mc_load_power(pm::FOTPUPowerModel, load_id::Int; nw::Int=nw_id_default, report::Bool=true)

Load model is linearized around initial operating point. Wye loads are first-order and delta loads are zero-order approximations.

\[\begin{align} &\text{Initial operating point: } v_{m0} \angle v_{a0}\\ &\text{Constant power: } P^d = P^{d0},~Q^d = Q^{d0} \\ &\text{Constant impedance: } P^d = a \cdot \left({v_{m0}}^2+2 \cdot v_{m0} \cdot (v_m-v_{m0})\right),\\ & Q^d = b \cdot \left({v_{m0}}^2+2 \cdot v_{m0} \cdot (v_m-v_{m0})\right), \\ &\text{Constant current: } P^d = a \cdot v_m,\\ & Q^d = b \cdot v_m. -\end{align}\]

source
PowerModelsDistribution.constraint_mc_load_powerMethod
constraint_mc_load_power(pm::LPUBFDiagModel, load_id::Int; nw::Int=nw_id_default, report::Bool=true)

Delta/voltage-dependent load models for LPUBFDiagModel. Delta loads use the auxilary power variable (X). The constant current load model is derived by linearizing around the flat-start voltage solution.

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_load_powerMethod
constraint_mc_load_power(pm::LPUBFDiagModel, load_id::Int; nw::Int=nw_id_default, report::Bool=true)

Delta/voltage-dependent load models for LPUBFDiagModel. Delta loads use the auxilary power variable (X). The constant current load model is derived by linearizing around the flat-start voltage solution.

\[\begin{align} &\text{Constant power:} \Rightarrow P_i^d = P_i^{d0},~Q_i^d = Q_i^{d0} ~\forall i \in L \\ &\text{Constant impedance (Wye):} \Rightarrow P_i^d = a_i \cdot w_i,~Q_i^d = b_i \cdot w_i ~\forall i \in L \\ &\text{Constant impedance (Delta):} \Rightarrow P_i^d = 3\cdot a_i \cdot w_i,~Q_i^d = 3\cdot b_i \cdot w_i ~\forall i \in L \\ &\text{Constant current (Wye):} \Rightarrow P_i^d = \frac{a_i}{2}\cdot \left( 1+w_i \right),~Q_i^d = \frac{b_i}{2}\cdot \left( 1+w_i \right) \forall i \in L \\ &\text{Constant current (Delta):} \Rightarrow P_i^d = \frac{\sqrt{3} \cdot a_i}{2}\cdot \left( 1+w_i \right),~Q_i^d = \frac{\sqrt{3} \cdot b_i}{2}\cdot \left( 1+w_i \right) \forall i \in L -\end{align}\]

source
PowerModelsDistribution.constraint_mc_load_power_deltaMethod
function constraint_mc_load_power_delta(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	id::Int,
@@ -352,7 +352,7 @@
 	b::Vector{<:Real},
 	beta::Vector{<:Real};
 	report::Bool=true
-)

For ACR models with explicit neutrals, creates non-linear expressions for terminal power flows ':pdbus' and ':qdbus' of delta-connected loads

source
PowerModelsDistribution.constraint_mc_load_power_deltaMethod
function constraint_mc_load_power_delta(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -363,7 +363,7 @@
 	b::Vector{<:Real};
 	report::Bool=true,
 	bounded::Bool=true
-)

For quadratic IVR models with explicit neutrals, link the load power variables :pd and :qd to the voltage, and link together the power, voltage and current variables for delta-connected loads

source
PowerModelsDistribution.constraint_mc_load_power_wyeMethod
function constraint_mc_load_power_wye(
+)

For quadratic IVR models with explicit neutrals, link the load power variables :pd and :qd to the voltage, and link together the power, voltage and current variables for delta-connected loads

source
PowerModelsDistribution.constraint_mc_load_power_wyeMethod
function constraint_mc_load_power_wye(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	id::Int,
@@ -374,7 +374,7 @@
 	b::Vector{<:Real},
 	beta::Vector{<:Real};
 	report::Bool=true
-)

For ACR models with explicit neutrals, creates non-linear expressions for terminal power flows ':pdbus' and ':qdbus' of wye-connected loads

source
PowerModelsDistribution.constraint_mc_load_power_wyeMethod
function constraint_mc_load_power_wye(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -385,7 +385,7 @@
 	b::Vector{<:Real};
 	report::Bool=true,
 	bounded::Bool=true
-)

For quadratic IVR models with explicit neutrals, link the load power variables :pd and :qd to the voltage, and link together the power, voltage and current variables for wye-connected loads

source
PowerModelsDistribution.constraint_mc_model_voltage_magnitude_differenceMethod
constraint_mc_model_voltage_magnitude_difference(pm::FBSUBFPowerModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, r::Matrix{<:Real}, x::Matrix{<:Real}, g_sh_fr::Matrix{<:Real}, b_sh_fr::Matrix{<:Real})

Voltage drop over a branch linearized around initial operating point (forward sweep)

\[\begin{align} +)

For quadratic IVR models with explicit neutrals, link the load power variables :pd and :qd to the voltage, and link together the power, voltage and current variables for wye-connected loads

source
PowerModelsDistribution.constraint_mc_model_voltage_magnitude_differenceMethod
constraint_mc_model_voltage_magnitude_difference(pm::FBSUBFPowerModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, r::Matrix{<:Real}, x::Matrix{<:Real}, g_sh_fr::Matrix{<:Real}, b_sh_fr::Matrix{<:Real})

Voltage drop over a branch linearized around initial operating point (forward sweep)

\[\begin{align} &\text{Initial operating points: } (v_{r0}^{fr} + j ⋅ v_{i0}^{fr}),~ (v_{r0}^{to} + j ⋅ v_{i0}^{to})\\ &\text{Series active power flow: } p_s^{fr} = p^{fr} - g_{sh}^{fr} ⋅ {(v_{m0}^{fr})}^2,\\ &\text{Series reactive power flow: } q_s^{fr} = q^{fr} + b_{sh}^{fr} ⋅ {(v_{m0}^{fr})}^2,\\ @@ -393,7 +393,7 @@ &\text{Series imaginary current flow: } ci_s^{fr} = \frac{(-q_s^{fr} ⋅ v_{r0}^{fr} + p_s^{fr} ⋅ v_{i0}^{fr})}{{(v_{m0}^{fr})}^2},\\ &\text{Series real voltage drop: } v_{r}^{to} = v_{r}^{fr} - r ⋅ cr_s^{fr} + x ⋅ ci_s^{fr} ,\\ &\text{Series imaginary voltage drop: } v_{i}^{to} = v_{i}^{fr} - x ⋅ cr_s^{fr} - r ⋅ ci_s^{fr}. -\end{align}\]

source
PowerModelsDistribution.constraint_mc_ohms_yt_fromMethod
function constraint_mc_ohms_yt_from(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	f_bus::Int,
@@ -408,7 +408,7 @@
 	B_fr::Matrix{<:Real}
 )

For ACR models with explicit neutrals, creates Ohms constraints for ACR models with explicit neutrals.

s_fr = v_fr.*conj(Y*(v_fr-v_to))
 s_fr = (vr_fr+im*vi_fr).*(G-im*B)*([vr_fr-vr_to]-im*[vi_fr-vi_to])
-s_fr = (vr_fr+im*vi_fr).*([G*vr_fr-G*vr_to-B*vi_fr+B*vi_to]-im*[G*vi_fr-G*vi_to+B*vr_fr-B*vr_to])
source
PowerModelsDistribution.constraint_mc_ohms_yt_fromMethod

Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)

p_fr ==     g[c,c] * vm_fr[c]^2 +
+s_fr = (vr_fr+im*vi_fr).*([G*vr_fr-G*vr_to-B*vi_fr+B*vi_to]-im*[G*vi_fr-G*vi_to+B*vr_fr-B*vr_to])
source
PowerModelsDistribution.constraint_mc_ohms_yt_fromMethod

Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)

p_fr ==     g[c,c] * vm_fr[c]^2 +
             sum( g[c,d]*vm_fr[c]*vm_fr[d]*cos(va_fr[c]-va_fr[d]) +
                  b[c,d]*vm_fr[c]*vm_fr[d]*sin(va_fr[c]-va_fr[d]) for d in conductor_ids(pm) if d != c) +
             sum(-g[c,d]*vm_fr[c]*vm_to[d]*cos(va_fr[c]-va_to[d]) +
@@ -425,7 +425,7 @@
             -b_fr[c,c] *vm_fr[c]^2 -
             sum( b_fr[c,d]*vm_fr[c]*vm_fr[d]*cos(va_fr[c]-va_fr[d]) -
                  g_fr[c,d]*vm_fr[c]*vm_fr[d]*sin(va_fr[c]-va_fr[d]) for d in conductor_ids(pm) if d != c)
-            )
source
PowerModelsDistribution.constraint_mc_ohms_yt_fromMethod
constraint_mc_ohms_yt_from(pm::FOTPUPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, G::Matrix{<:Real}, B::Matrix{<:Real}, G_fr::Matrix{<:Real}, B_fr::Matrix{<:Real})

Ohm constraints similar to ACPUPowerModel. The nonlinear functions are approximated around initial operating points.

source
PowerModelsDistribution.constraint_mc_ohms_yt_fromMethod
constraint_mc_ohms_yt_from(pm::FOTRUPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, G::Matrix{<:Real}, B::Matrix{<:Real}, G_fr::Matrix{<:Real}, B_fr::Matrix{<:Real})

Creates Ohms constraints by linearizing (similar to power balance constraints) around initial operating point.

source
PowerModelsDistribution.constraint_mc_ohms_yt_fromMethod
constraint_mc_ohms_yt_from(pm::FOTPUPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, G::Matrix{<:Real}, B::Matrix{<:Real}, G_fr::Matrix{<:Real}, B_fr::Matrix{<:Real})

Ohm constraints similar to ACPUPowerModel. The nonlinear functions are approximated around initial operating points.

source
PowerModelsDistribution.constraint_mc_ohms_yt_fromMethod
constraint_mc_ohms_yt_from(pm::FOTRUPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, G::Matrix{<:Real}, B::Matrix{<:Real}, G_fr::Matrix{<:Real}, B_fr::Matrix{<:Real})

Creates Ohms constraints by linearizing (similar to power balance constraints) around initial operating point.

source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod
function constraint_mc_ohms_yt_to(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	f_bus::Int,
@@ -439,9 +439,9 @@
 	G_to::Matrix,
 	B_to::Matrix
 )

For ACR models with explicit neutrals, creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form).

p[t_idx] ==  (g+g_to)*v[t_bus]^2 + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[t_bus]-t[f_bus])) + (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
-q[t_idx] == -(b+b_to)*v[t_bus]^2 - (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[f_bus]-t[t_bus])) + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod

Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)

p[t_idx] ==  (g+g_to)*v[t_bus]^2 + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[t_bus]-t[f_bus])) + (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
-q[t_idx] == -(b+b_to)*v[t_bus]^2 - (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[f_bus]-t[t_bus])) + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod

Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)

p[t_idx] ==  (g+g_to)*v[t_bus]^2 + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[t_bus]-t[f_bus])) + (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
-q[t_idx] == -(b+b_to)*v[t_bus]^2 - (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[f_bus]-t[t_bus])) + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod
constraint_mc_ohms_yt_to(pm::FOTPUPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, G::Matrix{<:Real}, B::Matrix{<:Real}, G_to::Matrix{<:Real}, B_to::Matrix{<:Real})

Ohm constraints similar to ACPUPowerModel. The nonlinear functions are approximated around initial operating points.

source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod
constraint_mc_ohms_yt_to(pm::FOTRUPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, G::Matrix, B::Matrix, G_to::Matrix, B_to::Matrix)

Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
constraint_mc_power_balance(pm::AbstractUnbalancedActivePowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

power balanace constraint with line shunts and transformers, active power only

\[p_{br} + p_{tr} + p_{sw} == p_{g} - p_{s} - p_{d} - G\]

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
constraint_mc_power_balance(pm::FBSUBFPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints similar to ACRUPowerModel with shunt current calculated using initial operating point.

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
constraint_mc_power_balance(pm::FOTPUPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance equations similar to ACPUPowerModel. The nonlinear functions are approximated around initial operating point.

\[\begin{align} +q[t_idx] == -(b+b_to)*v[t_bus]^2 - (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[f_bus]-t[t_bus])) + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))

source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod

Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)

p[t_idx] ==  (g+g_to)*v[t_bus]^2 + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[t_bus]-t[f_bus])) + (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
+q[t_idx] == -(b+b_to)*v[t_bus]^2 - (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[f_bus]-t[t_bus])) + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod

Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)

p[t_idx] ==  (g+g_to)*v[t_bus]^2 + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[t_bus]-t[f_bus])) + (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
+q[t_idx] == -(b+b_to)*v[t_bus]^2 - (-b*tr+g*ti)/tm*(v[t_bus]*v[f_bus]*cos(t[f_bus]-t[t_bus])) + (-g*tr-b*ti)/tm*(v[t_bus]*v[f_bus]*sin(t[t_bus]-t[f_bus]))
source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod
constraint_mc_ohms_yt_to(pm::FOTPUPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, G::Matrix{<:Real}, B::Matrix{<:Real}, G_to::Matrix{<:Real}, B_to::Matrix{<:Real})

Ohm constraints similar to ACPUPowerModel. The nonlinear functions are approximated around initial operating points.

source
PowerModelsDistribution.constraint_mc_ohms_yt_toMethod
constraint_mc_ohms_yt_to(pm::FOTRUPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, G::Matrix, B::Matrix, G_to::Matrix, B_to::Matrix)

Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
constraint_mc_power_balance(pm::AbstractUnbalancedActivePowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

power balanace constraint with line shunts and transformers, active power only

\[p_{br} + p_{tr} + p_{sw} == p_{g} - p_{s} - p_{d} - G\]

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
constraint_mc_power_balance(pm::FBSUBFPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints similar to ACRUPowerModel with shunt current calculated using initial operating point.

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
constraint_mc_power_balance(pm::FOTPUPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance equations similar to ACPUPowerModel. The nonlinear functions are approximated around initial operating point.

\[\begin{align} &\text{Initial operating points: } v_{m0}^{t} \angle v_{a0}^t,~v_{m0}^u \angle v_{a0}^u\\ & {v_m^t}^2 \Rightarrow {v_{m0}^t}^2+2 \cdot v_{m0}^t \cdot (v_m^t-v_{m0}^t)\\ & v_m^t \cdot v_m^u \cdot \cos(v_a^t-v_a^u) \Rightarrow v_{m0}^t \cdot v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) + @@ -470,10 +470,10 @@ v_a^t-v_{a0}^t \\ v_a^u-v_{a0}^u \end{bmatrix} -\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
constraint_mc_power_balance(pm::FOTRUPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints similar to ACRUPowerModel with shunt current linearized around initial operating point.

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
constraint_mc_power_balance(pm::FOTRUPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints similar to ACRUPowerModel with shunt current linearized around initial operating point.

\[\begin{align} &\text{Initial operating point: } (v_{r0} + j ⋅ v_{i0})\\ & v_{r} ⋅ v_{i} = v_{r0} ⋅ v_{i0} + v_{r} ⋅ v_{i0} + v_{r0} ⋅ v_{i} - 2 ⋅ v_{r0} ⋅ v_{i0} -\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balanceMethod
function constraint_mc_power_balance(
 	pm::RectangularVoltageExplicitNeutralModels,
 	nw::Int,
 	i::Int,
@@ -486,15 +486,15 @@
 	bus_storage::Vector{Tuple{Int,Vector{Int}}},
 	bus_loads::Vector{Tuple{Int,Vector{Int}}},
 	bus_shunts::Vector{Tuple{Int,Vector{Int}}}
-)

Imposes power balance constraints at each ungrounded terminal of bus i for rectangular voltage models with explicit neutrals. sum(p + im*q) = 0

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::AbstractUnbalancedACPModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control.

\[\begin{align} +)

Imposes power balance constraints at each ungrounded terminal of bus i for rectangular voltage models with explicit neutrals. sum(p + im*q) = 0

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::AbstractUnbalancedACPModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control.

\[\begin{align} & Bs = z ⋅ bs, \\ &\text{capacitor ON: } z = 1, \\ &\text{capacitor OFF: } z = 0. -\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::AbstractUnbalancedACRModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control.

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::AbstractUnbalancedACRModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control.

\[\begin{align} & Bt = z ⋅ bs, \\ &\text{capacitor ON: } z = 1, \\ &\text{capacitor OFF: } z = 0. -\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::FBSUBFPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control similar to ACRUPowerModel with shunt current calculated using initial operating point.

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::FOTPUPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control with shunt current calculated using initial operating point.

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::FBSUBFPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control similar to ACRUPowerModel with shunt current calculated using initial operating point.

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::FOTPUPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control with shunt current calculated using initial operating point.

\[\begin{align} & B_s = b_s ⋅ z,~~ cq_{sh} = B_s ⋅ v, \\ & B_s \cdot v_m^t \cdot v_m^u \cdot \cos(v_a^t-v_a^u) \Rightarrow B_{s0} \cdot v_{m0}^t \cdot v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) + \begin{bmatrix} @@ -527,21 +527,21 @@ B_{s} -B_{s0} \end{bmatrix} -\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::FOTRUPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control with shunt current calculated using initial operating point.

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::FOTRUPowerModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control with shunt current calculated using initial operating point.

\[\begin{align} & B_t = b_s ⋅ z,~~ cq_{sh} = B_t ⋅ v, \\ &\text{FOT approximation: } B_t ⋅ v_r ⋅ v_i = B_{t0} ⋅ v_{r0} ⋅ v_{i0} + B_{t} ⋅ v_{r0} ⋅ v_{i0} + B_{t0} ⋅ v_{r} ⋅ v_{i0} + B_{t0} ⋅ v_{r0} ⋅ v_{i} - 3 ⋅ B_{t0} ⋅ v_{r0} ⋅ v_{i0} -\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::LPUBFDiagModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control linearized using McCormick envelopes

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_balance_capcMethod
constraint_mc_power_balance_capc(pm::LPUBFDiagModel, nw::Int, i::Int, terminals::Vector{Int}, grounded::Vector{Bool}, bus_arcs::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_sw::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_arcs_trans::Vector{Tuple{Tuple{Int,Int,Int},Vector{Int}}}, bus_gens::Vector{Tuple{Int,Vector{Int}}}, bus_storage::Vector{Tuple{Int,Vector{Int}}}, bus_loads::Vector{Tuple{Int,Vector{Int}}}, bus_shunts::Vector{Tuple{Int,Vector{Int}}})

Power balance constraints with capacitor control linearized using McCormick envelopes

\[\begin{align} & B_s = b_s ⋅ z,~~ cq_{sh} = B_s ⋅ w, \\ &\text{Underestimator: } cq_{sh} ≥ B_s ⋅ w_\text{min},~~ cq_{sh} ≥ b_s ⋅ w + B_s ⋅ w_\text{max} - b_s ⋅ w_\text{max}\\ &\text{Overestimator: } cq_{sh} ≤ B_s ⋅ w_\text{max},~~ cq_{sh} ≤ b_s ⋅ w + B_s ⋅ w_\text{min} - b_s ⋅ w_\text{min}\\ -\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_lossesMethod
constraint_mc_power_losses(pm::FBSUBFPowerModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, r::Matrix{<:Real}, x::Matrix{<:Real}, g_sh_fr::Matrix{<:Real}, g_sh_to::Matrix{<:Real}, b_sh_fr::Matrix{<:Real}, b_sh_to::Matrix{<:Real})

Branch flow model power flow equation linearized around initial operating point (backward sweep)

\[\begin{align} +\end{align}\]

source
PowerModelsDistribution.constraint_mc_power_lossesMethod
constraint_mc_power_losses(pm::FBSUBFPowerModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, r::Matrix{<:Real}, x::Matrix{<:Real}, g_sh_fr::Matrix{<:Real}, g_sh_to::Matrix{<:Real}, b_sh_fr::Matrix{<:Real}, b_sh_to::Matrix{<:Real})

Branch flow model power flow equation linearized around initial operating point (backward sweep)

\[\begin{align} &\text{Initial operating points: } (v_{r0}^{fr} + j ⋅ v_{i0}^{fr}),~ (v_{r0}^{to} + j ⋅ v_{i0}^{to})\\ &\text{Voltage drop: } v_{drop} = (v_{r0}^{fr} + j ⋅ v_{i0}^{fr}) - (v_{r0}^{to} + j ⋅ v_{i0}^{to}),\\ &\text{Line series admittance: } y = (r+j ⋅ x)^{-1},\\ &\text{Power loss: } s_{loss} = v_{drop} ⋅ (y ⋅ v_{drop})^*,\\ &\text{Active power flow: } p^{fr} + p^{to} = g_{sh}^{fr} ⋅ {(v_{m0}^{fr})}^2 + g_{sh}^{to} ⋅ {(v_{m0}^{to})}^2 + \Re(s_{loss}),\\ &\text{Reactive power flow: } q^{fr} + q^{to} = -b_{sh}^{fr} ⋅ {(v_{m0}^{fr})}^2 - b_{sh}^{to} ⋅ {(v_{m0}^{to})}^2 + \Im(s_{loss}). -\end{align}\]

source
PowerModelsDistribution.constraint_mc_switch_ampacityMethod
constraint_mc_switch_ampacity(pm::AbstractUnbalancedACPModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on switches

mathp_{fr}^2 + q_{fr}^2 \leq vm_{fr}^2 i_{max}^2

source
PowerModelsDistribution.constraint_mc_switch_ampacityMethod
constraint_mc_switch_ampacity(pm::AbstractUnbalancedRectangularModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on switches

mathp_{fr}^2 + q_{fr}^2 \leq (vr_{fr}^2 + vi_{fr}^2) i_{max}^2

source
PowerModelsDistribution.constraint_mc_switch_ampacityMethod
constraint_mc_switch_ampacity(pm::AbstractUnbalancedWModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on switches from-side

mathp_{fr}^2 + q_{fr}^2 \leq w_{fr} i_{max}^2

source
PowerModelsDistribution.constraint_mc_switch_ampacityMethod
constraint_mc_switch_ampacity(pm::AbstractUnbalancedWModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})

ACP current limit constraint on switches from-side

mathp_{fr}^2 + q_{fr}^2 \leq w_{fr} i_{max}^2

source
PowerModelsDistribution.constraint_mc_switch_ampacityMethod
constraint_mc_switch_ampacity(pm::AbstractUnbalancedACPModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on switches

mathp_{fr}^2 + q_{fr}^2 \leq vm_{fr}^2 i_{max}^2

source
PowerModelsDistribution.constraint_mc_switch_ampacityMethod
constraint_mc_switch_ampacity(pm::AbstractUnbalancedRectangularModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on switches

mathp_{fr}^2 + q_{fr}^2 \leq (vr_{fr}^2 + vi_{fr}^2) i_{max}^2

source
PowerModelsDistribution.constraint_mc_switch_ampacityMethod
constraint_mc_switch_ampacity(pm::AbstractUnbalancedWModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})::Nothing

ACP current limit constraint on switches from-side

mathp_{fr}^2 + q_{fr}^2 \leq w_{fr} i_{max}^2

source
PowerModelsDistribution.constraint_mc_switch_ampacityMethod
constraint_mc_switch_ampacity(pm::AbstractUnbalancedWModels, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, c_rating::Vector{<:Real})

ACP current limit constraint on switches from-side

mathp_{fr}^2 + q_{fr}^2 \leq w_{fr} i_{max}^2

source
PowerModelsDistribution.constraint_mc_switch_currentMethod
function constraint_mc_switch_current(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -550,24 +550,24 @@
 	f_connections::Vector{Int},
 	t_connections::Vector{Int};
 	report::Bool=true
-)

For IVR models with explicit neutrals, create expressions for the terminal current flows :crsw_bus and cisw_bus, and link the from-side to the to-side switch current

source
PowerModelsDistribution.constraint_mc_switch_current_limitMethod
function constraint_mc_switch_current_limit(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	f_connections::Vector{Int},
 	rating::Vector{<:Real}
-)

For ACR models with explicit neutrals, imposes a bound on the switch current magnitude per conductor. Note that a bound on the from-side implies the same bound on the to-side current, so it suffices to apply this only explicitly at the from-side.

source
PowerModelsDistribution.constraint_mc_switch_current_limitMethod
function constraint_mc_switch_current_limit(
+)

For ACR models with explicit neutrals, imposes a bound on the switch current magnitude per conductor. Note that a bound on the from-side implies the same bound on the to-side current, so it suffices to apply this only explicitly at the from-side.

source
PowerModelsDistribution.constraint_mc_switch_current_limitMethod
function constraint_mc_switch_current_limit(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	connections::Vector{Int},
 	rating::Vector{<:Real}
-)

For IVR models with explicit neutrals, imposes a bound on the switch current magnitude per conductor. Note that a bound on the from-side implies the same bound on the to-side current, so it suffices to apply this only explicitly at the from-side.

source
PowerModelsDistribution.constraint_mc_switch_powerMethod
function constraint_mc_switch_power(
+)

For IVR models with explicit neutrals, imposes a bound on the switch current magnitude per conductor. Note that a bound on the from-side implies the same bound on the to-side current, so it suffices to apply this only explicitly at the from-side.

source
PowerModelsDistribution.constraint_mc_switch_powerMethod
function constraint_mc_switch_power(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	id::Int,
@@ -576,84 +576,84 @@
 	f_connections::Vector{Int},
 	t_connections::Vector{Int};
 	report::Bool=true
-)

constraintmcswitchpower( pm::ReducedExplicitNeutralIVRModels, nw::Int, id::Int, fidx::Tuple{Int,Int,Int}, tidx::Tuple{Int,Int,Int}, fconnections::Vector{Int}, t_connections::Vector{Int}; report::Bool=true )

For IVR models with explicit neutrals, create expressions for the terminal power flows :psw_bus and qsw_bus, and link the from-side to the to-side switch power

source
PowerModelsDistribution.constraint_mc_switch_powerMethod
function constraint_mc_switch_power(
+)

constraintmcswitchpower( pm::ReducedExplicitNeutralIVRModels, nw::Int, id::Int, fidx::Tuple{Int,Int,Int}, tidx::Tuple{Int,Int,Int}, fconnections::Vector{Int}, t_connections::Vector{Int}; report::Bool=true )

For IVR models with explicit neutrals, create expressions for the terminal power flows :psw_bus and qsw_bus, and link the from-side to the to-side switch power

source
PowerModelsDistribution.constraint_mc_switch_powerMethod
function constraint_mc_switch_power(
     pm::ExplicitNeutralModels,
     id::Int;
     nw::Int=nw_id_default,
     report::Bool=true
-)

For IVR models with explicit neutrals, link the switch power or create appropiate expressions for them

source
PowerModelsDistribution.constraint_mc_switch_thermal_limitMethod
function constraint_mc_switch_thermal_limit(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	f_connections::Vector{Int},
 	rating::Vector{<:Real}
-)

For ACR models with explicit neutrals, imposes a bound on the switch power magnitude per conductor. Note that a bound on the from-side implies the same bound on the to-side power when the switch is closed (equal voltages), and also when it is open since the power then equals zero on both ends.

source
PowerModelsDistribution.constraint_mc_switch_thermal_limitMethod
function constraint_mc_switch_thermal_limit(
+)

For ACR models with explicit neutrals, imposes a bound on the switch power magnitude per conductor. Note that a bound on the from-side implies the same bound on the to-side power when the switch is closed (equal voltages), and also when it is open since the power then equals zero on both ends.

source
PowerModelsDistribution.constraint_mc_switch_thermal_limitMethod
function constraint_mc_switch_thermal_limit(
 	pm::AbstractNLExplicitNeutralIVRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	f_connections::Vector{Int},
 	rating::Vector{<:Real}
-)

This method is not yet implemented for AbstractLPUBFModel. If the limit is finite, a warning is thrown.

source
PowerModelsDistribution.constraint_mc_switch_thermal_limitMethod
function constraint_mc_switch_thermal_limit(
 	pm::AbstractNLExplicitNeutralIVRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	f_connections::Vector{Int},
 	rating::Vector{<:Real}
-)

For IVR models with explicit neutrals, imposes a bound on the switch power magnitude per conductor. Note that a bound on the from-side implies the same bound on the to-side power when the switch is closed (equal voltages), and also when it is open since the power then equals zero on both ends.

source
PowerModelsDistribution.constraint_mc_switch_thermal_limitMethod
function constraint_mc_switch_thermal_limit(
+)

For IVR models with explicit neutrals, imposes a bound on the switch power magnitude per conductor. Note that a bound on the from-side implies the same bound on the to-side power when the switch is closed (equal voltages), and also when it is open since the power then equals zero on both ends.

source
PowerModelsDistribution.constraint_mc_switch_thermal_limitMethod
function constraint_mc_switch_thermal_limit(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	f_connections::Vector{Int},
 	rating::Vector{<:Real}
-)

For quadratic IVR models with explicit neutrals, throw an error because this cannot be represented quadratically without introducing explicit power variables.

source
PowerModelsDistribution.constraint_mc_switch_thermal_limitMethod
constraint_mc_switch_thermal_limit(pm::AbstractUnbalancedActivePowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, rating::Vector{<:Real})::Nothing

Active power only switch thermal limit constraint

math-S_{max} \leq p_{fr} \leq S_{max}

source
PowerModelsDistribution.constraint_mc_switch_thermal_limitMethod
constraint_mc_switch_thermal_limit(pm::AbstractUnbalancedActivePowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, rating::Vector{<:Real})::Nothing

Active power only switch thermal limit constraint

math-S_{max} \leq p_{fr} \leq S_{max}

source
PowerModelsDistribution.constraint_mc_thermal_limit_fromMethod
function constraint_mc_thermal_limit_from(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	f_connections::Vector{Int},
 	rate_a::Vector{<:Real}
-)

For ACR models with explicit neutrals, imposes a bound on the from-side line power magnitude.

source
PowerModelsDistribution.constraint_mc_thermal_limit_fromMethod
function constraint_mc_thermal_limit_from(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	f_connections::Vector{Int},
 	rate_a::Vector{<:Real}
-)

For IVR models with explicit neutrals, imposes a bound on the from-side line power magnitude.

source
PowerModelsDistribution.constraint_mc_thermal_limit_fromMethod
function constraint_mc_thermal_limit_from(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	f_idx::Tuple{Int,Int,Int},
 	f_connections::Vector{Int},
 	rate_a::Vector{<:Real}
-)

For quadratic IVR models with explicit neutrals, throw an error because this cannot be represented quadratically without introducing explicit power variables.

source
PowerModelsDistribution.constraint_mc_thermal_limit_toMethod
function constraint_mc_thermal_limit_to(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	t_idx::Tuple{Int,Int,Int},
 	t_connections::Vector{Int},
 	rate_a::Vector{<:Real}
-)

For ACR models with explicit neutrals, imposes a bound on the from-side line power magnitude.

source
PowerModelsDistribution.constraint_mc_thermal_limit_toMethod
function constraint_mc_thermal_limit_to(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	t_idx::Tuple{Int,Int,Int},
 	t_connections::Vector{Int},
 	rate_a::Vector{<:Real}
-)

For IVR models with explicit neutrals, imposes a bound on the to-side line power magnitude.

source
PowerModelsDistribution.constraint_mc_thermal_limit_toMethod
function constraint_mc_thermal_limit_to(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	t_idx::Tuple{Int,Int,Int},
 	t_connections::Vector{Int},
 	rate_a::Vector{<:Real}
-)

For quadratic IVR models with explicit neutrals, throw an error because this cannot be represented quadratically without introducing explicit power variables.

source
PowerModelsDistribution.constraint_mc_theta_refMethod
function constraint_mc_theta_ref(
 	pm::RectangularVoltageExplicitNeutralModels,
 	nw::Int,
 	i::Int,
 	va::Vector{<:Real},
 	terminals::Vector{Int},
 	grounded::Vector{Bool}
-)

Creates phase angle constraints at bus i

source
PowerModelsDistribution.constraint_mc_transformer_currentMethod
function constraint_mc_transformer_current(
 	pm::AbstractExplicitNeutralIVRModel,
 	i::Int;
 	nw::Int=nw_id_default,
 	fix_taps::Bool=true
-)

For IVR models with explicit neutrals, links the current variables of the from-side and to-side transformer windings, and creates expressions for the terminal current flows

source
PowerModelsDistribution.constraint_mc_transformer_current_dyMethod
function constraint_mc_transformer_current_dy(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	trans_id::Int,
@@ -668,7 +668,7 @@
 	tm_fixed::Vector{Bool},
 	tm_scale::Real
 )

For IVR models with explicit neutrals, links the current variables of the from-side and to-side transformer windings, and creates expressions for the terminal current flows for delta-wye connected transformers

scale*cr_fr_P + cr_to_P == 0
-scale*ci_fr_P + ci_to_P == 0
source
PowerModelsDistribution.constraint_mc_transformer_current_yyMethod
function constraint_mc_transformer_current_yy(
 	pm::AbstractExplicitNeutralIVRModel,
 	nw::Int,
 	trans_id::Int,
@@ -683,7 +683,7 @@
 	tm_fixed::Vector{Bool},
 	tm_scale::Real
 )

For IVR models with explicit neutrals, links the current variables of the from-side and to-side transformer windings, and creates expressions for the terminal current flows for wye-wye connected transformers

scale*cr_fr_P + cr_to_P == 0
-scale*ci_fr_P + ci_to_P == 0
source
PowerModelsDistribution.constraint_mc_transformer_powerMethod
constraint_mc_transformer_power(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default, fix_taps::Bool=true)::Nothing

Template function for Transformer constraints in Power-voltage space, considering winding type, conductor order, polarity and tap settings.

source
PowerModelsDistribution.constraint_mc_transformer_powerMethod
constraint_mc_transformer_power(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default, fix_taps::Bool=true)::Nothing

Template function for Transformer constraints in Power-voltage space, considering winding type, conductor order, polarity and tap settings.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
function constraint_mc_transformer_power_dy(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	trans_id::Int,
@@ -697,7 +697,7 @@
 	tm_set::Vector{<:Real},
 	tm_fixed::Vector{Bool},
 	tm_scale::Real
-)

For ACR models with explicit neutrals, links the from-side and to-side power variables of delta-wye connected transformers. Expressions for the terminal power flow variables are also added.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
constraint_mc_transformer_power_dy(pm::FBSUBFPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, delta-wye connected transformer similar to ACRUPowerModel with power constraints using initial operating point voltage instead of actual voltage variables.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
constraint_mc_transformer_power_dy(pm::FOTPUPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, delta-wye connected transformer similar to ACPUPowerModel with voltage constraints linearized using first-order Taylor approximation and power constraints simplified using initial operating point voltage instead of actual voltage variables.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
constraint_mc_transformer_power_dy(pm::FOTRUPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, delta-wye connected transformer similar to ACRUPowerModel with power constraints using initial operating point voltage instead of actual voltage variables.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
constraint_mc_transformer_power_dy(pm::SOCUBFModels, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Constraints to model a two-winding, delta-wye connected transformer.

\[\begin{align} +)

For ACR models with explicit neutrals, links the from-side and to-side power variables of delta-wye connected transformers. Expressions for the terminal power flow variables are also added.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
constraint_mc_transformer_power_dy(pm::FBSUBFPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, delta-wye connected transformer similar to ACRUPowerModel with power constraints using initial operating point voltage instead of actual voltage variables.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
constraint_mc_transformer_power_dy(pm::FOTPUPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, delta-wye connected transformer similar to ACPUPowerModel with voltage constraints linearized using first-order Taylor approximation and power constraints simplified using initial operating point voltage instead of actual voltage variables.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
constraint_mc_transformer_power_dy(pm::FOTRUPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, delta-wye connected transformer similar to ACRUPowerModel with power constraints using initial operating point voltage instead of actual voltage variables.

source
PowerModelsDistribution.constraint_mc_transformer_power_dyMethod
constraint_mc_transformer_power_dy(pm::SOCUBFModels, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Constraints to model a two-winding, delta-wye connected transformer.

\[\begin{align} &{W}_{fr}^{ij}-{W}_{fr}^{ik}-{W}_{fr}^{lj}+{W}_{fr}^{lk} = t_m^2{W}_{to}^{ij} ~\forall i,j \in \{1,2,3\}~ \text{and}~ k,l \in \{2,3,1\} \\ &{S}_{fr} = X_tT_t \\ &{S}_{fr}^\Delta = T_tX_t \\ @@ -707,7 +707,7 @@ {W}_{fr} & {X}_{t} \\ {X}_{t}^{\text{H}} & {L}_{\Delta} \end{bmatrix} \succeq 0 -\end{align}\]

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
function constraint_mc_transformer_power_yy(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	trans_id::Int,
@@ -721,10 +721,10 @@
 	tm_set::Vector{<:Real},
 	tm_fixed::Vector{Bool},
 	tm_scale::Real
-)

For ACR models with explicit neutrals, links the from-side and to-side power variables of wye-wye connected transformers. Expressions for the terminal power flow variables are also added.

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
constraint_mc_transformer_power_yy(pm::FBSUBFPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, wye-wye connected transformer similar to ACRUPowerModel.

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
constraint_mc_transformer_power_yy(pm::FOTPUPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, wye-wye connected transformer similar to ACPUPowerModel.

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
constraint_mc_transformer_power_yy(pm::FOTRUPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, wye-wye connected transformer similar to ACRUPowerModel.

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
constraint_mc_transformer_power_yy(pm::SOCUBFModels, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Constraints to model a two-winding, wye-wye connected transformer.

\[\begin{align} +)

For ACR models with explicit neutrals, links the from-side and to-side power variables of wye-wye connected transformers. Expressions for the terminal power flow variables are also added.

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
constraint_mc_transformer_power_yy(pm::FBSUBFPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, wye-wye connected transformer similar to ACRUPowerModel.

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
constraint_mc_transformer_power_yy(pm::FOTPUPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, wye-wye connected transformer similar to ACPUPowerModel.

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
constraint_mc_transformer_power_yy(pm::FOTRUPowerModel, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Add all constraints required to model a two-winding, wye-wye connected transformer similar to ACRUPowerModel.

source
PowerModelsDistribution.constraint_mc_transformer_power_yyMethod
constraint_mc_transformer_power_yy(pm::SOCUBFModels, nw::Int, trans_id::Int, f_bus::Int, t_bus::Int, f_idx::Tuple{Int,Int,Int}, t_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, pol::Int, tm_set::Vector{<:Real}, tm_fixed::Vector{Bool}, tm_scale::Real)

Constraints to model a two-winding, wye-wye connected transformer.

\[\begin{align} & {W}_{fr} = {T}_{m}{T}_{m}^{H} {W}_{to} \\ & {s}_{fr} + {s}_{to} = 0 -\end{align}\]

source
PowerModelsDistribution.constraint_mc_transformer_thermal_limitMethod
function constraint_mc_transformer_thermal_limit(
 	pm::AbstractExplicitNeutralACRModel,
 	nw::Int,
 	id::Int,
@@ -738,7 +738,7 @@
 	sm_ub::Real;
 	report::Bool=true
 )

For ACR models with explicit neutrals, imposes a bound on the magnitude of the total apparent power at each winding of the transformer.

sum(pt_fr)^2 + sum(qt_fr)^2 <= sm_ub^2
-sum(pt_to)^2 + sum(qt_to)^2 <= sm_ub^2
source
PowerModelsDistribution.constraint_mc_transformer_thermal_limitMethod
function constraint_mc_transformer_thermal_limit(
 	pm::AbstractNLExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -752,7 +752,7 @@
 	sm_ub::Real;
 	report::Bool=true
 )

For non-linear IVR models with explicit neutrals, imposes a bound on the magnitude of the total apparent power at both windings. Expressions are created for the transformer power variables.

sum(pt_fr)^2 + sum(qt_fr)^2 <= sm_ub^2
-sum(pt_to)^2 + sum(qt_to)^2 <= sm_ub^2
source
PowerModelsDistribution.constraint_mc_transformer_thermal_limitMethod
function constraint_mc_transformer_thermal_limit(
 	pm::AbstractQuadraticExplicitNeutralIVRModel,
 	nw::Int,
 	id::Int,
@@ -766,18 +766,18 @@
 	sm_ub::Real;
 	report::Bool=true
 )

For quadratic IVR models with explicit neutrals, imposes a bound on the magnitude of the total apparent power at both windings.

sum(pt_fr)^2 + sum(qt_fr)^2 <= sm_ub^2
-sum(pt_to)^2 + sum(qt_to)^2 <= sm_ub^2
source
PowerModelsDistribution.constraint_mc_transformer_voltage_dyMethod
function constraint_mc_transformer_voltage_dy(
 	pm::RectangularVoltageExplicitNeutralModels,
 	nw::Int,
 	trans_id::Int,
@@ -792,7 +792,7 @@
 	tm_fixed::Vector{Bool},
 	tm_scale::Real
 )

For rectangular voltage models with explicit neutrals, links the voltage of the from-side and to-side transformer windings for delta-wye connected transformers

Md*vr_fr_P == scale * (vr_to_P - vr_to_n)
-Md*vi_fr_P == scale * (vi_to_P - vi_to_n)
source
PowerModelsDistribution.constraint_mc_transformer_voltage_yyMethod
function constraint_mc_transformer_voltage_yy(
 	pm::RectangularVoltageExplicitNeutralModels,
 	nw::Int,
 	trans_id::Int,
@@ -807,7 +807,7 @@
 	tm_fixed::Vector{Bool},
 	tm_scale::Real
 )

For rectangular voltage models with explicit neutrals, links the voltage of the from-side and to-side transformer windings for wye-wye connected transformers

(vr_fr_P-vr_fr_n) == scale * (vr_to_P.-vr_to_n)
-(vi_fr_P-vi_fr_n) == scale * (vi_to_P.-vi_to_n)
source
PowerModelsDistribution.constraint_mc_voltage_absoluteMethod
function constraint_mc_voltage_absolute(
 	pm::RectangularVoltageExplicitNeutralModels,
 	nw::Int,
 	i::Int,
@@ -816,13 +816,13 @@
 	vmin::Vector{<:Real},
 	vmax::Vector{<:Real};
 	report::Bool=true
-)

Imposes absolute voltage magnitude bounds for models with explicit neutrals

source
PowerModelsDistribution.constraint_mc_voltage_absoluteMethod
function constraint_mc_voltage_absolute(
     pm::RectangularVoltageExplicitNeutralModels,
     id::Int;
     nw::Int=nw_id_default,
     bounded::Bool=true,
     report::Bool=true,
-)

Imposes absolute voltage magnitude bounds for models with explicit neutrals

source
PowerModelsDistribution.constraint_mc_voltage_angle_differenceMethod
constraint_mc_voltage_angle_difference(pm::FBSUBFPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, angmin::Vector{<:Real}, angmax::Vector{<:Real})

Nothing to do, this model ignores angle difference constraints"

source
PowerModelsDistribution.constraint_mc_voltage_angle_differenceMethod
constraint_mc_voltage_angle_difference(pm::FOTRUPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, angmin::Vector{<:Real}, angmax::Vector{<:Real})

Nothing to do, this model ignores angle difference constraints"

source
PowerModelsDistribution.constraint_mc_voltage_angle_differenceMethod
constraint_mc_voltage_angle_difference(pm::FBSUBFPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, angmin::Vector{<:Real}, angmax::Vector{<:Real})

Nothing to do, this model ignores angle difference constraints"

source
PowerModelsDistribution.constraint_mc_voltage_angle_differenceMethod
constraint_mc_voltage_angle_difference(pm::FOTRUPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, t_connections::Vector{Int}, angmin::Vector{<:Real}, angmax::Vector{<:Real})

Nothing to do, this model ignores angle difference constraints"

source
PowerModelsDistribution.constraint_mc_voltage_fixedMethod
function constraint_mc_voltage_fixed(
 	pm::RectangularVoltageExplicitNeutralModels,
 	nw::Int,
 	i::Int,
@@ -830,14 +830,14 @@
 	va::Vector{<:Real},
 	terminals::Vector{Int},
 	grounded::Vector{Bool}
-)

Fixes the voltage variables at bus i to vm.*exp.(im*va)

source
PowerModelsDistribution.constraint_mc_voltage_magnitude_boundsMethod
constraint_mc_voltage_magnitude_bounds(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing

Template function for voltage magnitude bounds constraints.

This constraint captures problem agnostic constraints that define limits for voltage magnitudes (where variable bounds cannot be used). Notable examples include IVRUPowerModel and ACRUPowerModel.

source
PowerModelsDistribution.constraint_mc_voltage_magnitude_boundsMethod
constraint_mc_voltage_magnitude_bounds(pm::FBSUBFPowerModel, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})

Upper voltage magnitude limits are linearized using outer approximation. Lower voltage magnitude limits are linearized around initial operating point.

\[\begin{align} +)

Fixes the voltage variables at bus i to vm.*exp.(im*va)

source
PowerModelsDistribution.constraint_mc_voltage_magnitude_boundsMethod
constraint_mc_voltage_magnitude_bounds(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing

Template function for voltage magnitude bounds constraints.

This constraint captures problem agnostic constraints that define limits for voltage magnitudes (where variable bounds cannot be used). Notable examples include IVRUPowerModel and ACRUPowerModel.

source
PowerModelsDistribution.constraint_mc_voltage_magnitude_boundsMethod
constraint_mc_voltage_magnitude_bounds(pm::FBSUBFPowerModel, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})

Upper voltage magnitude limits are linearized using outer approximation. Lower voltage magnitude limits are linearized around initial operating point.

\[\begin{align} &\text{Initial operating point: } ⇒ v_{r}^0 + j ⋅ v_{i}^0~\text{where}~{(v_m^0)}^2 = {(v_{r}^0)}^2 + {(v_{i}^0)}^2\\ &\text{Lower limits: } 2 ⋅ v_{r} ⋅ v_{r}^0 + 2 ⋅ v_{i} ⋅ v_{i}^0 - {(v_{m}^0)}^2 ≥ v_{min}^2,\\ &\text{Upper limits: } -v_{max} ≤ v_{r} ≤ v_{max},\\ & -v_{max} ≤ v_{i} ≤ v_{max},\\ &-\sqrt{2} ⋅ v_{max} ≤ v_{r} + v_{i} ≤ \sqrt{2} ⋅ v_{max},\\ & -\sqrt{2} ⋅ v_{max} ≤ v_{r} - v_{i} ≤ \sqrt{2} ⋅ v_{max}. -\end{align}\]

source
PowerModelsDistribution.constraint_mc_voltage_pairwiseMethod
function constraint_mc_voltage_pairwise(
 	pm::RectangularVoltageExplicitNeutralModels,
 	nw::Int,
 	i::Int,
@@ -854,19 +854,19 @@
 	vm_pair_lb::Vector,
 	vm_pair_ub::Vector;
 	report::Bool=true
-)

Imposes pairwise voltage magnitude bounds, i.e. magnitude bounds on the voltage between to terminals, for models with explicit neutrals

source
PowerModelsDistribution.constraint_mc_voltage_pairwiseMethod
function constraint_mc_voltage_pairwise(
     pm::RectangularVoltageExplicitNeutralModels,
     id::Int;
     nw::Int=nw_id_default,
     bounded::Bool=true,
     report::Bool=true,
-)

Imposes pairwise voltage magnitude bounds, i.e. magnitude bounds on the voltage between to terminals, for models with explicit neutrals

source
PowerModelsDistribution.constraint_pqwMethod

Creates the constraints modelling the (relaxed) voltage-dependency of the power consumed in each phase, s=p+jq. This is completely symmetrical for p and q, with appropriate substitutions of the variables and parameters: p->q, a->b, alpha->beta, pmin->qmin, pmax->qmax

source
PowerModelsDistribution.constraint_switch_thermal_limitMethod
constraint_switch_thermal_limit(pm::AbstractUnbalancedPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, rating::Vector{<:Real})::Nothing

Generic thermal limit constraint for switches (from-side)

mathp_{fr}^2 + q_{fr}^2 \leq S_{max}^2

source

Relaxation Helpers

PowerModelsDistribution.cut_complex_product_and_angle_differenceMethod
cut_complex_product_and_angle_difference(m, wf, wt, wr, wi, angmin, angmax)

A valid inequality for the product of two complex variables with magnitude and angle difference bounds. In the literature this constraints are called the Lifted Nonlinear Cuts (LNCs). @misc{1512.04644, Author = {Carleton Coffrin and Hassan Hijazi and Pascal Van Hentenryck}, Title = {Strengthening the SDP Relaxation of AC Power Flows with Convex Envelopes, Bound Tightening, and Lifted Nonlinear Cuts}, Year = {2015}, Eprint = {arXiv:1512.04644}, }

source
PowerModelsDistribution.relaxation_psd_to_socMethod
relaxation_psd_to_soc(m::JuMP.Model, mxreal, mximag; complex::Bool=true)

See section 4.3 for complex to real PSD constraint transformation: @article{Fazel2001, author = {Fazel, M. and Hindi, H. and Boyd, S.P.}, title = {{A rank minimization heuristic with application to minimum order system approximation}}, doi = {10.1109/ACC.2001.945730}, journal = {Proc. American Control Conf.}, number = {2}, pages = {4734–4739}, url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=945730}, volume = {6}, year = {2001} }

source
PowerModelsDistribution.constraint_pqwMethod

Creates the constraints modelling the (relaxed) voltage-dependency of the power consumed in each phase, s=p+jq. This is completely symmetrical for p and q, with appropriate substitutions of the variables and parameters: p->q, a->b, alpha->beta, pmin->qmin, pmax->qmax

source
PowerModelsDistribution.constraint_switch_thermal_limitMethod
constraint_switch_thermal_limit(pm::AbstractUnbalancedPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, rating::Vector{<:Real})::Nothing

Generic thermal limit constraint for switches (from-side)

mathp_{fr}^2 + q_{fr}^2 \leq S_{max}^2

source

Relaxation Helpers

PowerModelsDistribution.cut_complex_product_and_angle_differenceMethod
cut_complex_product_and_angle_difference(m, wf, wt, wr, wi, angmin, angmax)

A valid inequality for the product of two complex variables with magnitude and angle difference bounds. In the literature this constraints are called the Lifted Nonlinear Cuts (LNCs). @misc{1512.04644, Author = {Carleton Coffrin and Hassan Hijazi and Pascal Van Hentenryck}, Title = {Strengthening the SDP Relaxation of AC Power Flows with Convex Envelopes, Bound Tightening, and Lifted Nonlinear Cuts}, Year = {2015}, Eprint = {arXiv:1512.04644}, }

source
PowerModelsDistribution.relaxation_psd_to_socMethod
relaxation_psd_to_soc(m::JuMP.Model, mxreal, mximag; complex::Bool=true)

See section 4.3 for complex to real PSD constraint transformation: @article{Fazel2001, author = {Fazel, M. and Hindi, H. and Boyd, S.P.}, title = {{A rank minimization heuristic with application to minimum order system approximation}}, doi = {10.1109/ACC.2001.945730}, journal = {Proc. American Control Conf.}, number = {2}, pages = {4734–4739}, url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=945730}, volume = {6}, year = {2001} }

source
PowerModelsDistribution.relaxation_psd_to_soc_complexMethod
relaxation_psd_to_soc_complex(m, mxreal, mximag)

SDP to SOC relaxation of type 2, applied to complex-value matrix, as described in:

@article{Kim2003,
 author = {Kim, S and Kojima, M and Yamashita, M},
 title = {{Second order cone programming relaxation of a positive semidefinite constraint}},
 doi = {10.1080/1055678031000148696},
@@ -875,7 +875,7 @@
 pages = {535--541},
 volume = {18},
 year = {2003}
-}
source
PowerModelsDistribution.relaxation_psd_to_soc_complex_conicMethod
relaxation_psd_to_soc_complex_conic(m, mxreal, mximag)

SDP to SOC relaxation of type 2, applied to complex-value matrix, as described in:

@article{Kim2003,
 author = {Kim, S and Kojima, M and Yamashita, M},
 title = {{Second order cone programming relaxation of a positive semidefinite constraint}},
 doi = {10.1080/1055678031000148696},
@@ -884,7 +884,7 @@
 pages = {535--541},
 volume = {18},
 year = {2003}
-}
source
PowerModelsDistribution.relaxation_psd_to_soc_conicMethod
relaxation_psd_to_soc_conic(m, mxreal, mximag; complex=true)

See section 4.3 for complex to real PSD constraint transformation: @article{Fazel2001, author = {Fazel, M. and Hindi, H. and Boyd, S.P.}, title = {{A rank minimization heuristic with application to minimum order system approximation}}, doi = {10.1109/ACC.2001.945730}, journal = {Proc. American Control Conf.}, number = {2}, pages = {4734–4739}, url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=945730}, volume = {6}, year = {2001} }

source
PowerModelsDistribution.relaxation_psd_to_soc_conicMethod
relaxation_psd_to_soc_conic(m, mxreal, mximag; complex=true)

See section 4.3 for complex to real PSD constraint transformation: @article{Fazel2001, author = {Fazel, M. and Hindi, H. and Boyd, S.P.}, title = {{A rank minimization heuristic with application to minimum order system approximation}}, doi = {10.1109/ACC.2001.945730}, journal = {Proc. American Control Conf.}, number = {2}, pages = {4734–4739}, url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=945730}, volume = {6}, year = {2001} }

source
PowerModelsDistribution.relaxation_psd_to_soc_realMethod
relaxation_psd_to_soc_real(m, mx)

SDP to SOC relaxation of type 2, applied to real-value matrix, as described in:

@article{Kim2003,
 author = {Kim, S and Kojima, M and Yamashita, M},
 title = {{Second order cone programming relaxation of a positive semidefinite constraint}},
 doi = {10.1080/1055678031000148696},
@@ -893,7 +893,7 @@
 pages = {535--541},
 volume = {18},
 year = {2003}
-}
source
PowerModelsDistribution.relaxation_psd_to_soc_real_conicMethod
relaxation_psd_to_soc_real_conic(m, mx)

SDP to SOC relaxation of type 2, applied to real-value matrix, as described in:

@article{Kim2003,
 author = {Kim, S and Kojima, M and Yamashita, M},
 title = {{Second order cone programming relaxation of a positive semidefinite constraint}},
 doi = {10.1080/1055678031000148696},
@@ -902,4 +902,4 @@
 pages = {535--541},
 volume = {18},
 year = {2003}
-}
source

Miscellaneous Helpers

+}
source

Miscellaneous Helpers

diff --git a/dev/reference/data_models.html b/dev/reference/data_models.html index f20f406dc..45fcf9bad 100644 --- a/dev/reference/data_models.html +++ b/dev/reference/data_models.html @@ -16,19 +16,19 @@ kron_reduce::Bool=true, phase_project::Bool=false, time_series::String="daily" -)::Dict{String,Any}

Parses the IOStream of a file into a PowerModelsDistribution data structure

If filetype is missing, parse_file will attempt to detect the filetype, but this may fail, and it is advised to pass the filetype if it is known.

If data_model is MATHEMATICAL, the data model type will be automatically transformed via transform_data_model.

For explanation of import_all, bank_transformers, and time_series, see parse_opendss

For explanation of dss2eng_extensions, see parse_opendss

For explanation of kron_reduce, see apply_kron_reduction!

For explanation of phase_project, see apply_phase_projection!

For explanation of multinetwork and global_keys, see make_multinetwork and transform_data_model

For explanation of eng2math_extensions and eng2math_passthrough, see transform_data_model

For explanation of make_pu and make_pu_extensions, see make_per_unit!.

source
parse_file(file::String; kwargs...)::Dict{String,Any}

Loads file into IOStream and passes it onto parse_file

source
PowerModelsDistribution.parse_dssFunction
source
PowerModelsDistribution.parse_opendssFunction
parse_opendss(
+)::Dict{String,Any}

Parses the IOStream of a file into a PowerModelsDistribution data structure

If filetype is missing, parse_file will attempt to detect the filetype, but this may fail, and it is advised to pass the filetype if it is known.

If data_model is MATHEMATICAL, the data model type will be automatically transformed via transform_data_model.

For explanation of import_all, bank_transformers, and time_series, see parse_opendss

For explanation of dss2eng_extensions, see parse_opendss

For explanation of kron_reduce, see apply_kron_reduction!

For explanation of phase_project, see apply_phase_projection!

For explanation of multinetwork and global_keys, see make_multinetwork and transform_data_model

For explanation of eng2math_extensions and eng2math_passthrough, see transform_data_model

For explanation of make_pu and make_pu_extensions, see make_per_unit!.

source
parse_file(file::String; kwargs...)::Dict{String,Any}

Loads file into IOStream and passes it onto parse_file

source
PowerModelsDistribution.parse_dssFunction
source
PowerModelsDistribution.parse_opendssFunction
parse_opendss(
     io::IO;
     import_all::Bool=false,
     bank_transformers::Bool=true,
     time_series::String="daily",
     dss2eng_extensions::Vector{<:Function}=Function[],
-)::Dict{String,Any}

Parses an IO, into raw dss dictionary via parse_dss, into the ENGINEERING DataModel

See parse_opendss

source
parse_opendss(
+)::Dict{String,Any}

Parses an IO, into raw dss dictionary via parse_dss, into the ENGINEERING DataModel

See parse_opendss

source
parse_opendss(
     data_dss::OpenDssDataModel;
     import_all::Bool=false,
     bank_transformers::Bool=true,
     time_series::String="daily",
     dss2eng_extensions::Vector{<:Function}=Function[]
-)::Dict{String,Any}

Parses a raw dss data structure (dictionary), resulting from the parsing of a DSS file, into the ENGINEERING DataModel

If import_all is true, all raw dss properties will be included in the final dictionary under "dss".

If bank_transformers is true (default), transformers that are indicated to be part of a bank in dss will be combined into a single multiphase transformer.

time_series defines which property the time series will be taken from, "daily" or "yearly". More complex parsing of time series data should be performed with dss2eng_extensions.

dss2eng_extensions

If a user wishes to parse additional components that are not yet natively supported by PowerModelsDistribution, dss2eng_extensions can be utilized. Custom user functions provided under dss2eng_extensions will be excuted after all built-in dss2eng transformations have been performed and transformers have been banked together (if bank_transformers==true). dss2eng_extension functions should have the following function signature:

dss2eng_func!(data_eng, data_dss)

where data_eng is a non-multinetwork ENGINEERING data model (i.e., time series data has not yet been expanded into a multinetwork structure), and data_dss is the raw dss data parsed by parse_dss.

source
PowerModelsDistribution.parse_jsonFunction
parse_json(file::String)

parses json files that were dumped via JSON.print (or PMD.print_file)

source
parse_json(io::IO)

parses json files that were dumped via JSON.print (or PMD.print_file)

source
PowerModelsDistribution.print_fileFunction
print_file(path::String, data::Dict{String,<:Any}; indent::Int=2)

prints a PowerModelsDistribution data structure into a JSON file

source
print_file(io::IO, data::Dict{String,<:Any}; indent::Int=2)

prints a PowerModelsDistribution data structure into a JSON file

source

print_file variant for InfrastructureModel that converts to Dict first

source

Constructors

PowerModelsDistribution.ModelFunction
Model(model_type::DataModel)

Instantiates a PowerModelsDistribution data model

source
PowerModelsDistribution.add_bus!Function

adds a bus to provided ENGINEERING model, see create_bus

source
PowerModelsDistribution.add_generator!Function

adds a generator to provided ENGINEERING model, see create_generator

source
PowerModelsDistribution.add_line!Function

adds a line to provided ENGINEERING model, see create_line

source
PowerModelsDistribution.add_linecode!Function

adds a linecode to provided ENGINEERING model, see create_linecode

source
PowerModelsDistribution.add_load!Function

adds a load to provided ENGINEERING model, see create_load

source
PowerModelsDistribution.add_object!Method
add_object!(data_eng::Dict{String,<:Any}, obj_type::String, obj_id::String, object::Dict{String,<:Any})

Generic add function to add components to an engineering data model

source
PowerModelsDistribution.add_shunt!Function

adds a shunt to provided ENGINEERING model, see create_shunt

source
PowerModelsDistribution.add_solar!Function

adds a PV to provided ENGINEERING model, see create_solar

source
PowerModelsDistribution.add_storage!Function

adds a storage to provided ENGINEERING model, see create_storage

source
PowerModelsDistribution.add_switch!Function

adds a switch to provided ENGINEERING model, see create_switch

source
PowerModelsDistribution.add_transformer!Function

adds a transformer to provided ENGINEERING model, see create_transformer and create_al2w_transformer

source
PowerModelsDistribution.add_vbase_default!Method
add_vbase_default!(data_eng::Dict{String,<:Any}, bus::String, vbase::Real)

Function to add default vbase for a bus

source
PowerModelsDistribution.add_voltage_source!Function

adds a voltage source to provided ENGINEERING model, see create_voltage_source

source
PowerModelsDistribution.add_xfmrcode!Function

adds a transformer code (xmfrcode) to provided ENGINEERING model, see create_xfmrcode

source
PowerModelsDistribution.create_al2w_transformerMethod
create_al2w_transformer(
+)::Dict{String,Any}

Parses a raw dss data structure (dictionary), resulting from the parsing of a DSS file, into the ENGINEERING DataModel

If import_all is true, all raw dss properties will be included in the final dictionary under "dss".

If bank_transformers is true (default), transformers that are indicated to be part of a bank in dss will be combined into a single multiphase transformer.

time_series defines which property the time series will be taken from, "daily" or "yearly". More complex parsing of time series data should be performed with dss2eng_extensions.

dss2eng_extensions

If a user wishes to parse additional components that are not yet natively supported by PowerModelsDistribution, dss2eng_extensions can be utilized. Custom user functions provided under dss2eng_extensions will be excuted after all built-in dss2eng transformations have been performed and transformers have been banked together (if bank_transformers==true). dss2eng_extension functions should have the following function signature:

dss2eng_func!(data_eng, data_dss)

where data_eng is a non-multinetwork ENGINEERING data model (i.e., time series data has not yet been expanded into a multinetwork structure), and data_dss is the raw dss data parsed by parse_dss.

source
PowerModelsDistribution.parse_jsonFunction
parse_json(file::String)

parses json files that were dumped via JSON.print (or PMD.print_file)

source
parse_json(io::IO)

parses json files that were dumped via JSON.print (or PMD.print_file)

source
PowerModelsDistribution.print_fileFunction
print_file(path::String, data::Dict{String,<:Any}; indent::Int=2)

prints a PowerModelsDistribution data structure into a JSON file

source
print_file(io::IO, data::Dict{String,<:Any}; indent::Int=2)

prints a PowerModelsDistribution data structure into a JSON file

source

print_file variant for InfrastructureModel that converts to Dict first

source

Constructors

PowerModelsDistribution.ModelFunction
Model(model_type::DataModel)

Instantiates a PowerModelsDistribution data model

source
PowerModelsDistribution.add_bus!Function

adds a bus to provided ENGINEERING model, see create_bus

source
PowerModelsDistribution.add_generator!Function

adds a generator to provided ENGINEERING model, see create_generator

source
PowerModelsDistribution.add_line!Function

adds a line to provided ENGINEERING model, see create_line

source
PowerModelsDistribution.add_linecode!Function

adds a linecode to provided ENGINEERING model, see create_linecode

source
PowerModelsDistribution.add_load!Function

adds a load to provided ENGINEERING model, see create_load

source
PowerModelsDistribution.add_object!Method
add_object!(data_eng::Dict{String,<:Any}, obj_type::String, obj_id::String, object::Dict{String,<:Any})

Generic add function to add components to an engineering data model

source
PowerModelsDistribution.add_shunt!Function

adds a shunt to provided ENGINEERING model, see create_shunt

source
PowerModelsDistribution.add_solar!Function

adds a PV to provided ENGINEERING model, see create_solar

source
PowerModelsDistribution.add_storage!Function

adds a storage to provided ENGINEERING model, see create_storage

source
PowerModelsDistribution.add_switch!Function

adds a switch to provided ENGINEERING model, see create_switch

source
PowerModelsDistribution.add_transformer!Function

adds a transformer to provided ENGINEERING model, see create_transformer and create_al2w_transformer

source
PowerModelsDistribution.add_vbase_default!Method
add_vbase_default!(data_eng::Dict{String,<:Any}, bus::String, vbase::Real)

Function to add default vbase for a bus

source
PowerModelsDistribution.add_voltage_source!Function

adds a voltage source to provided ENGINEERING model, see create_voltage_source

source
PowerModelsDistribution.add_xfmrcode!Function

adds a transformer code (xmfrcode) to provided ENGINEERING model, see create_xfmrcode

source
PowerModelsDistribution.create_al2w_transformerMethod
create_al2w_transformer(
     f_bus::String,
     t_bus::String,
     f_connections::Vector{Int},
@@ -41,14 +41,14 @@
     tm_fix::Union{Vector{Bool},Missing}=missing,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

creates a aysmmetric lossless 2-winding transformer object with some defaults

source
PowerModelsDistribution.create_busMethod
create_bus(;
+)::Dict{String,Any}

creates a aysmmetric lossless 2-winding transformer object with some defaults

source
PowerModelsDistribution.create_busMethod
create_bus(;
     status::Status=ENABLED,
     terminals::Vector{Int}=Int[],
     grounded::Vector{Int}=Int[],
     rg::Vector{<:Real}=Float64[],
     xg::Vector{<:Real}=Float64[],
     kwargs...
-)::Dict{String,Any}

creates a bus object with some defaults

source
PowerModelsDistribution.create_generatorMethod
create_generator(
+)::Dict{String,Any}

creates a bus object with some defaults

source
PowerModelsDistribution.create_generatorMethod
create_generator(
     bus::String,
     connections::Vector{Int};
     configuration::ConnConfig=WYE,
@@ -62,7 +62,7 @@
     control_mode::ControlMode=FREQUENCYDROOP,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

creates a generator object with some defaults

source
PowerModelsDistribution.create_lineMethod
create_line(
+)::Dict{String,Any}

creates a generator object with some defaults

source
PowerModelsDistribution.create_lineMethod
create_line(
     f_bus::String,
     t_bus::String,
     f_connections::Vector{Int},
@@ -81,7 +81,7 @@
     vad_ub::Union{Vector{<:Real},Missing}=missing,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

Create a line with some default values

source
PowerModelsDistribution.create_linecodeMethod
create_linecode(
+)::Dict{String,Any}

Create a line with some default values

source
PowerModelsDistribution.create_linecodeMethod
create_linecode(
     rs::Matrix{<:Real},
     xs::Matrix{<:Real};
     g_fr::Union{Matrix{<:Real},Missing}=missing,
@@ -90,7 +90,7 @@
     b_to::Union{Matrix{<:Real},Missing}=missing,
     cm_ub::Union{Vector{<:Real},Missing}=missing,
     kwargs...
-)::Dict{String,Any}

creates a linecode with some defaults

source
PowerModelsDistribution.create_loadMethod
create_load(
+)::Dict{String,Any}

creates a linecode with some defaults

source
PowerModelsDistribution.create_loadMethod
create_load(
     bus::String,
     connections::Vector{Int};
     configuration::ConnConfig=WYE,
@@ -101,7 +101,7 @@
     dispatchable::Dispatchable=NO,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

creates a load object with some defaults

source
PowerModelsDistribution.create_shuntMethod
create_shunt(
+)::Dict{String,Any}

creates a load object with some defaults

source
PowerModelsDistribution.create_shuntMethod
create_shunt(
     bus::String,
     connections::Vector{Int};
     gs::Union{Matrix{<:Real},Missing}=missing,
@@ -110,7 +110,7 @@
     dispatchable::Dispatchable=NO,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

creates a generic shunt with some defaults

source
PowerModelsDistribution.create_solarMethod
create_solar(
+)::Dict{String,Any}

creates a generic shunt with some defaults

source
PowerModelsDistribution.create_solarMethod
create_solar(
     bus::String,
     connections::Vector{Int};
     configuration::ConnConfig=WYE,
@@ -122,7 +122,7 @@
     qg::Union{Vector{<:Real},Missing}=missing,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

creates a solar generator with some defaults

source
PowerModelsDistribution.create_storageMethod
create_storage(
+)::Dict{String,Any}

creates a solar generator with some defaults

source
PowerModelsDistribution.create_storageMethod
create_storage(
     configuration::ConnConfig=WYE,
     energy::Real=0.0,
     energy_ub::Real=0.0,
@@ -142,7 +142,7 @@
     qs::Union{Real,Vector{<:Real},Missing}=missing,
     status::Status=ENABLED,
     kwargs...
-    )::Dict{String,Any}

creates energy storage object with some defaults

source
PowerModelsDistribution.create_switchMethod
create_switch(
+    )::Dict{String,Any}

creates energy storage object with some defaults

source
PowerModelsDistribution.create_switchMethod
create_switch(
     f_bus::String,
     t_bus::String,
     f_connections::Vector{Int},
@@ -156,7 +156,7 @@
     state::SwitchState=CLOSED,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

creates a switch object with some defaults

source
PowerModelsDistribution.create_transformerMethod
create_transformer(
+)::Dict{String,Any}

creates a switch object with some defaults

source
PowerModelsDistribution.create_transformerMethod
create_transformer(
     buses::Vector{String},
     connections::Vector{Vector{Int}};
     configurations::Union{Vector{ConnConfig},Missing}=missing,
@@ -175,7 +175,7 @@
     sm_nom::Union{Vector{<:Real},Missing}=missing,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

creates a n-winding transformer object with some defaults

source
PowerModelsDistribution.create_voltage_sourceMethod
create_voltage_source(
+)::Dict{String,Any}

creates a n-winding transformer object with some defaults

source
PowerModelsDistribution.create_voltage_sourceMethod
create_voltage_source(
     bus::String,
     connections::Vector{Int};
     configuration::ConnConfig=WYE,
@@ -187,7 +187,7 @@
     xs::Union{Vector{<:Real},Missing}=missing,
     status::Status=ENABLED,
     kwargs...
-)::Dict{String,Any}

creates a voltage source with some defaults

source
PowerModelsDistribution.create_xfmrcodeMethod
create_xfmrcode(;
+)::Dict{String,Any}

creates a voltage source with some defaults

source
PowerModelsDistribution.create_xfmrcodeMethod
create_xfmrcode(;
     configurations::Union{Vector{ConnConfig},Missing}=missing,
     xsc::Union{Vector{<:Real},Missing}=missing,
     rw::Union{Vector{<:Real},Missing}=missing,
@@ -197,7 +197,7 @@
     tm_set::Union{Vector{Vector{<:Real}},Missing}=missing,
     tm_fix::Union{Vector{Vector{<:Real}},Missing}=missing,
     kwargs...
-)::Dict{String,Any}

creates transformer code with some defaults

source
PowerModelsDistribution.delete_component!Method
delete_component!(data_eng::Dict{String,<:Any}, component_type::String, component_id::String)

deletes a component from the engineering data model

source

Model Transformations

PowerModelsDistribution.transform_data_modelFunction

default transform_data_model ErrorException for unsupported combinations

source
source
transform_data_model(
+)::Dict{String,Any}

creates transformer code with some defaults

source
PowerModelsDistribution.delete_component!Method
delete_component!(data_eng::Dict{String,<:Any}, component_type::String, component_id::String)

deletes a component from the engineering data model

source

Model Transformations

PowerModelsDistribution.transform_data_modelFunction

default transform_data_model ErrorException for unsupported combinations

source
source
transform_data_model(
     data::Dict{String,<:Any};
     kron_reduce::Bool=true,
     multinetwork::Bool=false,
@@ -209,7 +209,7 @@
 )::Dict{String,Any}

Transforms a data model model between ENGINEERING (high-level) and MATHEMATICAL (low-level) DataModel.

Notes

Kron reduction

If kron_reduce==true, apply_kron_reduction! and apply_phase_projection_delta! will be applied to the network data.

Phase projection

If phase_project==true, apply_phase_projection! will be applied to the network data.

Multinetwork transformations

If multinetwork==true, the data model will be transformed into a multinetwork (e.g., time series) data structure using make_multinetwork before being transformed into a MATHEMATICAL DataModel.

global_keys::Set{String} can be used to add custom top-level items to the multinetwork data structure, and will only be used in the context where multinetwork==true, and ignored otherwise.

Custom eng2math transformations

To add custom transformations between ENGINEERING and MATHEMATICAL data models, eng2math_extensions::Vector{<:Function} can be utilized to pass user-created functions, which are expected to have the signature

eng2math_func!(data_math::Dict{String,Any}, data_eng::Dict{String,Any})

where datamath and dataeng equivalent to single subnetworks in a multinetwork data structure, or a non-multinetwork data structure.

These functions are run after all built-in eng2math transformations have been performed.

Mapping back to ENGINEERING

See transform_solution

Passthrough properties

To more simply pass through some properties in the built-in eng2math transformations, eng2math_passthrough::Dict{String,Vector{String}} can be used. For example, if in the ENGINEERING model, a property called z was added to switch objects, and a property at the root level of the dictionary was added called max_switch_actions, the user could pass the following dictionary to eng2math_passthrough:

Dict{String,Vector{String}}(
     "switch" => String["z"],
     "root" => String["max_switch_actions"],
-)

This will result in z showing up on the switch object in the MATHEMATICAL model. Passthrough properties will always land on the primary conversion object in the MATHEMATICAL model if that object gets converted to multiple object types, e.g., voltage_source with internal impedance will result in gen, bus, and branch objects in the MATHEMATICAL model, but passthrough properties will only land on gen.

Custom per-unit transformations

To add additional per-unit transformations, a user can supply custom functions to make_pu_extensions::Vector{<:Function}, which will only be used if make_pu==true.

See make_per_unit! for further explanation.

source
PowerModelsDistribution.transform_solutionFunction
transform_solution(
+)

This will result in z showing up on the switch object in the MATHEMATICAL model. Passthrough properties will always land on the primary conversion object in the MATHEMATICAL model if that object gets converted to multiple object types, e.g., voltage_source with internal impedance will result in gen, bus, and branch objects in the MATHEMATICAL model, but passthrough properties will only land on gen.

Custom per-unit transformations

To add additional per-unit transformations, a user can supply custom functions to make_pu_extensions::Vector{<:Function}, which will only be used if make_pu==true.

See make_per_unit! for further explanation.

source
PowerModelsDistribution.transform_solutionFunction
transform_solution(
     solution_math::Dict{String,<:Any},
     data_math::Dict{String,<:Any};
     map::Union{Vector{<:Dict{String,<:Any}},Missing}=missing,
@@ -223,29 +223,29 @@
     "to" => Union{String,Vector{String}},
     "unmap_function" => PowerModelsDistribution.function!,
     "apply_to_subnetworks" => Bool
-)

Important things to note are that

  1. The function must be included in map_math2eng_extensions, which has the form:

    julia Dict{String,Function}( "_map_math2eng_func!" => _map_math2eng_func!, )

  2. "apply_to_subnetworks" is optional, and is true by default.

  3. "from" needs to be a single object

  4. "to" can be multiple objects or a single object

source

Data Transformations

PowerModelsDistribution.reduce_line_series!Method
reduce_line_series!(eng::Dict{String,<:Any}; remove_original_lines::Bool=false)::Dict{String,<:Any}

This is a function to merge series of lines which only connect to buses with no other connections (i.e., string of buses with no loads, generators, transformers, etc.). This function will preserve the total length of the merged lines.

If remove_original_lines, the original lines and eliminated buses will be deleted from the data structure, otherwise the lines and buses will be DISABLED.

source
PowerModelsDistribution.apply_kron_reduction!Method
apply_kron_reduction!(data::Dict{String,<:Any}; kr_phases::Union{Vector{Int},Vector{String}}=[1,2,3], kr_neutral::Union{Int,String}=4)

Applies a Kron Reduction to the network, reducing out the kr_neutral, leaving only the kr_phases

source
PowerModelsDistribution.kron_reduce_implicit_neutrals!Method
kron_reduce_implicit_neutrals!(data::Dict{String,Any})::Dict{String,Any}

Kron-reduce all (implied) neutral conductors of lines, switches and shunts, and remove any terminals which become unconnected. A line or switch conductor is considered as a neutral conductor if it is connected between two neutral terminals. A terminal is a neutral terminals if it is galvanically connected (i.e. through a line or switch) to a grounded terminal, or the neutral conductor of a wye-connected component.

source
PowerModelsDistribution.add_bus_absolute_vbounds!Method
add_bus_absolute_vbounds!(
+)

Important things to note are that

  1. The function must be included in map_math2eng_extensions, which has the form:

    julia Dict{String,Function}( "_map_math2eng_func!" => _map_math2eng_func!, )

  2. "apply_to_subnetworks" is optional, and is true by default.

  3. "from" needs to be a single object

  4. "to" can be multiple objects or a single object

source

Data Transformations

PowerModelsDistribution.reduce_line_series!Method
reduce_line_series!(eng::Dict{String,<:Any}; remove_original_lines::Bool=false)::Dict{String,<:Any}

This is a function to merge series of lines which only connect to buses with no other connections (i.e., string of buses with no loads, generators, transformers, etc.). This function will preserve the total length of the merged lines.

If remove_original_lines, the original lines and eliminated buses will be deleted from the data structure, otherwise the lines and buses will be DISABLED.

source
PowerModelsDistribution.apply_kron_reduction!Method
apply_kron_reduction!(data::Dict{String,<:Any}; kr_phases::Union{Vector{Int},Vector{String}}=[1,2,3], kr_neutral::Union{Int,String}=4)

Applies a Kron Reduction to the network, reducing out the kr_neutral, leaving only the kr_phases

source
PowerModelsDistribution.kron_reduce_implicit_neutrals!Method
kron_reduce_implicit_neutrals!(data::Dict{String,Any})::Dict{String,Any}

Kron-reduce all (implied) neutral conductors of lines, switches and shunts, and remove any terminals which become unconnected. A line or switch conductor is considered as a neutral conductor if it is connected between two neutral terminals. A terminal is a neutral terminals if it is galvanically connected (i.e. through a line or switch) to a grounded terminal, or the neutral conductor of a wye-connected component.

source
PowerModelsDistribution.add_bus_absolute_vbounds!Method
add_bus_absolute_vbounds!(
     data_eng::Dict{String,Any};
     phase_lb_pu::Real=0.9,
     phase_ub_pu::Real=1.1,
     neutral_ub_pu::Real=0.3
-)::Dict{String,Any}

Adds absolute (i.e. indivdially, not between a pair of terminals) voltage bounds through the 'vmlb' and 'vmub' property. Bounds are specified in per unit, and automatically converted to SI units by calculating the voltage base. If you change dataeng["settings"]["vbasesdefault"], the data model transformation will however produce inconsistent bounds in per unit. Neutral terminals are automatically detected, and set to [0,phaseubpu*vbase].

source
PowerModelsDistribution.add_bus_pn_pp_ng_vbounds!Method
add_bus_pn_pp_ng_vbounds!(data_eng::Dict{String,Any}, phase_terminals::Vector, neutral_terminal;
+)::Dict{String,Any}

Adds absolute (i.e. indivdially, not between a pair of terminals) voltage bounds through the 'vmlb' and 'vmub' property. Bounds are specified in per unit, and automatically converted to SI units by calculating the voltage base. If you change dataeng["settings"]["vbasesdefault"], the data model transformation will however produce inconsistent bounds in per unit. Neutral terminals are automatically detected, and set to [0,phaseubpu*vbase].

source
PowerModelsDistribution.add_bus_pn_pp_ng_vbounds!Method
add_bus_pn_pp_ng_vbounds!(data_eng::Dict{String,Any}, phase_terminals::Vector, neutral_terminal;
     pn_lb_pu::Union{Real,Missing}=missing,
     pn_ub_pu::Union{Real,Missing}=missing,
     pp_lb_pu::Union{Real,Missing}=missing,
     pp_ub_pu::Union{Real,Missing}=missing,
     ng_ub_pu::Union{Real,Missing}=missing,
-)::Dict{String,Any}

Adds symmetric phase-to-neutral and phase-to-phase voltage bounds when possible for each bus through the three-phase bus syntax.

source
PowerModelsDistribution.add_unit_vbounds!Method
add_unit_vbounds!(
+)::Dict{String,Any}

Adds symmetric phase-to-neutral and phase-to-phase voltage bounds when possible for each bus through the three-phase bus syntax.

source
PowerModelsDistribution.add_unit_vbounds!Method
add_unit_vbounds!(
     data_eng::Dict{String,Any};
     lb_pu::Real=0.9,
     ub_pu::Real=1.1,
     delta_multiplier::Real=sqrt(3),
     unit_comp_types::Vector{<:AbstractString}=["load", "generator", "storage", "pv"],
-)::Dict{String,Any}

Adds voltage bounds to the bus terminals to which units are connected. 'Units' in this context are all oneport component types specified by the argument 'unitcomptypes'. Bounds are specified in per unit, and automatically converted to SI units by calculating the voltage base. If you change dataeng["settings"]["vbasesdefault"], the data model transformation will however produce inconsistent bounds in per unit. The delta multiplier controls the scaling of bounds of delta-connected units.

source
PowerModelsDistribution.adjust_line_limits!Method
adjust_line_limits!(data::Dict{String,<:Any}, mult::Real)

Multiplies limits (sm_ub and/or cm_ub) on line objects (line, linecode, switch) by a multiplier mult

source
PowerModelsDistribution.adjust_small_line_admittances!Method
adjust_small_line_admittances!(data::Dict{String,<:Any}; min_admittance_val::Real=1e-2, replace_admittance_val::Real=0.0)

Replaces admittances (gfr, gto, bfr, bto) on lines, linecodes, and switches lower than min_admittance_val with replace_admittance_val.

source
PowerModelsDistribution.adjust_small_line_impedances!Method
adjust_small_line_impedances!(data::Dict{String,<:Any}; min_impedance_val::Real=1e-2, replace_impedance_val::Real=0.0)

Replaces impedances (rs, xs) on lines, linecodes, and switches lower than min_impedance_val with replace_impedance_val.

source
PowerModelsDistribution.adjust_small_line_lengths!Method
adjust_small_line_lengths!(data::Dict{String,<:Any}; min_length_val::Real=25.0, replace_length_val::Real=0.0)

Replaces length on lines, switches lower than min_length_val with replace_length_val.

source
PowerModelsDistribution.adjust_transformer_limits!Method
adjust_transformer_limits!(data::Dict{String,<:Any}, mult::Real)

Multiplies limits (sm_ub and/or cm_ub) on transformer objects by a multiplier mult

source
PowerModelsDistribution.apply_voltage_angle_difference_bounds!Function
apply_voltage_angle_difference_bounds!(data::Dict{String,<:Any}, vad::Real=5.0)

Applies voltage angle difference bound given by vad::Real in degrees (i.e., the allowed drift of angle from one end of a line to another) to all lines. By default, vad=5.0.

source
PowerModelsDistribution.apply_voltage_bounds!Method
apply_voltage_bounds!(data::Dict{String,<:Any}; vm_lb::Union{Real,Missing}=0.9, vm_ub::Union{Real,Missing}=1.1)

add voltage bounds to all buses based on per-unit upper (vm_ub) and lower (vm_lb), scaled by the bus's voltage based

source
PowerModelsDistribution.remove_all_bounds!Method
remove_all_bounds!(data; exclude::Vector{<:String}=String["energy_ub"], exclude_asset_type::Vector{String}=String[])

Removes all fields ending in 'ub' or 'lb' that aren't required by the math model. Properties can be excluded from this removal with exclude::Vector{String}

Whole asset types (e.g., "line") can be excluded using the keyword argument exclude_asset_type::Vector{String}

By default, "energy_ub" is excluded from this removal, since it is a required properly on storage.

source
PowerModelsDistribution.remove_line_limits!Method
remove_line_limits!(data::Dict{String,<:Any})

Removes fields cm_ub and sm_ub from lines, switches, and linecodes

source
PowerModelsDistribution.remove_transformer_limits!Method
remove_transformer_limits!(data_eng::Dict{String,<:Any})

Removes field sm_ub from transformers, xfmrcodes

source

Multinetworks

InfrastructureModels.ismultinetworkMethod
ismultinetwork(pm::AbstractUnbalancedPowerModel)

Checks if power model struct is multinetwork

source
PowerModelsDistribution.make_multinetworkMethod
make_multinetwork(
+)::Dict{String,Any}

Adds voltage bounds to the bus terminals to which units are connected. 'Units' in this context are all oneport component types specified by the argument 'unitcomptypes'. Bounds are specified in per unit, and automatically converted to SI units by calculating the voltage base. If you change dataeng["settings"]["vbasesdefault"], the data model transformation will however produce inconsistent bounds in per unit. The delta multiplier controls the scaling of bounds of delta-connected units.

source
PowerModelsDistribution.adjust_line_limits!Method
adjust_line_limits!(data::Dict{String,<:Any}, mult::Real)

Multiplies limits (sm_ub and/or cm_ub) on line objects (line, linecode, switch) by a multiplier mult

source
PowerModelsDistribution.adjust_small_line_admittances!Method
adjust_small_line_admittances!(data::Dict{String,<:Any}; min_admittance_val::Real=1e-2, replace_admittance_val::Real=0.0)

Replaces admittances (gfr, gto, bfr, bto) on lines, linecodes, and switches lower than min_admittance_val with replace_admittance_val.

source
PowerModelsDistribution.adjust_small_line_impedances!Method
adjust_small_line_impedances!(data::Dict{String,<:Any}; min_impedance_val::Real=1e-2, replace_impedance_val::Real=0.0)

Replaces impedances (rs, xs) on lines, linecodes, and switches lower than min_impedance_val with replace_impedance_val.

source
PowerModelsDistribution.adjust_small_line_lengths!Method
adjust_small_line_lengths!(data::Dict{String,<:Any}; min_length_val::Real=25.0, replace_length_val::Real=0.0)

Replaces length on lines, switches lower than min_length_val with replace_length_val.

source
PowerModelsDistribution.adjust_transformer_limits!Method
adjust_transformer_limits!(data::Dict{String,<:Any}, mult::Real)

Multiplies limits (sm_ub and/or cm_ub) on transformer objects by a multiplier mult

source
PowerModelsDistribution.apply_voltage_angle_difference_bounds!Function
apply_voltage_angle_difference_bounds!(data::Dict{String,<:Any}, vad::Real=5.0)

Applies voltage angle difference bound given by vad::Real in degrees (i.e., the allowed drift of angle from one end of a line to another) to all lines. By default, vad=5.0.

source
PowerModelsDistribution.apply_voltage_bounds!Method
apply_voltage_bounds!(data::Dict{String,<:Any}; vm_lb::Union{Real,Missing}=0.9, vm_ub::Union{Real,Missing}=1.1)

add voltage bounds to all buses based on per-unit upper (vm_ub) and lower (vm_lb), scaled by the bus's voltage based

source
PowerModelsDistribution.remove_all_bounds!Method
remove_all_bounds!(data; exclude::Vector{<:String}=String["energy_ub"], exclude_asset_type::Vector{String}=String[])

Removes all fields ending in 'ub' or 'lb' that aren't required by the math model. Properties can be excluded from this removal with exclude::Vector{String}

Whole asset types (e.g., "line") can be excluded using the keyword argument exclude_asset_type::Vector{String}

By default, "energy_ub" is excluded from this removal, since it is a required properly on storage.

source
PowerModelsDistribution.remove_line_limits!Method
remove_line_limits!(data::Dict{String,<:Any})

Removes fields cm_ub and sm_ub from lines, switches, and linecodes

source
PowerModelsDistribution.remove_transformer_limits!Method
remove_transformer_limits!(data_eng::Dict{String,<:Any})

Removes field sm_ub from transformers, xfmrcodes

source

Multinetworks

InfrastructureModels.ismultinetworkMethod
ismultinetwork(pm::AbstractUnbalancedPowerModel)

Checks if power model struct is multinetwork

source
PowerModelsDistribution.make_multinetworkMethod
make_multinetwork(
     data::Dict{String,<:Any};
     sparse::Bool=false,
     time_elapsed::Union{Missing,Real,Vector{<:Real}}=missing,
     global_keys::Set{String}=Set{String}(),
-)::Dict{String,Any}

Expands a data structure into a multinetwork assuming there are time_series objects defined and assigned to some components.

If global_keys::Set{String} is defined, the global keys that will appear at the top-level of the data structure will include both the default global keys for that data model type, and additionally the keys defined in global_keys.

time_elapsed defines the time elapsed between subnetworkin hours, and can either be a single Real value, and thus a constant time between each time step, or a Vector with the same length as the number of time steps, or can be left missing, in which case time elapsed will attempt to be discovered, with a fallback on 1 hour default. Time elapsed can be adjusted later using set_time_elapsed!

make_multinetwork assumes all "time" values in "timeseries" objects to be in the same units, and will attempt to automatically sort multinetworks in the correct order. [`sortmultinetwork!`](@ref sort_multinetwork!) can be used after the fact to re-sort the subnetworks.

sparse is currently unsupported, and is only included for future compatibility

source
PowerModelsDistribution.set_time_elapsed!Method
set_time_elapsed!(data::Dict{String,<:Any}, time_elapsed::Union{Real,Vector{<:Real}})

Helper function to set time_elapsed in multinetwork data, given either some constant value of time elapsed or a Vector of time elapsed values of the same length as the number of subnetworks.

source
PowerModelsDistribution.sort_multinetwork!Method
sort_multinetwork!(mn_data::Dict{String,<:Any}, times::Vector{<:Any})

Helper function to manually sort your multinetwork frames, given some pre-sorted vector of time values times

source

Unit conversions

PowerModelsDistribution.calc_eng_voltage_basesMethod
calc_eng_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches for a ENGINEERING data_model

source
PowerModelsDistribution.calc_math_voltage_basesMethod
calc_math_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches for a MATHEMATICAL data_model

source
PowerModelsDistribution.calc_voltage_basesMethod
calc_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches, attempting to automatically decern the data_model type

source
PowerModelsDistribution.discover_eng_voltage_zonesMethod
discover_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{Any}}

finds voltage zones by walking through the network and analyzing the transformers for a ENGINEERING data_model

source
PowerModelsDistribution.discover_math_voltage_zonesMethod
discover_math_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{Any}}

finds voltage zones by walking through the network and analyzing the transformers for a MATHEMATICAL data_model

source
PowerModelsDistribution.discover_voltage_zonesMethod
discover_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{Any}}

finds voltage zones by walking through the network and analyzing the transformers, attempting to decern the type of data_model

source
PowerModelsDistribution.make_per_unit!Method
make_per_unit!(
+)::Dict{String,Any}

Expands a data structure into a multinetwork assuming there are time_series objects defined and assigned to some components.

If global_keys::Set{String} is defined, the global keys that will appear at the top-level of the data structure will include both the default global keys for that data model type, and additionally the keys defined in global_keys.

time_elapsed defines the time elapsed between subnetworkin hours, and can either be a single Real value, and thus a constant time between each time step, or a Vector with the same length as the number of time steps, or can be left missing, in which case time elapsed will attempt to be discovered, with a fallback on 1 hour default. Time elapsed can be adjusted later using set_time_elapsed!

make_multinetwork assumes all "time" values in "timeseries" objects to be in the same units, and will attempt to automatically sort multinetworks in the correct order. [`sortmultinetwork!`](@ref sort_multinetwork!) can be used after the fact to re-sort the subnetworks.

sparse is currently unsupported, and is only included for future compatibility

source
PowerModelsDistribution.set_time_elapsed!Method
set_time_elapsed!(data::Dict{String,<:Any}, time_elapsed::Union{Real,Vector{<:Real}})

Helper function to set time_elapsed in multinetwork data, given either some constant value of time elapsed or a Vector of time elapsed values of the same length as the number of subnetworks.

source
PowerModelsDistribution.sort_multinetwork!Method
sort_multinetwork!(mn_data::Dict{String,<:Any}, times::Vector{<:Any})

Helper function to manually sort your multinetwork frames, given some pre-sorted vector of time values times

source

Unit conversions

PowerModelsDistribution.calc_eng_voltage_basesMethod
calc_eng_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches for a ENGINEERING data_model

source
PowerModelsDistribution.calc_math_voltage_basesMethod
calc_math_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches for a MATHEMATICAL data_model

source
PowerModelsDistribution.calc_voltage_basesMethod
calc_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches, attempting to automatically decern the data_model type

source
PowerModelsDistribution.discover_eng_voltage_zonesMethod
discover_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{Any}}

finds voltage zones by walking through the network and analyzing the transformers for a ENGINEERING data_model

source
PowerModelsDistribution.discover_math_voltage_zonesMethod
discover_math_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{Any}}

finds voltage zones by walking through the network and analyzing the transformers for a MATHEMATICAL data_model

source
PowerModelsDistribution.discover_voltage_zonesMethod
discover_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{Any}}

finds voltage zones by walking through the network and analyzing the transformers, attempting to decern the type of data_model

source
PowerModelsDistribution.make_per_unit!Method
make_per_unit!(
     data::Dict{String,Any};
     vbases::Union{Missing,Dict{String,Real}}=missing,
     sbase::Union{Missing,Real}=missing,
@@ -258,7 +258,7 @@
     sbase::Real,
     sbase_old::Real,
     voltage_scale_factor::Real
-)

where,

  • nw is equivalent to the a single subnetwork in a multinetwork data structure (which may be the same as data_math, in the case of a single network),
  • data_math is the complete data structure with the global keys,
  • bus_vbase is a dictionary of the voltage bases of each bus indexed by their MATHEMATICAL model indices,
  • line_vbase is a dictionary of the voltage bases of each branch indexed by their MATHEMATICAL model indices,
  • sbase is the new power base,
  • sbase_old is the power base the data structure started with, and
  • voltage_scale_factor is the scaling factor for voltage.
source
PowerModelsDistribution.solution_make_siMethod
solution_make_si(
+)

where,

  • nw is equivalent to the a single subnetwork in a multinetwork data structure (which may be the same as data_math, in the case of a single network),
  • data_math is the complete data structure with the global keys,
  • bus_vbase is a dictionary of the voltage bases of each bus indexed by their MATHEMATICAL model indices,
  • line_vbase is a dictionary of the voltage bases of each branch indexed by their MATHEMATICAL model indices,
  • sbase is the new power base,
  • sbase_old is the power base the data structure started with, and
  • voltage_scale_factor is the scaling factor for voltage.
source
PowerModelsDistribution.solution_make_siMethod
solution_make_si(
     solution::Dict{String,<:Any},
     math_model::Dict{String,<:Any};
     mult_sbase::Bool=true,
@@ -271,4 +271,4 @@
     "branch" => Dict{String,Vector{String}}(
         "ibase" => String["cfr"]
     )
-)

which would ensure that this variable gets converted back to SI units upon transformation.

source

Data Checking and Correction

PowerModelsDistribution.check_branch_loopsMethod
check_branch_loops(data::Dict{String,<:Any})

checks that all branches connect two distinct buses

source
PowerModelsDistribution.check_connectivityMethod
check_connectivity(data::Dict{String,<:Any})

checks that all buses are unique and other components link to valid buses

source
PowerModelsDistribution.check_cost_modelsMethod
check_cost_models(pm::AbstractUnbalancedPowerModel)

Checks that all cost models are of the same type

source
PowerModelsDistribution.check_eng_data_modelMethod
check_eng_data_model(data_eng::Dict{String,<:Any})

checks the engineering data model for correct data types, required fields and applies default checks

source
PowerModelsDistribution.check_gen_cost_modelsMethod
check_gen_cost_models(pm::AbstractUnbalancedPowerModel)

Checks that all generator cost models are of the same type

source
PowerModelsDistribution.correct_branch_directions!Method
correct_branch_directions!(data::Dict{String,<:Any})

checks that all parallel branches have the same orientation

source
PowerModelsDistribution.correct_bus_types!Method

checks bus types are suitable for a power flow study, if not, fixes them. the primary checks are that all type 2 buses (i.e., PV) have a connected and active generator and there is a single type 3 bus (i.e., slack bus) with an active connected generator. assumes that the network is a single connected component

source
PowerModelsDistribution.correct_cost_functions!Method
correct_cost_functions!(data::Dict{String,<:Any})

throws warnings if cost functions are malformed

source
PowerModelsDistribution.correct_json_import!Method
correct_json_import!(data::Dict{String,<:Any})

helper function to correct data imported from json

source
PowerModelsDistribution.correct_mc_thermal_limits!Method
correct_mc_thermal_limits!(data::Dict{String,<:Any})

checks that each branch has non-negative thermal ratings and removes zero thermal ratings

source
PowerModelsDistribution.correct_mc_voltage_angle_differences!Function
correct_mc_voltage_angle_differences!(data::Dict{String,<:Any}, default_pad::Real=deg2rad(10.0))

checks that voltage angle differences are within 90 deg., if not tightens to a default of 10deg (adjustable)

source
PowerModelsDistribution.correct_network_data!Method
correct_network_data!(data::Dict{String,Any}; make_pu::Bool=true, make_pu_extensions::Vector{<:Function}=Function[])

Makes corrections and performs checks on network data structure in either ENGINEERING or MATHEMATICAL formats, and converts to per-unit if data a is MATHEMATICAL data model.

If make_pu is false, converting to per-unit will be skipped.

Custom per-unit transformations

See make_per_unit!

source

Statistics and Analysis

PowerModelsDistribution.count_nodesFunction
count_nodes(data::Dict{String,<:Any})::Int

Counts number of nodes in network

source
count_nodes(data::Dict{String,<:Any})::Int

Counts number of nodes in network

source
PowerModelsDistribution.count_active_connectionsFunction
count_active_connections(data::Dict{String,<:Any})

Counts active ungrounded connections on edge components

source
PowerModelsDistribution.count_active_terminalsFunction
count_active_terminals(data::Dict{String,<:Any}; count_grounded::Bool=false)

Counts active ungrounded terminals on buses

source
PowerModelsDistribution.identify_load_blocksFunction
identify_load_blocks(data::Dict{String,<:Any})

computes load blocks based on switch locations

source
PowerModelsDistribution.identify_blocksFunction
identify_blocks(data::Dict{String,<:Any})

computes connected blocks currently in the model based on switch states

source
PowerModelsDistribution.identify_islandsFunction
identify_islands(data::Dict{String,<:Any})

computes component islands base only on edge and bus status

source
PowerModelsDistribution.calc_connected_componentsFunction
calc_connected_components(data::Dict{String,<:Any}; edges::Union{Missing, Vector{<:String}}=missing, type::Union{Missing,String}=missing, check_enabled::Bool=true)::Set

computes the connected components of the network graph returns a set of sets of bus ids, each set is a connected component

source

Helper Functions

PowerModelsDistribution.isengFunction
iseng(data::Dict{String,Any})

Helper function to check is data is ENGINEERING model

source
PowerModelsDistribution.ismathFunction
ismath(data::Dict{String,Any})

Helper function to check if data is MATHEMATICAL model

source
PowerModelsDistribution.find_conductor_ids!Function
find_conductor_ids!(data::Dict{String,Any})

Finds all conductor ids and puts a list of them under "conductor_ids" at the root level

source
PowerModelsDistribution.make_multiconductor!Function
make_multiconductor!(data::Dict{String,<:Any}, conductors::Int)

This function is not meant to be an officially supported method for creating reasonable multiconductor data sets.

Hacky helper function to transform single-conductor network data, from, e.g., matpower/psse, into multi-conductor data.

source
PowerModelsDistribution.discover_voltage_zonesFunction
discover_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{Any}}

finds voltage zones by walking through the network and analyzing the transformers, attempting to decern the type of data_model

source
PowerModelsDistribution.calc_voltage_basesFunction
calc_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches, attempting to automatically decern the data_model type

source
PowerModelsDistribution.apply_pmd!Function
apply_pmd!(func!::Function, data::Dict{String,<:Any}; apply_to_subnetworks::Bool=true, kwargs...)

Version of apply_pmd! that supports kwargs

source
apply_pmd!(func!::Function, data::Dict{String,<:Any}; apply_to_subnetworks::Bool=true, kwargs...)

Version of apply_pmd! that supports kwargs

source
apply_pmd!(func!::Function, data::Dict{String,<:Any}, args...; apply_to_subnetworks::Bool=true, kwargs...)

Version of apply_pmd! that supports args and kwargs

source
apply_pmd!(func!::Function, ref::Dict{Symbol,<:Any}, data::Dict{String,<:Any}; apply_to_subnetworks::Bool=true)

PowerModelsDistribution wrapper for the InfrastructureModels apply! function

source
PowerModelsDistribution.get_pmd_dataFunction
get_pmd_data(data::Dict{String, <:Any})

Convenience function for retrieving the power-distribution-only portion of network data

source
+)

which would ensure that this variable gets converted back to SI units upon transformation.

source

Data Checking and Correction

PowerModelsDistribution.check_branch_loopsMethod
check_branch_loops(data::Dict{String,<:Any})

checks that all branches connect two distinct buses

source
PowerModelsDistribution.check_connectivityMethod
check_connectivity(data::Dict{String,<:Any})

checks that all buses are unique and other components link to valid buses

source
PowerModelsDistribution.check_cost_modelsMethod
check_cost_models(pm::AbstractUnbalancedPowerModel)

Checks that all cost models are of the same type

source
PowerModelsDistribution.check_eng_data_modelMethod
check_eng_data_model(data_eng::Dict{String,<:Any})

checks the engineering data model for correct data types, required fields and applies default checks

source
PowerModelsDistribution.check_gen_cost_modelsMethod
check_gen_cost_models(pm::AbstractUnbalancedPowerModel)

Checks that all generator cost models are of the same type

source
PowerModelsDistribution.correct_branch_directions!Method
correct_branch_directions!(data::Dict{String,<:Any})

checks that all parallel branches have the same orientation

source
PowerModelsDistribution.correct_bus_types!Method

checks bus types are suitable for a power flow study, if not, fixes them. the primary checks are that all type 2 buses (i.e., PV) have a connected and active generator and there is a single type 3 bus (i.e., slack bus) with an active connected generator. assumes that the network is a single connected component

source
PowerModelsDistribution.correct_cost_functions!Method
correct_cost_functions!(data::Dict{String,<:Any})

throws warnings if cost functions are malformed

source
PowerModelsDistribution.correct_json_import!Method
correct_json_import!(data::Dict{String,<:Any})

helper function to correct data imported from json

source
PowerModelsDistribution.correct_mc_thermal_limits!Method
correct_mc_thermal_limits!(data::Dict{String,<:Any})

checks that each branch has non-negative thermal ratings and removes zero thermal ratings

source
PowerModelsDistribution.correct_mc_voltage_angle_differences!Function
correct_mc_voltage_angle_differences!(data::Dict{String,<:Any}, default_pad::Real=deg2rad(10.0))

checks that voltage angle differences are within 90 deg., if not tightens to a default of 10deg (adjustable)

source
PowerModelsDistribution.correct_network_data!Method
correct_network_data!(data::Dict{String,Any}; make_pu::Bool=true, make_pu_extensions::Vector{<:Function}=Function[])

Makes corrections and performs checks on network data structure in either ENGINEERING or MATHEMATICAL formats, and converts to per-unit if data a is MATHEMATICAL data model.

If make_pu is false, converting to per-unit will be skipped.

Custom per-unit transformations

See make_per_unit!

source

Statistics and Analysis

PowerModelsDistribution.count_nodesFunction
count_nodes(data::Dict{String,<:Any})::Int

Counts number of nodes in network

source
count_nodes(data::Dict{String,<:Any})::Int

Counts number of nodes in network

source
PowerModelsDistribution.count_active_connectionsFunction
count_active_connections(data::Dict{String,<:Any})

Counts active ungrounded connections on edge components

source
PowerModelsDistribution.count_active_terminalsFunction
count_active_terminals(data::Dict{String,<:Any}; count_grounded::Bool=false)

Counts active ungrounded terminals on buses

source
PowerModelsDistribution.identify_load_blocksFunction
identify_load_blocks(data::Dict{String,<:Any})

computes load blocks based on switch locations

source
PowerModelsDistribution.identify_blocksFunction
identify_blocks(data::Dict{String,<:Any})

computes connected blocks currently in the model based on switch states

source
PowerModelsDistribution.identify_islandsFunction
identify_islands(data::Dict{String,<:Any})

computes component islands base only on edge and bus status

source
PowerModelsDistribution.calc_connected_componentsFunction
calc_connected_components(data::Dict{String,<:Any}; edges::Union{Missing, Vector{<:String}}=missing, type::Union{Missing,String}=missing, check_enabled::Bool=true)::Set

computes the connected components of the network graph returns a set of sets of bus ids, each set is a connected component

source

Helper Functions

PowerModelsDistribution.isengFunction
iseng(data::Dict{String,Any})

Helper function to check is data is ENGINEERING model

source
PowerModelsDistribution.ismathFunction
ismath(data::Dict{String,Any})

Helper function to check if data is MATHEMATICAL model

source
PowerModelsDistribution.find_conductor_ids!Function
find_conductor_ids!(data::Dict{String,Any})

Finds all conductor ids and puts a list of them under "conductor_ids" at the root level

source
PowerModelsDistribution.make_multiconductor!Function
make_multiconductor!(data::Dict{String,<:Any}, conductors::Int)

This function is not meant to be an officially supported method for creating reasonable multiconductor data sets.

Hacky helper function to transform single-conductor network data, from, e.g., matpower/psse, into multi-conductor data.

source
PowerModelsDistribution.discover_voltage_zonesFunction
discover_voltage_zones(data_model::Dict{String,<:Any})::Dict{Int,Set{Any}}

finds voltage zones by walking through the network and analyzing the transformers, attempting to decern the type of data_model

source
PowerModelsDistribution.calc_voltage_basesFunction
calc_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches, attempting to automatically decern the data_model type

source
PowerModelsDistribution.apply_pmd!Function
apply_pmd!(func!::Function, data::Dict{String,<:Any}; apply_to_subnetworks::Bool=true, kwargs...)

Version of apply_pmd! that supports kwargs

source
apply_pmd!(func!::Function, data::Dict{String,<:Any}; apply_to_subnetworks::Bool=true, kwargs...)

Version of apply_pmd! that supports kwargs

source
apply_pmd!(func!::Function, data::Dict{String,<:Any}, args...; apply_to_subnetworks::Bool=true, kwargs...)

Version of apply_pmd! that supports args and kwargs

source
apply_pmd!(func!::Function, ref::Dict{Symbol,<:Any}, data::Dict{String,<:Any}; apply_to_subnetworks::Bool=true)

PowerModelsDistribution wrapper for the InfrastructureModels apply! function

source
PowerModelsDistribution.get_pmd_dataFunction
get_pmd_data(data::Dict{String, <:Any})

Convenience function for retrieving the power-distribution-only portion of network data

source
diff --git a/dev/reference/enums.html b/dev/reference/enums.html index cdb591e78..ccc8ac5ee 100644 --- a/dev/reference/enums.html +++ b/dev/reference/enums.html @@ -1,2 +1,2 @@ -Enums · PowerModelsDistribution

Enums

+Enums · PowerModelsDistribution

Enums

diff --git a/dev/reference/formulations.html b/dev/reference/formulations.html index 8588f2f5f..70df6f98b 100644 --- a/dev/reference/formulations.html +++ b/dev/reference/formulations.html @@ -1,5 +1,5 @@ -Formulations · PowerModelsDistribution

Formulations

Abstract Models

PowerModelsDistribution.LPUBFDiagModelType

LinDist3Flow per Arnold et al. (2016), using vector variables for power, voltage and current

D. B. Arnold, M. Sankur, R. Dobbe, K. Brady, D. S. Callaway and A. Von Meier, "Optimal dispatch of reactive power for voltage regulation and balancing in unbalanced distribution systems," 2016 IEEE Power and Energy Society General Meeting (PESGM), Boston, MA, 2016, pp. 1-5, doi: 10.1109/PESGM.2016.7741261.

source

Abstract Union Models

Power Models

PowerModelsDistribution.ACPUPowerModelType

AC power flow Model with polar bus voltage variables. The seminal reference of AC OPF:

@article{carpentier1962contribution,
+Formulations · PowerModelsDistribution

Formulations

Abstract Models

PowerModelsDistribution.LPUBFDiagModelType

LinDist3Flow per Arnold et al. (2016), using vector variables for power, voltage and current

D. B. Arnold, M. Sankur, R. Dobbe, K. Brady, D. S. Callaway and A. Von Meier, "Optimal dispatch of reactive power for voltage regulation and balancing in unbalanced distribution systems," 2016 IEEE Power and Energy Society General Meeting (PESGM), Boston, MA, 2016, pp. 1-5, doi: 10.1109/PESGM.2016.7741261.

source

Abstract Union Models

Power Models

PowerModelsDistribution.ACPUPowerModelType

AC power flow Model with polar bus voltage variables. The seminal reference of AC OPF:

@article{carpentier1962contribution,
   title={Contribution to the economic dispatch problem},
   author={Carpentier, J},
   journal={Bulletin de la Societe Francoise des Electriciens},
@@ -13,18 +13,18 @@
   year = {2012}
   pages = {1--36},
   url = {https://www.ferc.gov/industries/electric/indus-act/market-planning/opf-papers/acopf-1-history-Model-testing.pdf}
-}
source
PowerModelsDistribution.ACRUPowerModelType

AC power flow Model with rectangular bus voltage variables.

@techreport{Cain2012,
   author = {Cain, Mary B and {O' Neill}, Richard P and Castillo, Anya},
   pages = {1--36},
   title = {{History of optimal power flow and Models}},
   url = {https://www.ferc.gov/industries/electric/indus-act/market-planning/opf-papers/acopf-1-history-Model-testing.pdf}
   year = {2012}
-}
source
PowerModelsDistribution.IVRUPowerModelType

Current voltage formulation of AC OPF. The formulation uses rectangular coordinates for both current and voltage. Note that, even though Kirchhoff's circuit laws are linear in current and voltage, this formulation is nonconvex due to constants power loads/generators and apparent power limits.

@techreport{ONeill2012,
+}
source
PowerModelsDistribution.IVRUPowerModelType

Current voltage formulation of AC OPF. The formulation uses rectangular coordinates for both current and voltage. Note that, even though Kirchhoff's circuit laws are linear in current and voltage, this formulation is nonconvex due to constants power loads/generators and apparent power limits.

@techreport{ONeill2012,
     author = {{O' Neill}, Richard P and Castillo, Anya and Cain, Mary B},
     pages = {1--18},
     title = {{The IV formulation and linear approximations of the ac optimal power flow problem}},
     year = {2012}
-}

Applicable to problem formulations with _iv in the name.

source
PowerModelsDistribution.DCPUPowerModelType

Linearized 'DC' power flow Model with polar voltage variables. This model is a basic linear active-power-only approximation, which uses branch susceptance values br_b = -br_x / (br_x^2 + br_x^2) for determining the network phase angles. Furthermore, transformer parameters such as tap ratios and phase shifts are not considered as part of this model. It is important to note that it is also common for active-power-only approximations to use 1/br_x for determining the network phase angles, instead of the br_b value that is used here. Small discrepancies in solutions should be expected when comparing active-power-only approximations across multiple tools.

@ARTICLE{4956966,
+}

Applicable to problem formulations with _iv in the name.

source
PowerModelsDistribution.DCPUPowerModelType

Linearized 'DC' power flow Model with polar voltage variables. This model is a basic linear active-power-only approximation, which uses branch susceptance values br_b = -br_x / (br_x^2 + br_x^2) for determining the network phase angles. Furthermore, transformer parameters such as tap ratios and phase shifts are not considered as part of this model. It is important to note that it is also common for active-power-only approximations to use 1/br_x for determining the network phase angles, instead of the br_b value that is used here. Small discrepancies in solutions should be expected when comparing active-power-only approximations across multiple tools.

@ARTICLE{4956966,
   author={B. Stott and J. Jardim and O. Alsac},
   journal={IEEE Transactions on Power Systems},
   title={DC Power Flow Revisited},
@@ -35,4 +35,4 @@
   pages={1290-1300},
   doi={10.1109/TPWRS.2009.2021235},
   ISSN={0885-8950}
-}
source

Mutable Stuct creator

+}
source

Mutable Stuct creator

diff --git a/dev/reference/internal.html b/dev/reference/internal.html index a952fc2fe..087f81c0a 100644 --- a/dev/reference/internal.html +++ b/dev/reference/internal.html @@ -1,70 +1,70 @@ -Internal Functions · PowerModelsDistribution

Internal Functions

Base.delete!Method

Base.delete! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.delete!Method

Base.delete! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.eltypeMethod

Base.eltype for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.getMethod

Base.get for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.getindexMethod

Base.getindex for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.getpropertyMethod

Base.getproperty for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.haskeyMethod

Base.haskey for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.isemptyMethod

Base.isempty for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.iterateMethod

Base.iterate for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.keysMethod

Base.keys for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.keytypeMethod

Base.keytype for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.lengthMethod

Base.length for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.merge!Method

Base.merge! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.parseMethod

Parses dss capacitor control type into CapControlType enum

source
Base.setindex!Method

Base.setindex! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.setproperty!Method

Base.setproperty! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.showMethod

Base.show variant for InfrastructureModel,InfrastructureObject to make them Dict-like

source
Base.showMethod

Base.show variant for InfrastructureModel,InfrastructureObject to make them Dict-like

source
Base.summaryMethod

Base.summary for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.valtypeMethod

Base.valtype for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
PowerModelsDistribution._adjust_small_line_admittances!Method
_adjust_small_line_admittances!(data_eng::Dict{String,<:Any}; min_admittance_val::Real=1e-2, replace_admittance_val::Real=0.0)

Replaces admittances (gfr, gto, bfr, bto) on lines, linecodes, and switches lower than min_admittance_val with replace_admittance_val.

source
PowerModelsDistribution._adjust_small_line_impedances!Method
_adjust_small_line_impedances!(data_eng::Dict{String,<:Any}; min_impedance_val::Real=1e-2, replace_impedance_val::Real=0.0)

Replaces impedances (rs, xs) on lines, linecodes, and switches lower than min_impedance_val with replace_impedance_val.

source
PowerModelsDistribution._apply_kron_reduction!Method
_apply_kron_reduction!(data_eng::Dict{String,<:Any}; kr_phases::Union{Vector{Int},Vector{String}}=[1,2,3], kr_neutral::Union{Int,String}=4)

Applies a Kron Reduction to the network, reducing out the kr_neutral, leaving only the kr_phases

source
PowerModelsDistribution._apply_voltage_bounds!Method
_apply_voltage_bounds!(data_eng::Dict{String,<:Any}; vm_lb::Union{Real,Missing}=0.9, vm_ub::Union{Real,Missing}=1.1)

add voltage bounds to all buses based on per-unit upper (vm_ub) and lower (vm_lb), scaled by the bus's voltage based

source
PowerModelsDistribution._bts_to_start_voltageMethod
_bts_to_start_voltage(
+Internal Functions · PowerModelsDistribution

Internal Functions

Base.delete!Method

Base.delete! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.delete!Method

Base.delete! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.eltypeMethod

Base.eltype for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.getMethod

Base.get for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.getindexMethod

Base.getindex for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.getpropertyMethod

Base.getproperty for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.haskeyMethod

Base.haskey for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.isemptyMethod

Base.isempty for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.iterateMethod

Base.iterate for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.keysMethod

Base.keys for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.keytypeMethod

Base.keytype for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.lengthMethod

Base.length for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.merge!Method

Base.merge! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.parseMethod

Parses dss capacitor control type into CapControlType enum

source
Base.setindex!Method

Base.setindex! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.setproperty!Method

Base.setproperty! for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.showMethod

Base.show variant for InfrastructureModel,InfrastructureObject to make them Dict-like

source
Base.showMethod

Base.show variant for InfrastructureModel,InfrastructureObject to make them Dict-like

source
Base.summaryMethod

Base.summary for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
Base.valtypeMethod

Base.valtype for InfrastructureModel,InfrastructureObject to give them Dict-like behavior

source
PowerModelsDistribution._adjust_small_line_admittances!Method
_adjust_small_line_admittances!(data_eng::Dict{String,<:Any}; min_admittance_val::Real=1e-2, replace_admittance_val::Real=0.0)

Replaces admittances (gfr, gto, bfr, bto) on lines, linecodes, and switches lower than min_admittance_val with replace_admittance_val.

source
PowerModelsDistribution._adjust_small_line_impedances!Method
_adjust_small_line_impedances!(data_eng::Dict{String,<:Any}; min_impedance_val::Real=1e-2, replace_impedance_val::Real=0.0)

Replaces impedances (rs, xs) on lines, linecodes, and switches lower than min_impedance_val with replace_impedance_val.

source
PowerModelsDistribution._apply_kron_reduction!Method
_apply_kron_reduction!(data_eng::Dict{String,<:Any}; kr_phases::Union{Vector{Int},Vector{String}}=[1,2,3], kr_neutral::Union{Int,String}=4)

Applies a Kron Reduction to the network, reducing out the kr_neutral, leaving only the kr_phases

source
PowerModelsDistribution._apply_voltage_bounds!Method
_apply_voltage_bounds!(data_eng::Dict{String,<:Any}; vm_lb::Union{Real,Missing}=0.9, vm_ub::Union{Real,Missing}=1.1)

add voltage bounds to all buses based on per-unit upper (vm_ub) and lower (vm_lb), scaled by the bus's voltage based

source
PowerModelsDistribution._calc_branch_current_maxMethod

Returns a total (shunt+series) current magnitude bound for the from and to side of a branch. The total power rating also implies a current bound through the lower bound on the voltage magnitude of the connected buses.

source
PowerModelsDistribution._calc_branch_power_maxMethod

Returns a total (shunt+series) power magnitude bound for the from and to side of a branch. The total current rating also implies a current bound through the upper bound on the voltage magnitude of the connected buses.

source
PowerModelsDistribution._calc_branch_power_max_frtoMethod

Returns a total (shunt+series) power magnitude bound for the from and to side of a branch. The total current rating also implies a current bound through the upper bound on the voltage magnitude of the connected buses.

source
PowerModelsDistribution._calc_bus_vm_ll_boundsMethod

Returns bounds in line-to-line bounds on the voltage magnitude. If these are not part of the problem specification, then a valid upper bound is implied by the line-to-neutral bounds, but a lower bound (greater than zero) is not. Therefore, a default lower bound is then used, specified by the keyword argument vdmin_eps. The returned bounds are for the pairs 1->2, 2->3, 3->1

source
PowerModelsDistribution._calc_load_vboundsMethod

Returns the voltage magnitude bounds for the individual load elements in a multiphase load. These are inferred from vmin/vmax for wye loads and from calcbusvmll_bounds for delta loads.

source
PowerModelsDistribution._calc_shuntMethod

Given a set of addmittances 'y' connected from the conductors 'fcnds' to the conductors 'tcnds', this method will return a list of conductors 'cnd' and a matrix 'Y', which will satisfy I[cnds] = Y*V[cnds].

source
PowerModelsDistribution._calc_voltage_basesMethod
_calc_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real}, edge_elements::Vector{String})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches given a list of edge_elements

source
PowerModelsDistribution._calc_branch_current_maxMethod

Returns a total (shunt+series) current magnitude bound for the from and to side of a branch. The total power rating also implies a current bound through the lower bound on the voltage magnitude of the connected buses.

source
PowerModelsDistribution._calc_branch_power_maxMethod

Returns a total (shunt+series) power magnitude bound for the from and to side of a branch. The total current rating also implies a current bound through the upper bound on the voltage magnitude of the connected buses.

source
PowerModelsDistribution._calc_branch_power_max_frtoMethod

Returns a total (shunt+series) power magnitude bound for the from and to side of a branch. The total current rating also implies a current bound through the upper bound on the voltage magnitude of the connected buses.

source
PowerModelsDistribution._calc_bus_vm_ll_boundsMethod

Returns bounds in line-to-line bounds on the voltage magnitude. If these are not part of the problem specification, then a valid upper bound is implied by the line-to-neutral bounds, but a lower bound (greater than zero) is not. Therefore, a default lower bound is then used, specified by the keyword argument vdmin_eps. The returned bounds are for the pairs 1->2, 2->3, 3->1

source
PowerModelsDistribution._calc_load_vboundsMethod

Returns the voltage magnitude bounds for the individual load elements in a multiphase load. These are inferred from vmin/vmax for wye loads and from calcbusvmll_bounds for delta loads.

source
PowerModelsDistribution._calc_shuntMethod

Given a set of addmittances 'y' connected from the conductors 'fcnds' to the conductors 'tcnds', this method will return a list of conductors 'cnd' and a matrix 'Y', which will satisfy I[cnds] = Y*V[cnds].

source
PowerModelsDistribution._calc_voltage_basesMethod
_calc_voltage_bases(data_model::Dict{String,<:Any}, vbase_sources::Dict{String,<:Real}, edge_elements::Vector{String})::Tuple{Dict,Dict}

Calculates voltage bases for each voltage zone for buses and branches given a list of edge_elements

source
PowerModelsDistribution._compute_UvMethod
_compute_Uv(
   pfd::PowerFlowData,
   max_iter::Int,
   stat_tol::Float,
   verbose::Bool
-)

Computes a nonlinear AC power flow in rectangular coordinates based on the admittance matrix of the network data using the fixed-point current injection method (See https://arxiv.org/abs/2305.04405). Returns a solution data structure in PowerModelsDistribution Dict format.

source
PowerModelsDistribution._compute_mc_pfMethod
_compute_mc_pf(
+)

Computes a nonlinear AC power flow in rectangular coordinates based on the admittance matrix of the network data using the fixed-point current injection method (See https://arxiv.org/abs/2305.04405). Returns a solution data structure in PowerModelsDistribution Dict format.

source
PowerModelsDistribution._compute_mc_pfMethod
_compute_mc_pf(
     data_math::Dict{String,<:Any};
     v_start::Union{Dict{<:Any,<:Any},Missing}=missing,
     explicit_neutral::Bool=false,
     max_iter::Int=100,
     stat_tol::Real=1E-8,
     verbose::Bool=false
-)::Dict{String,Any}

Computes native power flow and outputs the result dict (See https://arxiv.org/abs/2305.04405).

Abbreviations:

  • ntype: node type (variable, fixed, grounded, virtual)
  • bts: bus-terminals for the component
  • ns: nodes
  • vns: virtual nodes
  • nr_vns: number of virtual nodes
  • y_prim: primitive admittance matrix for the component
  • cnlfunc: nonlinear compensation current function handle for the component
  • ctotsfunc: total current function handle for the component
source
PowerModelsDistribution._correct_bus_types!Method

checks bus types are suitable for a power flow study, if not, fixes them. the primary checks are that all type 2 buses (i.e., PV) have a connected and active generator and there is a single type 3 bus (i.e., slack bus) with an active connected generator. Assumes that the network is a single connected component

source
PowerModelsDistribution._cpf_branch_interfaceMethod
_cpf_branch_interface(
+)::Dict{String,Any}

Computes native power flow and outputs the result dict (See https://arxiv.org/abs/2305.04405).

Abbreviations:

  • ntype: node type (variable, fixed, grounded, virtual)
  • bts: bus-terminals for the component
  • ns: nodes
  • vns: virtual nodes
  • nr_vns: number of virtual nodes
  • y_prim: primitive admittance matrix for the component
  • cnlfunc: nonlinear compensation current function handle for the component
  • ctotsfunc: total current function handle for the component
source
PowerModelsDistribution._correct_bus_types!Method

checks bus types are suitable for a power flow study, if not, fixes them. the primary checks are that all type 2 buses (i.e., PV) have a connected and active generator and there is a single type 3 bus (i.e., slack bus) with an active connected generator. Assumes that the network is a single connected component

source
PowerModelsDistribution._cpf_branch_interfaceMethod
_cpf_branch_interface(
   branch::Dict,
   v_start::Dict,
   explicit_neutral::Bool,
   line_vbase::Dict,
   sbase::Float
-)

Branch component interface outputs branch primitive Y matrix (See https://arxiv.org/abs/2305.04405 Section 4.1).

source
PowerModelsDistribution._cpf_generator_interfaceMethod
_cpf_generator_interface(
   gen::Dict,
   v_start::Dict,
   explicit_neutral::Bool,
   line_vbase::Dict,
   sbase::Float
-)

Generator component interface outputs generator primitive Y matrix (See https://arxiv.org/abs/2305.04405 Section 4.4 and 4.5).

source
PowerModelsDistribution._cpf_load_interfaceMethod
_cpf_load_interface(
   load::Dict,
   v_start::Dict,
   explicit_neutral::Bool,
   line_vbase::Dict,
   sbase::Float
-)

Load component interface outputs load primitive Y matrix (See https://arxiv.org/abs/2305.04405 Sections 4.4 and 4.5).

source
PowerModelsDistribution._cpf_shunt_interfaceMethod
_cpf_shunt_interface(
   shunt::Dict,
   v_start::Dict,
   explicit_neutral::Bool,
   line_vbase::Dict,
   sbase::Float
-)

Shunt component interface outputs shunt primitive Y matrix (See https://arxiv.org/abs/2305.04405 Section 4.2).

source
PowerModelsDistribution._cpf_storage_interfaceMethod
_cpf_storage_interface(
   storage::Dict,
   v_start::Dict,
   explicit_neutral::Bool,
   line_vbase::Dict,
   sbase::Float
-)

Storage component interface outputs storage primitive Y matrix (See https://arxiv.org/abs/2305.04405 Section 4.4 and 4.5).

source
PowerModelsDistribution._cpf_switch_interfaceMethod
_cpf_switch_interface(
   switch::Dict,
   v_start::Dict,
   explicit_neutral::Bool,
   line_vbase::Dict,
   sbase::Float
-)

Branch component interface outputs branch primitive Y matrix (See https://arxiv.org/abs/2305.04405 Section 4.2).

source
PowerModelsDistribution._cpf_transformer_interfaceMethod
_cpf_transformer_interface(
   tr::Dict,
   v_start::Dict,
   explicit_neutral::Bool,
   line_vbase::Dict,
   sbase::Float
-)

Transformer component interface outputs transformer primitive Y matrix (See https://arxiv.org/abs/2305.04405 Section 4.3).

source
PowerModelsDistribution._dss2eng_load!Function

Adds loads to data_eng from data_dss

Constant can still be scaled by other settings, fixed cannot Note that in the current feature set, fixed therefore equals constant

1: Constant P and Q, default 2: Constant Z 3: Constant P and quadratic Q 4: Exponential 5: Constant I 6: Constant P and fixed Q

7: Constant P and quadratic Q (i.e., fixed reactance)

8: ZIP

source
PowerModelsDistribution._equivalance_center_tap!Method
_equivalance_center_tap!(transformer::Dict{String,<:Any}, data_eng::Dict{String,<:Any})

Removes center tap transformers based on Eq. (1) from Kersting's paper 'Center-Tapped Transformers and 120/240-V Secondary Models' Z0 = 0.5r_t + j0.8x_t

source
PowerModelsDistribution._dss2eng_load!Function

Adds loads to data_eng from data_dss

Constant can still be scaled by other settings, fixed cannot Note that in the current feature set, fixed therefore equals constant

1: Constant P and Q, default 2: Constant Z 3: Constant P and quadratic Q 4: Exponential 5: Constant I 6: Constant P and fixed Q

7: Constant P and quadratic Q (i.e., fixed reactance)

8: ZIP

source
PowerModelsDistribution._equivalance_center_tap!Method
_equivalance_center_tap!(transformer::Dict{String,<:Any}, data_eng::Dict{String,<:Any})

Removes center tap transformers based on Eq. (1) from Kersting's paper 'Center-Tapped Transformers and 120/240-V Secondary Models' Z0 = 0.5r_t + j0.8x_t

source
PowerModelsDistribution._infer_neutral_terminalsMethod

Return a list of all implicit neutrals as a list of bus-terminal pairs. This is done by starting from a list of all terminals which are either a.connected to the neutral of wye-connected components; b. or are grounded. This initial list is then expanded to all terminals which are galvanically connected to terminals in the initial list.

source
PowerModelsDistribution._kronMethod
_kron(Z::Matrix{T}, Y::Matrix{T}, nconds::Int)::Tuple{Matrix{T}, Matrix{T}} where T <: Complex

Kron reduces impedance and shunt admittance matrices down to size (nconds, nconds)

source
PowerModelsDistribution._kron_reduce_implicit_neutrals!Method
_kron_reduce_implicit_neutrals!(data_eng::Dict{String,Any})::Dict{String,Any}

Kron-reduce all (implied) neutral conductors of lines, switches and shunts, and remove any terminals which become unconnected. A line or switch conductor is considered as a neutral conductor if it is connected between two neutral terminals. A terminal is a neutral terminals if it is galvanically connected (i.e. through a line or switch) to a grounded terminal, or the neutral conductor of a wye-connected component.

source
PowerModelsDistribution._load_expmodel_paramsMethod
_load_expmodel_params(load::Dict{String,<:Any}, bus::Dict{String,<:Any})

Returns the exponential load model parameters for a load. For an exponential load it simply returns certain data model properties, whilst for constantpower, constantcurrent and constant_impedance it returns the equivalent exponential model parameters.

source
PowerModelsDistribution._make_lossless!Method
_make_lossless!(data_eng::Dict{String,<:Any})

Remove parameters from objects with loss models to make them lossless. This includes linecodes, lines, switches, xfmrcodes, transformers, voltage sources, generators, solar, and storage, which all have (or will have in the future), loss model parameters that can be omitted.

source
PowerModelsDistribution._infer_neutral_terminalsMethod

Return a list of all implicit neutrals as a list of bus-terminal pairs. This is done by starting from a list of all terminals which are either a.connected to the neutral of wye-connected components; b. or are grounded. This initial list is then expanded to all terminals which are galvanically connected to terminals in the initial list.

source
PowerModelsDistribution._kronMethod
_kron(Z::Matrix{T}, Y::Matrix{T}, nconds::Int)::Tuple{Matrix{T}, Matrix{T}} where T <: Complex

Kron reduces impedance and shunt admittance matrices down to size (nconds, nconds)

source
PowerModelsDistribution._kron_reduce_implicit_neutrals!Method
_kron_reduce_implicit_neutrals!(data_eng::Dict{String,Any})::Dict{String,Any}

Kron-reduce all (implied) neutral conductors of lines, switches and shunts, and remove any terminals which become unconnected. A line or switch conductor is considered as a neutral conductor if it is connected between two neutral terminals. A terminal is a neutral terminals if it is galvanically connected (i.e. through a line or switch) to a grounded terminal, or the neutral conductor of a wye-connected component.

source
PowerModelsDistribution._load_expmodel_paramsMethod
_load_expmodel_params(load::Dict{String,<:Any}, bus::Dict{String,<:Any})

Returns the exponential load model parameters for a load. For an exponential load it simply returns certain data model properties, whilst for constantpower, constantcurrent and constant_impedance it returns the equivalent exponential model parameters.

source
PowerModelsDistribution._make_lossless!Method
_make_lossless!(data_eng::Dict{String,<:Any})

Remove parameters from objects with loss models to make them lossless. This includes linecodes, lines, switches, xfmrcodes, transformers, voltage sources, generators, solar, and storage, which all have (or will have in the future), loss model parameters that can be omitted.

source
PowerModelsDistribution._make_matrix_variable_elementMethod
_make_matrix_variable_element(
     model::JuMP.Model,
     indices::Array{T,1},
     n::Int,
@@ -72,7 +72,7 @@
     upper_bound::Union{Missing, Dict{T,<:Matrix{<:Real}}}=missing,
     lower_bound::Union{Missing, Dict{T,<:Matrix{<:Real}}}=missing,
     varname::String=""
-) where T

Sometimes we want to bound only a subset of the elements of a matrix variable. For example, an unbounded Hermitian variable usually still has a lower bound of zero on the real diagonal elements. When there is a mix of bounded and unbounded elements, the unboundedness is encoded as 'Inf' and '-Inf' in the bound parameters. This cannot be passed directlty to JuMP, because it would lead to an error in Mosek for example. Instead, this method checks whether all bounds for an element (n,m) are Inf, and if so, does not pass a bound to JuMP.

source
PowerModelsDistribution._remove_all_bounds!Method
_remove_all_bounds!(data_eng; exclude::Vector{<:String}=String["energy_ub"], exclude_asset_type::Vector{String}=String[])

Removes all fields ending in 'ub' or 'lb' that aren't required by the math model. Properties can be excluded from this removal with exclude::Vector{String}

Whole asset types (e.g., "line") can be excluded using the keyword argument exclude_asset_type::Vector{String}

By default, "energy_ub" is excluded from this removal, since it is a required properly on storage.

source
PowerModelsDistribution._sanatize_lineMethod
_sanatize_line(line::String)::String

Sanitizes lines by stripping them clean of extra space and the beginnging and end, making everything lowercase, changing ~ or m to more, and stripping comments

source
PowerModelsDistribution._sc2br_impedanceMethod

Converts a set of short-circuit tests to an equivalent reactance network. Reference: R. C. Dugan, “A perspective on transformer modeling for distribution system analysis,” in 2003 IEEE Power Engineering Society General Meeting (IEEE Cat. No.03CH37491), 2003, vol. 1, pp. 114-119 Vol. 1.

source
PowerModelsDistribution._sol_data_model_acr!Method
_sol_data_model_acr!(solution::Dict{String,<:Any})

solutionprocessor, see [`solvemcmodel`](@ref solvemc_model), to convert ACR variables back into polar representation (default data model voltage form)

source
PowerModelsDistribution._solve_mc_modelMethod
_solve_mc_model(
+) where T

Sometimes we want to bound only a subset of the elements of a matrix variable. For example, an unbounded Hermitian variable usually still has a lower bound of zero on the real diagonal elements. When there is a mix of bounded and unbounded elements, the unboundedness is encoded as 'Inf' and '-Inf' in the bound parameters. This cannot be passed directlty to JuMP, because it would lead to an error in Mosek for example. Instead, this method checks whether all bounds for an element (n,m) are Inf, and if so, does not pass a bound to JuMP.

source
PowerModelsDistribution._remove_all_bounds!Method
_remove_all_bounds!(data_eng; exclude::Vector{<:String}=String["energy_ub"], exclude_asset_type::Vector{String}=String[])

Removes all fields ending in 'ub' or 'lb' that aren't required by the math model. Properties can be excluded from this removal with exclude::Vector{String}

Whole asset types (e.g., "line") can be excluded using the keyword argument exclude_asset_type::Vector{String}

By default, "energy_ub" is excluded from this removal, since it is a required properly on storage.

source
PowerModelsDistribution._sanatize_lineMethod
_sanatize_line(line::String)::String

Sanitizes lines by stripping them clean of extra space and the beginnging and end, making everything lowercase, changing ~ or m to more, and stripping comments

source
PowerModelsDistribution._sc2br_impedanceMethod

Converts a set of short-circuit tests to an equivalent reactance network. Reference: R. C. Dugan, “A perspective on transformer modeling for distribution system analysis,” in 2003 IEEE Power Engineering Society General Meeting (IEEE Cat. No.03CH37491), 2003, vol. 1, pp. 114-119 Vol. 1.

source
PowerModelsDistribution._sol_data_model_acr!Method
_sol_data_model_acr!(solution::Dict{String,<:Any})

solutionprocessor, see [`solvemcmodel`](@ref solvemc_model), to convert ACR variables back into polar representation (default data model voltage form)

source
PowerModelsDistribution._transform_loops!Method
_transform_loops!(
     data_eng::Dict{String,Any};
     zero_series_impedance_threshold::Real=1E-8,
     shunt_id_prefix::AbstractString="line_loop"
-)::Dict{String,Any}

Transform line loops (connected to a single bus), which are not allowed in the mathematical model. Lossy line loops are converted to equivalent shunts, and lossless ones (i.e. short-circuits) are represented by merging the short-circuited terminals. The argument 'zeroseriesimpedance_threshold' controls the threshold below which the series impedance is considered to be a short-ciruit. This is useful because OpenDSS modelers have to insert tiny impedances to represent short-circuit reactors. The addmittance to ground should be zero to trigger the short-circuit handling.

source
+)::Dict{String,Any}

Transform line loops (connected to a single bus), which are not allowed in the mathematical model. Lossy line loops are converted to equivalent shunts, and lossless ones (i.e. short-circuits) are represented by merging the short-circuited terminals. The argument 'zeroseriesimpedance_threshold' controls the threshold below which the series impedance is considered to be a short-ciruit. This is useful because OpenDSS modelers have to insert tiny impedances to represent short-circuit reactors. The addmittance to ground should be zero to trigger the short-circuit handling.

source
diff --git a/dev/reference/logging.html b/dev/reference/logging.html index 0529dd40e..deaf296f9 100644 --- a/dev/reference/logging.html +++ b/dev/reference/logging.html @@ -1,2 +1,2 @@ -Logging · PowerModelsDistribution

Logging

+Logging · PowerModelsDistribution

Logging

diff --git a/dev/reference/objectives.html b/dev/reference/objectives.html index 97b8ec8bf..916476a20 100644 --- a/dev/reference/objectives.html +++ b/dev/reference/objectives.html @@ -1,2 +1,2 @@ -Objectives · PowerModelsDistribution

Objectives

Helpers

PowerModelsDistribution.calc_pwl_pointsFunction
calc_pwl_points(ncost::Int, cost::Vector{<:Real}, pmin::Real, pmax::Real; tolerance=1e-2)

cleans up raw pwl cost points in preparation for building a mathamatical model. The key mathematical properties,

  • the first and last points are strickly outside of the pmin-to-pmax range
  • pmin and pmax occur in the first and last line segments.
source
+Objectives · PowerModelsDistribution

Objectives

Helpers

PowerModelsDistribution.calc_pwl_pointsFunction
calc_pwl_points(ncost::Int, cost::Vector{<:Real}, pmin::Real, pmax::Real; tolerance=1e-2)

cleans up raw pwl cost points in preparation for building a mathamatical model. The key mathematical properties,

  • the first and last points are strickly outside of the pmin-to-pmax range
  • pmin and pmax occur in the first and last line segments.
source
diff --git a/dev/reference/problems.html b/dev/reference/problems.html index 572e2e4ca..259dd1ef9 100644 --- a/dev/reference/problems.html +++ b/dev/reference/problems.html @@ -1,5 +1,5 @@ -Problems · PowerModelsDistribution

Problems

Solvers

PowerModelsDistribution.solve_mc_modelMethod
solve_mc_model(
+Problems · PowerModelsDistribution

Problems

Solvers

PowerModelsDistribution.solve_mc_modelMethod
solve_mc_model(
     data::Dict{String,<:Any},
     model_type::Type,
     optimizer,
@@ -13,7 +13,7 @@
     make_si_extensions::Vector{<:Function}=Function[],
     dimensionalize_math_extensions::Dict{String,Dict{String,Vector{String}}}=Dict{String,Dict{String,Vector{String}}}(),
     kwargs...
-)::Dict{String,Any}

Takes data in either the ENGINEERING or MATHEMATICAL model, a model type (e.g., ACRUPowerModel), and model builder function (e.g., build_mc_opf), and returns a solution in the original data model defined by data.

If make_si is false, data will remain in per-unit.

For an explanation of multinetwork and global_keys, see make_multinetwork

For an explanation of eng2math_extensions and eng2math_passthrough, see transform_data_model

For an explanation of make_pu_extensions, see make_per_unit!

For an explanation of ref_extensions, see instantiate_mc_model

For an explanation of map_math2eng_extensions, make_si, make_si_extensions, and dimensionalize_math_extensions, see solution_make_si

source
PowerModelsDistribution.solve_mc_modelMethod
solve_mc_model(
+)::Dict{String,Any}

Takes data in either the ENGINEERING or MATHEMATICAL model, a model type (e.g., ACRUPowerModel), and model builder function (e.g., build_mc_opf), and returns a solution in the original data model defined by data.

If make_si is false, data will remain in per-unit.

For an explanation of multinetwork and global_keys, see make_multinetwork

For an explanation of eng2math_extensions and eng2math_passthrough, see transform_data_model

For an explanation of make_pu_extensions, see make_per_unit!

For an explanation of ref_extensions, see instantiate_mc_model

For an explanation of map_math2eng_extensions, make_si, make_si_extensions, and dimensionalize_math_extensions, see solution_make_si

source
PowerModelsDistribution.solve_mc_modelMethod
solve_mc_model(
     file::String,
     model_type::Type,
     optimizer,
@@ -22,40 +22,40 @@
     multinetwork::Bool=false,
     global_keys::Set{String}=Set{String}(),
     kwargs...
-)::Dict{String,Any}

Given a file::String, data will be parsed automatically from the file.

See solve_mc_model for detailed explanation of function arguments.

source

Builders

Builders

PowerModelsDistribution.build_pf_resultMethod
build_pf_result(
   pfd::PowerFlowData,
   Uv::Vector,
   status::PFTerminationStatus,
@@ -63,10 +63,10 @@
   time::Real,
   stationarity::Real,
   verbose::Bool
-)

Builds the result dict from the solution dict.

source

Model Instantiation

Model Instantiation

PowerModelsDistribution.instantiate_mc_modelFunction
instantiate_mc_model(
     data::Dict{String,<:Any},
     model_type::Type,
     build_method::Function;
@@ -77,4 +77,4 @@
     eng2math_passthrough::Dict{String,<:Vector{<:String}}=Dict{String,Vector{String}}(),
     make_pu_extensions::Vector{<:Function}=Function[],
     kwargs...
-)

Takes data in either the ENGINEERING or MATHEMATICAL model, a model type (e.g., ACRUPowerModel), and model builder function (e.g., build_mc_opf), and returns an AbstractUnbalancedPowerModel structure.

For an explanation of multinetwork and global_keys, see make_multinetwork

For an explanation of eng2math_extensions and eng2math_passthrough, see transform_data_model

For an explanation of make_pu_extensions, see make_per_unit!

ref_extensions

Inside of the model structures, data can be quickly accessed via the ref function. By default, the only ref objects available are created by ref_add_core!, but users can add their own custom ref objects by passing functions via ref_extensions that have the signature:

ref_add!(ref::Dict{Symbol,Any}, data::Dict{String,Any})

See the Beginners Guide for an example.

source

Solution Helpers

PowerModelsDistribution.sol_data_model!Method
sol_data_model!(pm::AbstractUnbalancedACRModel, solution::Dict{String,<:Any})

solutionprocessor, see [`solvemcmodel`](@ref solvemc_model), to convert ACR variables back into polar representation (default data model voltage form)

source
PowerModelsDistribution.sol_data_model!Method
sol_data_model!(pm::AbstractUnbalancedWModels, solution::Dict{String,<:Any})

solutionprocessor, see [`solvemcmodel`](@ref solvemc_model), to convert W variables back into polar representation (default data model voltage form)

source
PowerModelsDistribution.sol_data_model!Method
sol_data_model!(pm::FBSUBFPowerModel, solution::Dict{String,<:Any})

solution_processor, to convert FBS variables back into polar representation (default data model voltage form)

source
PowerModelsDistribution.sol_data_model!Method
sol_data_model!(pm::FOTRUPowerModel, solution::Dict{String,<:Any})

solution_processor, to convert FOT rectangular variables back into polar representation (default data model voltage form)

source

DEPRECIATED Solver functions

+)

Takes data in either the ENGINEERING or MATHEMATICAL model, a model type (e.g., ACRUPowerModel), and model builder function (e.g., build_mc_opf), and returns an AbstractUnbalancedPowerModel structure.

For an explanation of multinetwork and global_keys, see make_multinetwork

For an explanation of eng2math_extensions and eng2math_passthrough, see transform_data_model

For an explanation of make_pu_extensions, see make_per_unit!

ref_extensions

Inside of the model structures, data can be quickly accessed via the ref function. By default, the only ref objects available are created by ref_add_core!, but users can add their own custom ref objects by passing functions via ref_extensions that have the signature:

ref_add!(ref::Dict{Symbol,Any}, data::Dict{String,Any})

See the Beginners Guide for an example.

source

Solution Helpers

PowerModelsDistribution.sol_data_model!Method
sol_data_model!(pm::AbstractUnbalancedACRModel, solution::Dict{String,<:Any})

solutionprocessor, see [`solvemcmodel`](@ref solvemc_model), to convert ACR variables back into polar representation (default data model voltage form)

source
PowerModelsDistribution.sol_data_model!Method
sol_data_model!(pm::AbstractUnbalancedWModels, solution::Dict{String,<:Any})

solutionprocessor, see [`solvemcmodel`](@ref solvemc_model), to convert W variables back into polar representation (default data model voltage form)

source
PowerModelsDistribution.sol_data_model!Method
sol_data_model!(pm::FBSUBFPowerModel, solution::Dict{String,<:Any})

solution_processor, to convert FBS variables back into polar representation (default data model voltage form)

source
PowerModelsDistribution.sol_data_model!Method
sol_data_model!(pm::FOTRUPowerModel, solution::Dict{String,<:Any})

solution_processor, to convert FOT rectangular variables back into polar representation (default data model voltage form)

source

DEPRECIATED Solver functions

diff --git a/dev/reference/variables.html b/dev/reference/variables.html index a94bb1688..760fa2ded 100644 --- a/dev/reference/variables.html +++ b/dev/reference/variables.html @@ -4,197 +4,197 @@ nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true -)

For IVR models with explicit neutrals, creates total current variables :cr and :ci, series current variables :csr and :csi, and placeholder dictionaries for the terminal current flows :cr_bus and :ci_bus

source
PowerModelsDistribution.variable_mc_branch_currentMethod
source
PowerModelsDistribution.variable_mc_branch_currentMethod
source
PowerModelsDistribution.variable_mc_branch_currentMethod
source
PowerModelsDistribution.variable_mc_branch_currentMethod
function variable_mc_branch_current(
+)

For IVR models with explicit neutrals, creates total current variables :cr and :ci, series current variables :csr and :csi, and placeholder dictionaries for the terminal current flows :cr_bus and :ci_bus

source
PowerModelsDistribution.variable_mc_branch_currentMethod
source
PowerModelsDistribution.variable_mc_branch_currentMethod
source
PowerModelsDistribution.variable_mc_branch_currentMethod
source
PowerModelsDistribution.variable_mc_branch_currentMethod
function variable_mc_branch_current(
 	pm::ReducedExplicitNeutralIVRModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

For branch-reduced IVR models with explicit neutrals, creates series current variables :csr and :csi, placeholder dictionaries for the total current :cr and :ci, and placeholder dictionaries for the terminal current flows :cr_bus and :ci_bus

source
PowerModelsDistribution.variable_mc_branch_current_imaginaryMethod

variable: ci[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_branch_current_imaginaryMethod
function variable_mc_branch_current_imaginary(
+)

For branch-reduced IVR models with explicit neutrals, creates series current variables :csr and :csi, placeholder dictionaries for the total current :cr and :ci, and placeholder dictionaries for the terminal current flows :cr_bus and :ci_bus

source
PowerModelsDistribution.variable_mc_branch_current_imaginaryMethod

variable: ci[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_branch_current_imaginaryMethod
function variable_mc_branch_current_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates branch imaginary current variables :ci for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_current_realMethod

variable: cr[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_branch_current_realMethod
function variable_mc_branch_current_real(
+)

Creates branch imaginary current variables :ci for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_current_realMethod

variable: cr[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_branch_current_realMethod
function variable_mc_branch_current_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates branch real current variables :cr for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_current_series_imaginaryMethod

variable: csi[l] for l in branch

source
PowerModelsDistribution.variable_mc_branch_current_series_imaginaryMethod
function variable_mc_branch_current_series_imaginary(
+)

Creates branch real current variables :cr for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_current_series_imaginaryMethod

variable: csi[l] for l in branch

source
PowerModelsDistribution.variable_mc_branch_current_series_imaginaryMethod
function variable_mc_branch_current_series_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates branch imaginary series current variables :csi for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_current_series_realMethod

variable: csr[l] for l in branch

source
PowerModelsDistribution.variable_mc_branch_current_series_realMethod
function variable_mc_branch_current_series_real(
+)

Creates branch imaginary series current variables :csi for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_current_series_realMethod

variable: csr[l] for l in branch

source
PowerModelsDistribution.variable_mc_branch_current_series_realMethod
function variable_mc_branch_current_series_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates branch real series current variables :csr for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_flow_ne_reactiveMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_branch_powerMethod
function variable_mc_branch_power(
+)

Creates branch real series current variables :csr for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_flow_ne_reactiveMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_branch_powerMethod
function variable_mc_branch_power(
 	pm::AbstractExplicitNeutralACRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true,
-)

For ACR models with explicit neutrals, creates branch power variables :p and :q and placeholder dictionaries for the terminal power flows :p_bus and :q_bus.

source
PowerModelsDistribution.variable_mc_branch_powerMethod
source
PowerModelsDistribution.variable_mc_branch_powerMethod

branch flow variables, delegated back to PowerModels

source
PowerModelsDistribution.variable_mc_branch_powerMethod
variable_mc_branch_power(pm::FBSUBFPowerModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Branch flow variables similar to LPUBFDiagModel

source
PowerModelsDistribution.variable_mc_branch_powerMethod
source
PowerModelsDistribution.variable_mc_branch_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_branch_power_imaginaryMethod

variable: q[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_branch_power_imaginaryMethod
function variable_mc_branch_power_imaginary(
+)

For ACR models with explicit neutrals, creates branch power variables :p and :q and placeholder dictionaries for the terminal power flows :p_bus and :q_bus.

source
PowerModelsDistribution.variable_mc_branch_powerMethod
source
PowerModelsDistribution.variable_mc_branch_powerMethod

branch flow variables, delegated back to PowerModels

source
PowerModelsDistribution.variable_mc_branch_powerMethod
variable_mc_branch_power(pm::FBSUBFPowerModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Branch flow variables similar to LPUBFDiagModel

source
PowerModelsDistribution.variable_mc_branch_powerMethod
source
PowerModelsDistribution.variable_mc_branch_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_branch_power_imaginaryMethod

variable: q[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_branch_power_imaginaryMethod
function variable_mc_branch_power_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates branch reactive power variables :q for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_power_realMethod
source
PowerModelsDistribution.variable_mc_branch_power_realMethod

variable: p[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_branch_power_realMethod
function variable_mc_branch_power_real(
+)

Creates branch reactive power variables :q for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_branch_power_realMethod
source
PowerModelsDistribution.variable_mc_branch_power_realMethod

variable: p[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_branch_power_realMethod
function variable_mc_branch_power_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates branch active power variables :p for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod

nothing to do, these models do not have complex voltage variables

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
variable_mc_bus_voltage(pm::FBSUBFPowerModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Voltage variables are defined in rectangular coordinates similar to ACRUPowerModel. An initial operating point is specified for linearization.

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
variable_mc_bus_voltage(pm::FOTPUPowerModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Voltage variables are defined in polar coordinates similar to ACPUPowerModel. An initial operating point is specified for linearization.

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
variable_mc_bus_voltage(pm::FOTRUPowerModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Voltage variables are defined in rectangular coordinates similar to ACRUPowerModel. An initial operating point is specified for linearization similar to FBSUBFPowerModel.

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
function variable_mc_bus_voltage(
+)

Creates branch active power variables :p for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod

nothing to do, these models do not have complex voltage variables

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
variable_mc_bus_voltage(pm::FBSUBFPowerModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Voltage variables are defined in rectangular coordinates similar to ACRUPowerModel. An initial operating point is specified for linearization.

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
variable_mc_bus_voltage(pm::FOTPUPowerModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Voltage variables are defined in polar coordinates similar to ACPUPowerModel. An initial operating point is specified for linearization.

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
variable_mc_bus_voltage(pm::FOTRUPowerModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Voltage variables are defined in rectangular coordinates similar to ACRUPowerModel. An initial operating point is specified for linearization similar to FBSUBFPowerModel.

source
PowerModelsDistribution.variable_mc_bus_voltageMethod
source
PowerModelsDistribution.variable_mc_bus_voltageMethod
function variable_mc_bus_voltage(
 	pm::RectangularVoltageExplicitNeutralModels;
 	nw=nw_id_default,
 	bounded::Bool=true,
-)

Creates rectangular voltage variables :vr and :vi for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_bus_voltage_angleMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_imaginaryMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_imaginaryMethod
function variable_mc_bus_voltage_imaginary(
+)

Creates rectangular voltage variables :vr and :vi for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_bus_voltage_angleMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_imaginaryMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_imaginaryMethod
function variable_mc_bus_voltage_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates imaginary voltage variables :vr for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_bus_voltage_imaginary_on_offMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_indicatorMethod

Create variables for bus status

source
PowerModelsDistribution.variable_mc_bus_voltage_magnitude_on_offMethod

on/off voltage magnitude variable

source
PowerModelsDistribution.variable_mc_bus_voltage_magnitude_onlyMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_magnitude_sqrMethod

variable: w[i] >= 0 for i in `buses

source
PowerModelsDistribution.variable_mc_bus_voltage_magnitude_sqr_on_offMethod

voltage variable magnitude squared (relaxed form)

source
PowerModelsDistribution.variable_mc_bus_voltage_on_offMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_on_offMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_on_offMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_on_offMethod

Create voltage variables for branch flow model

source
PowerModelsDistribution.variable_mc_bus_voltage_prod_hermitianMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_realMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_realMethod
function variable_mc_bus_voltage_real(
+)

Creates imaginary voltage variables :vr for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_bus_voltage_imaginary_on_offMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_indicatorMethod

Create variables for bus status

source
PowerModelsDistribution.variable_mc_bus_voltage_magnitude_on_offMethod

on/off voltage magnitude variable

source
PowerModelsDistribution.variable_mc_bus_voltage_magnitude_onlyMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_magnitude_sqrMethod

variable: w[i] >= 0 for i in `buses

source
PowerModelsDistribution.variable_mc_bus_voltage_magnitude_sqr_on_offMethod

voltage variable magnitude squared (relaxed form)

source
PowerModelsDistribution.variable_mc_bus_voltage_on_offMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_on_offMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_on_offMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_on_offMethod

Create voltage variables for branch flow model

source
PowerModelsDistribution.variable_mc_bus_voltage_prod_hermitianMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_realMethod
source
PowerModelsDistribution.variable_mc_bus_voltage_realMethod
function variable_mc_bus_voltage_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates real voltage variables :vr for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_bus_voltage_real_on_offMethod
source
PowerModelsDistribution.variable_mc_capacitor_reactive_powerMethod
variable_mc_capacitor_reactive_power(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)

Capacitor (with capcontrol) relaxed power variables for AbstractLPUBFModel (using McCormick envelopes)

source
PowerModelsDistribution.variable_mc_capacitor_switch_stateMethod
variable_mc_capacitor_switch_state(pm::AbstractUnbalancedPowerModel, relax::Bool; nw::Int=nw_id_default, report::Bool=true)

Capacitor (with capcontrol) switch state (open/close) variables

source
PowerModelsDistribution.variable_mc_capcontrolMethod
variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)

Capacitor switching and relaxed power variables.

source
PowerModelsDistribution.variable_mc_capcontrolMethod

nothing to do, these models do not have complex voltage variables

source
PowerModelsDistribution.variable_mc_capcontrolMethod
variable_mc_capcontrol(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)

Capacitor switching variables.

source
PowerModelsDistribution.variable_mc_gen_indicatorMethod

Create variables for generator status

source
PowerModelsDistribution.variable_mc_generator_currentMethod

For the matrix KCL formulation, the generator needs an explicit current variable.

source
PowerModelsDistribution.variable_mc_generator_currentMethod
source
PowerModelsDistribution.variable_mc_generator_currentMethod
variable_mc_generator_current(pm::SOCUBFModels, gen_ids::Vector{Int}; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

For the SOC branch-flow formulation, the delta-generator needs an explicit current variable.

source
PowerModelsDistribution.variable_mc_generator_current_imaginaryMethod

variable: cig[j] for j in gen

source
PowerModelsDistribution.variable_mc_generator_current_imaginaryMethod
function variable_mc_generator_current_imaginary(
+)

Creates real voltage variables :vr for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_bus_voltage_real_on_offMethod
source
PowerModelsDistribution.variable_mc_capacitor_reactive_powerMethod
variable_mc_capacitor_reactive_power(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)

Capacitor (with capcontrol) relaxed power variables for AbstractLPUBFModel (using McCormick envelopes)

source
PowerModelsDistribution.variable_mc_capacitor_switch_stateMethod
variable_mc_capacitor_switch_state(pm::AbstractUnbalancedPowerModel, relax::Bool; nw::Int=nw_id_default, report::Bool=true)

Capacitor (with capcontrol) switch state (open/close) variables

source
PowerModelsDistribution.variable_mc_capcontrolMethod
variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)

Capacitor switching and relaxed power variables.

source
PowerModelsDistribution.variable_mc_capcontrolMethod

nothing to do, these models do not have complex voltage variables

source
PowerModelsDistribution.variable_mc_capcontrolMethod
variable_mc_capcontrol(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)

Capacitor switching variables.

source
PowerModelsDistribution.variable_mc_gen_indicatorMethod

Create variables for generator status

source
PowerModelsDistribution.variable_mc_generator_currentMethod

For the matrix KCL formulation, the generator needs an explicit current variable.

source
PowerModelsDistribution.variable_mc_generator_currentMethod
source
PowerModelsDistribution.variable_mc_generator_currentMethod
variable_mc_generator_current(pm::SOCUBFModels, gen_ids::Vector{Int}; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

For the SOC branch-flow formulation, the delta-generator needs an explicit current variable.

source
PowerModelsDistribution.variable_mc_generator_current_imaginaryMethod

variable: cig[j] for j in gen

source
PowerModelsDistribution.variable_mc_generator_current_imaginaryMethod
function variable_mc_generator_current_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates generator imaginary current variables :cig for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_generator_current_realMethod

variable: crg[j] for j in gen

source
PowerModelsDistribution.variable_mc_generator_current_realMethod
function variable_mc_generator_current_real(
+)

Creates generator imaginary current variables :cig for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_generator_current_realMethod

variable: crg[j] for j in gen

source
PowerModelsDistribution.variable_mc_generator_current_realMethod
function variable_mc_generator_current_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates generator real current variables :crg for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_generator_powerMethod
function variable_mc_generator_power(
+)

Creates generator real current variables :crg for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_generator_powerMethod
function variable_mc_generator_power(
 	pm::AbstractExplicitNeutralACRModel;
 	nw::Int=nw_id_default,
-)

For ACR models with explicit neutrals, creates generator power variables :pg and :qg, and placeholder dictionaries for terminal power flows :pg_bus and :qg_bus,

source
PowerModelsDistribution.variable_mc_generator_powerMethod
function variable_mc_generator_power(
+)

For ACR models with explicit neutrals, creates generator power variables :pg and :qg, and placeholder dictionaries for terminal power flows :pg_bus and :qg_bus,

source
PowerModelsDistribution.variable_mc_generator_powerMethod
function variable_mc_generator_power(
 	pm::AbstractNLExplicitNeutralIVRModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true
-)

For IVR models with explicit neutrals, no power variables are required

source
PowerModelsDistribution.variable_mc_generator_powerMethod
function variable_mc_generator_power(
+)

For IVR models with explicit neutrals, no power variables are required

source
PowerModelsDistribution.variable_mc_generator_powerMethod
function variable_mc_generator_power(
 	pm::AbstractQuadraticExplicitNeutralIVRModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true
-)

For quadratic IVR models with explicit neutrals, creates generator power variables :pg and :qg

source
PowerModelsDistribution.variable_mc_generator_powerMethod
variable_mc_generator_power(pm::AbstractUBFModels; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

The variable creation for generators in branch flow model. Delta generators always need an auxilary power variable (X) similar to delta loads. Wye generators however, don't need any variables.

source
PowerModelsDistribution.variable_mc_generator_powerMethod

create variables for generators, delegate to PowerModels

source
PowerModelsDistribution.variable_mc_generator_powerMethod

For the matrix KCL formulation, the generator needs an explicit current and power variable.

source
PowerModelsDistribution.variable_mc_generator_powerMethod
variable_mc_generator_power(pm::SOCUBFModels; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

The variable creation for generators in SOC branch flow model. Delta generators always need an auxilary power variable (X) and current squared variable (CC) similar to delta loads. Wye generators however, don't need any variables.

source
PowerModelsDistribution.variable_mc_generator_power_delta_auxMethod
variable_mc_generator_power_delta_aux(pm::AbstractUBFModels, gen_ids::Vector{Int}; nw::Int=nw_id_default, eps::Real=0.1, bounded::Bool=true, report::Bool=true)

Creates power matrix variable X for delta-connected generators similar to delta loads.

source
PowerModelsDistribution.variable_mc_generator_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_generator_power_imaginaryMethod
source
PowerModelsDistribution.variable_mc_generator_power_imaginaryMethod
function variable_mc_generator_power_imaginary(
+)

For quadratic IVR models with explicit neutrals, creates generator power variables :pg and :qg

source
PowerModelsDistribution.variable_mc_generator_powerMethod
variable_mc_generator_power(pm::AbstractUBFModels; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

The variable creation for generators in branch flow model. Delta generators always need an auxilary power variable (X) similar to delta loads. Wye generators however, don't need any variables.

source
PowerModelsDistribution.variable_mc_generator_powerMethod

create variables for generators, delegate to PowerModels

source
PowerModelsDistribution.variable_mc_generator_powerMethod

For the matrix KCL formulation, the generator needs an explicit current and power variable.

source
PowerModelsDistribution.variable_mc_generator_powerMethod
variable_mc_generator_power(pm::SOCUBFModels; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

The variable creation for generators in SOC branch flow model. Delta generators always need an auxilary power variable (X) and current squared variable (CC) similar to delta loads. Wye generators however, don't need any variables.

source
PowerModelsDistribution.variable_mc_generator_power_delta_auxMethod
variable_mc_generator_power_delta_aux(pm::AbstractUBFModels, gen_ids::Vector{Int}; nw::Int=nw_id_default, eps::Real=0.1, bounded::Bool=true, report::Bool=true)

Creates power matrix variable X for delta-connected generators similar to delta loads.

source
PowerModelsDistribution.variable_mc_generator_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_generator_power_imaginaryMethod
source
PowerModelsDistribution.variable_mc_generator_power_imaginaryMethod
function variable_mc_generator_power_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates generator reactive power variables :qg for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_generator_power_imaginary_on_offMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_generator_power_imaginary_on_offMethod
source
PowerModelsDistribution.variable_mc_generator_power_mxMethod

For the matrix KCL formulation, the generator needs an explicit power variable.

source
PowerModelsDistribution.variable_mc_generator_power_on_offMethod
source
PowerModelsDistribution.variable_mc_generator_power_realMethod
source
PowerModelsDistribution.variable_mc_generator_power_realMethod
function variable_mc_generator_power_real(
+)

Creates generator reactive power variables :qg for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_generator_power_imaginary_on_offMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_generator_power_imaginary_on_offMethod
source
PowerModelsDistribution.variable_mc_generator_power_mxMethod

For the matrix KCL formulation, the generator needs an explicit power variable.

source
PowerModelsDistribution.variable_mc_generator_power_on_offMethod
source
PowerModelsDistribution.variable_mc_generator_power_realMethod
source
PowerModelsDistribution.variable_mc_generator_power_realMethod
function variable_mc_generator_power_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates generator active power variables :pg for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_generator_power_real_on_offMethod
source
PowerModelsDistribution.variable_mc_load_currentMethod
function variable_mc_load_current(
+)

Creates generator active power variables :pg for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_generator_power_real_on_offMethod
source
PowerModelsDistribution.variable_mc_load_currentMethod
function variable_mc_load_current(
 	pm::AbstractExplicitNeutralIVRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

For IVR models with explicit neutrals, creates placeholder dictionaries for the load current :crd and :cid, and for the terminal current flows :crd_bus and :cid_bus

source
PowerModelsDistribution.variable_mc_load_currentMethod
function variable_mc_load_current(
+)

For IVR models with explicit neutrals, creates placeholder dictionaries for the load current :crd and :cid, and for the terminal current flows :crd_bus and :cid_bus

source
PowerModelsDistribution.variable_mc_load_currentMethod
function variable_mc_load_current(
 	pm::AbstractQuadraticExplicitNeutralIVRModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true
-)

For quadratic IVR models with explicit neutrals, creates load current variables :crd and :cid, and placeholder dictionaries for the terminal current flows :crd_bus and :cid_bus

source
PowerModelsDistribution.variable_mc_load_currentMethod

All loads need a current variable; for wye loads, this variable will be in the wye reference frame whilst for delta currents it will be in the delta reference frame.

source
PowerModelsDistribution.variable_mc_load_currentMethod
source
PowerModelsDistribution.variable_mc_load_currentMethod
variable_mc_load_current(pm::FBSUBFPowerModel, load_ids::Vector{Int}; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

No loads require a current variable. Delta loads are zero-order approximations and wye loads are first-order approximations around the initial operating point.

source
PowerModelsDistribution.variable_mc_load_current_imaginaryMethod
function variable_mc_load_current_imaginary(
+)

For quadratic IVR models with explicit neutrals, creates load current variables :crd and :cid, and placeholder dictionaries for the terminal current flows :crd_bus and :cid_bus

source
PowerModelsDistribution.variable_mc_load_currentMethod

All loads need a current variable; for wye loads, this variable will be in the wye reference frame whilst for delta currents it will be in the delta reference frame.

source
PowerModelsDistribution.variable_mc_load_currentMethod
source
PowerModelsDistribution.variable_mc_load_currentMethod
variable_mc_load_current(pm::FBSUBFPowerModel, load_ids::Vector{Int}; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

No loads require a current variable. Delta loads are zero-order approximations and wye loads are first-order approximations around the initial operating point.

source
PowerModelsDistribution.variable_mc_load_current_imaginaryMethod
function variable_mc_load_current_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates load imaginary current variables :cid for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_load_current_realMethod
function variable_mc_load_current_real(
+)

Creates load imaginary current variables :cid for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_load_current_realMethod
function variable_mc_load_current_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates load real current variables :crd for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_load_indicatorMethod

Create variables for demand status

source
PowerModelsDistribution.variable_mc_load_powerMethod
function variable_mc_load_power(
+)

Creates load real current variables :crd for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_load_indicatorMethod

Create variables for demand status

source
PowerModelsDistribution.variable_mc_load_powerMethod
function variable_mc_load_power(
 	pm::AbstractExplicitNeutralACRModel;
 	nw=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

For ACR models with explicit neutrals, creates placeholder dictionaries for load power expressions :pd and :qd

source
PowerModelsDistribution.variable_mc_load_powerMethod
function variable_mc_load_power(
+)

For ACR models with explicit neutrals, creates placeholder dictionaries for load power expressions :pd and :qd

source
PowerModelsDistribution.variable_mc_load_powerMethod
function variable_mc_load_power(
 	pm::AbstractNLExplicitNeutralIVRModel;
 	nw=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

For non-linear IVR models with explicit neutrals, creates placeholder dictionaries for the load power :pd and :qd, and for the terminal power flows :pd_bus and :qd_bus

source
PowerModelsDistribution.variable_mc_load_powerMethod
function variable_mc_load_power(
+)

For non-linear IVR models with explicit neutrals, creates placeholder dictionaries for the load power :pd and :qd, and for the terminal power flows :pd_bus and :qd_bus

source
PowerModelsDistribution.variable_mc_load_powerMethod
function variable_mc_load_power(
 	pm::AbstractQuadraticExplicitNeutralIVRModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true
-)

For quadratic IVR models with explicit neutrals, creates load power variables :pd and :qd

source
PowerModelsDistribution.variable_mc_load_powerMethod

These variables reflect the power consumed by the load, NOT the power injected into the bus nodes; these variables only coincide for wye-connected loads with a grounded neutral.

source
PowerModelsDistribution.variable_mc_load_powerMethod

The variable creation for the loads is rather complicated because Expressions are used wherever possible instead of explicit variables. Delta loads always need a current variable and auxilary power variable (X), and all other load model variables are then linear transformations of these (linear Expressions). Wye loads however, don't need any variables when the load is modelled as constant power or constant impedance. In all other cases (e.g. when a cone is used to constrain the power), variables need to be created.

source
PowerModelsDistribution.variable_mc_load_powerMethod

Create a dictionary with values of type Any for the load. Depending on the load model, this can be a parameter or a NLexpression. These will be inserted into KCL.

source
PowerModelsDistribution.variable_mc_load_powerMethod

Create a dictionary with values of type Any for the load. Depending on the load model, this can be a parameter or a NLexpression. These will be inserted into KCL.

source
PowerModelsDistribution.variable_mc_load_powerMethod

The variable creation for the loads is rather complicated because Expressions are used wherever possible instead of explicit variables. All loads need a current variable; for wye loads, this variable will be in the wye reference frame whilst for delta currents it will be in the delta reference frame. All loads need variables for the off-diagonals of the nodal power variables. In some cases, the diagonals elements can be created as Expressions. Delta loads only need a current variable and auxilary power variable (X), and all other load model variables are then linear transformations of these (linear Expressions).

source
PowerModelsDistribution.variable_mc_load_power_activeMethod
function variable_mc_load_power_active(
+)

For quadratic IVR models with explicit neutrals, creates load power variables :pd and :qd

source
PowerModelsDistribution.variable_mc_load_powerMethod

These variables reflect the power consumed by the load, NOT the power injected into the bus nodes; these variables only coincide for wye-connected loads with a grounded neutral.

source
PowerModelsDistribution.variable_mc_load_powerMethod

The variable creation for the loads is rather complicated because Expressions are used wherever possible instead of explicit variables. Delta loads always need a current variable and auxilary power variable (X), and all other load model variables are then linear transformations of these (linear Expressions). Wye loads however, don't need any variables when the load is modelled as constant power or constant impedance. In all other cases (e.g. when a cone is used to constrain the power), variables need to be created.

source
PowerModelsDistribution.variable_mc_load_powerMethod

Create a dictionary with values of type Any for the load. Depending on the load model, this can be a parameter or a NLexpression. These will be inserted into KCL.

source
PowerModelsDistribution.variable_mc_load_powerMethod

Create a dictionary with values of type Any for the load. Depending on the load model, this can be a parameter or a NLexpression. These will be inserted into KCL.

source
PowerModelsDistribution.variable_mc_load_powerMethod

The variable creation for the loads is rather complicated because Expressions are used wherever possible instead of explicit variables. All loads need a current variable; for wye loads, this variable will be in the wye reference frame whilst for delta currents it will be in the delta reference frame. All loads need variables for the off-diagonals of the nodal power variables. In some cases, the diagonals elements can be created as Expressions. Delta loads only need a current variable and auxilary power variable (X), and all other load model variables are then linear transformations of these (linear Expressions).

source
PowerModelsDistribution.variable_mc_load_power_activeMethod
function variable_mc_load_power_active(
 	pm::AbstractQuadraticExplicitNeutralIVRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates load active power variables :pd for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_load_power_busMethod

The bus qualifier denotes that this is the power withdrawn at the bus; Only for grounded wye-connected loads, this is the same as the power consumed by the multi-phase load. The off-diagonals only need to be created for the matrix KCL formulation.

source
PowerModelsDistribution.variable_mc_load_power_delta_auxMethod

Creates power matrix variable X for delta windings; this defines both the wye-side power Sy and the delta-side power Sd through the lin. transformations Sy = X.Td, Sd = Td.X with Td=[1 -1 0; 0 1 -1; -1 0 1]

See the paper by Zhao et al. for the first convex relaxation of delta transformations. @INPROCEEDINGS{zhaooptimal2017, author={C. Zhao, E. Dall'Anese and S. Low}, booktitle={IREP 2017 Bulk Power Systems Dynamics and Control Symposium}, title={{Optimal Power Flow in Multiphase Radial Networks with Delta Connections}}, year={2017}, month={}, url={https://www.nrel.gov/docs/fy18osti/67852.pdf} }

See upcoming paper for discussion of bounds. [reference added when accepted]

source
PowerModelsDistribution.variable_mc_load_power_delta_auxMethod
variable_mc_load_power_delta_aux(pm::FBSUBFPowerModel, load_ids::Vector{Int}; nw::Int=nw_id_default, eps::Real=0.1, bounded::Bool=true, report::Bool=true)

Auxiliary variables are not required since delta loads are zero-order approximations calculated using the initial operating point.

source
PowerModelsDistribution.variable_mc_load_power_reactiveMethod
function variable_mc_load_power_reactive(
+)

Creates load active power variables :pd for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_load_power_busMethod

The bus qualifier denotes that this is the power withdrawn at the bus; Only for grounded wye-connected loads, this is the same as the power consumed by the multi-phase load. The off-diagonals only need to be created for the matrix KCL formulation.

source
PowerModelsDistribution.variable_mc_load_power_delta_auxMethod

Creates power matrix variable X for delta windings; this defines both the wye-side power Sy and the delta-side power Sd through the lin. transformations Sy = X.Td, Sd = Td.X with Td=[1 -1 0; 0 1 -1; -1 0 1]

See the paper by Zhao et al. for the first convex relaxation of delta transformations. @INPROCEEDINGS{zhaooptimal2017, author={C. Zhao, E. Dall'Anese and S. Low}, booktitle={IREP 2017 Bulk Power Systems Dynamics and Control Symposium}, title={{Optimal Power Flow in Multiphase Radial Networks with Delta Connections}}, year={2017}, month={}, url={https://www.nrel.gov/docs/fy18osti/67852.pdf} }

See upcoming paper for discussion of bounds. [reference added when accepted]

source
PowerModelsDistribution.variable_mc_load_power_delta_auxMethod
variable_mc_load_power_delta_aux(pm::FBSUBFPowerModel, load_ids::Vector{Int}; nw::Int=nw_id_default, eps::Real=0.1, bounded::Bool=true, report::Bool=true)

Auxiliary variables are not required since delta loads are zero-order approximations calculated using the initial operating point.

source
PowerModelsDistribution.variable_mc_load_power_reactiveMethod
function variable_mc_load_power_reactive(
 	pm::AbstractQuadraticExplicitNeutralIVRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates load reactive power variables :qd for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_oltc_transformer_tapMethod

no voltage variables

source
PowerModelsDistribution.variable_mc_oltc_transformer_tapMethod

Create tap variables.

source
PowerModelsDistribution.variable_mc_shunt_indicatorMethod

Create variables for shunt status

source
PowerModelsDistribution.variable_mc_slack_bus_powerMethod

generates variables for both active and reactive slack at each bus

source
PowerModelsDistribution.variable_mc_slack_bus_power_imaginaryMethod
source
PowerModelsDistribution.variable_mc_slack_bus_power_realMethod
source
PowerModelsDistribution.variable_mc_storage_currentMethod

do nothing by default but some formulations require this

source
PowerModelsDistribution.variable_mc_storage_currentMethod

do nothing by default but some formulations require this

source
PowerModelsDistribution.variable_mc_storage_indicatorMethod

Create variables for storage status

source
PowerModelsDistribution.variable_mc_storage_powerMethod

variables for modeling storage units, includes grid injection and internal variables

source
PowerModelsDistribution.variable_mc_storage_power_control_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_storage_power_control_imaginaryMethod

a reactive power slack variable that enables the storage device to inject or consume reactive power at its connecting bus, subject to the injection limits of the device.

source
PowerModelsDistribution.variable_mc_storage_power_control_imaginary_on_offMethod

a reactive power slack variable that enables the storage device to inject or consume reactive power at its connecting bus, subject to the injection limits of the device.

source
PowerModelsDistribution.variable_mc_storage_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_storage_power_imaginaryMethod
source
PowerModelsDistribution.variable_mc_storage_power_imaginary_on_offMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_storage_power_imaginary_on_offMethod

Create variables for reactive storage injection

source
PowerModelsDistribution.variable_mc_storage_power_miMethod
variable_mc_storage_power_mi(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false, bounded::Bool=true, report::Bool=true)

Variables for storage power (mixed-integer if relax==false)

source
PowerModelsDistribution.variable_mc_storage_power_mi_on_offMethod
source
PowerModelsDistribution.variable_mc_storage_power_on_offMethod

Create variables for active and reactive storage injection

source
PowerModelsDistribution.variable_mc_storage_power_realMethod
source
PowerModelsDistribution.variable_mc_storage_power_real_on_offMethod

Create variables for active storage injection

source
PowerModelsDistribution.variable_mc_switch_currentMethod
function variable_mc_switch_current(
+)

Creates load reactive power variables :qd for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_oltc_transformer_tapMethod

no voltage variables

source
PowerModelsDistribution.variable_mc_oltc_transformer_tapMethod

Create tap variables.

source
PowerModelsDistribution.variable_mc_shunt_indicatorMethod

Create variables for shunt status

source
PowerModelsDistribution.variable_mc_slack_bus_powerMethod

generates variables for both active and reactive slack at each bus

source
PowerModelsDistribution.variable_mc_slack_bus_power_imaginaryMethod
source
PowerModelsDistribution.variable_mc_slack_bus_power_realMethod
source
PowerModelsDistribution.variable_mc_storage_currentMethod

do nothing by default but some formulations require this

source
PowerModelsDistribution.variable_mc_storage_currentMethod

do nothing by default but some formulations require this

source
PowerModelsDistribution.variable_mc_storage_indicatorMethod

Create variables for storage status

source
PowerModelsDistribution.variable_mc_storage_powerMethod

variables for modeling storage units, includes grid injection and internal variables

source
PowerModelsDistribution.variable_mc_storage_power_control_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_storage_power_control_imaginaryMethod

a reactive power slack variable that enables the storage device to inject or consume reactive power at its connecting bus, subject to the injection limits of the device.

source
PowerModelsDistribution.variable_mc_storage_power_control_imaginary_on_offMethod

a reactive power slack variable that enables the storage device to inject or consume reactive power at its connecting bus, subject to the injection limits of the device.

source
PowerModelsDistribution.variable_mc_storage_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_storage_power_imaginaryMethod
source
PowerModelsDistribution.variable_mc_storage_power_imaginary_on_offMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_storage_power_imaginary_on_offMethod

Create variables for reactive storage injection

source
PowerModelsDistribution.variable_mc_storage_power_miMethod
variable_mc_storage_power_mi(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false, bounded::Bool=true, report::Bool=true)

Variables for storage power (mixed-integer if relax==false)

source
PowerModelsDistribution.variable_mc_storage_power_mi_on_offMethod
source
PowerModelsDistribution.variable_mc_storage_power_on_offMethod

Create variables for active and reactive storage injection

source
PowerModelsDistribution.variable_mc_storage_power_realMethod
source
PowerModelsDistribution.variable_mc_storage_power_real_on_offMethod

Create variables for active storage injection

source
PowerModelsDistribution.variable_mc_switch_currentMethod
function variable_mc_switch_current(
 	pm::AbstractExplicitNeutralIVRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true,
-)

For IVR models with explicit neutrals, creates switch current variables :crs and :cis, and placeholder dictionaries for the terminal current flows :crsw_bus and :cisw_bus

source
PowerModelsDistribution.variable_mc_switch_currentMethod
source
PowerModelsDistribution.variable_mc_switch_currentMethod
source
PowerModelsDistribution.variable_mc_switch_current_imaginaryMethod
source
PowerModelsDistribution.variable_mc_switch_current_imaginaryMethod
function variable_mc_switch_current_imaginary(
+)

For IVR models with explicit neutrals, creates switch current variables :crs and :cis, and placeholder dictionaries for the terminal current flows :crsw_bus and :cisw_bus

source
PowerModelsDistribution.variable_mc_switch_currentMethod
source
PowerModelsDistribution.variable_mc_switch_currentMethod
source
PowerModelsDistribution.variable_mc_switch_current_imaginaryMethod
source
PowerModelsDistribution.variable_mc_switch_current_imaginaryMethod
function variable_mc_switch_current_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

For models with explicit neutrals, creates switch imaginary current variables :cisw for models with explicit neutrals.

source
PowerModelsDistribution.variable_mc_switch_current_realMethod
source
PowerModelsDistribution.variable_mc_switch_current_realMethod
function variable_mc_switch_current_real(
+)

For models with explicit neutrals, creates switch imaginary current variables :cisw for models with explicit neutrals.

source
PowerModelsDistribution.variable_mc_switch_current_realMethod
source
PowerModelsDistribution.variable_mc_switch_current_realMethod
function variable_mc_switch_current_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

For models with explicit neutrals, creates switch real current variables :crsw for models with explicit neutrals.

source
PowerModelsDistribution.variable_mc_switch_powerMethod
function variable_mc_switch_power(
+)

For models with explicit neutrals, creates switch real current variables :crsw for models with explicit neutrals.

source
PowerModelsDistribution.variable_mc_switch_powerMethod
function variable_mc_switch_power(
 	pm::AbstractExplicitNeutralACRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true,
-)

For ACR models with explicit neutrals, creates switch power variables :p and :q and placeholder dictionaries for the terminal power flows :ps_bus and :qs_bus.

source
PowerModelsDistribution.variable_mc_switch_powerMethod

matrix power variables for switches

source
PowerModelsDistribution.variable_mc_switch_powerMethod
source
PowerModelsDistribution.variable_mc_switch_powerMethod
variable_mc_switch_power(pm::LPUBFDiagModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Switch power variables.

source
PowerModelsDistribution.variable_mc_switch_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_switch_power_imaginaryMethod
source
PowerModelsDistribution.variable_mc_switch_power_imaginaryMethod
function variable_mc_switch_power_imaginary(
+)

For ACR models with explicit neutrals, creates switch power variables :p and :q and placeholder dictionaries for the terminal power flows :ps_bus and :qs_bus.

source
PowerModelsDistribution.variable_mc_switch_powerMethod

matrix power variables for switches

source
PowerModelsDistribution.variable_mc_switch_powerMethod
source
PowerModelsDistribution.variable_mc_switch_powerMethod
variable_mc_switch_power(pm::LPUBFDiagModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)

Switch power variables.

source
PowerModelsDistribution.variable_mc_switch_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_switch_power_imaginaryMethod
source
PowerModelsDistribution.variable_mc_switch_power_imaginaryMethod
function variable_mc_switch_power_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

For models with explicit neutrals, creates switch reactive power variables :qsw for models with explicit neutrals. This is defined per arc, i.e. with a variable for the from-side and to-side power.

source
PowerModelsDistribution.variable_mc_switch_power_realMethod
source
PowerModelsDistribution.variable_mc_switch_power_realMethod
function variable_mc_switch_power_real(
+)

For models with explicit neutrals, creates switch reactive power variables :qsw for models with explicit neutrals. This is defined per arc, i.e. with a variable for the from-side and to-side power.

source
PowerModelsDistribution.variable_mc_switch_power_realMethod
source
PowerModelsDistribution.variable_mc_switch_power_realMethod
function variable_mc_switch_power_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

For models with explicit neutrals, creates switch active power variables :psw for models with explicit neutrals. This is defined per arc, i.e. with a variable for the from-side and to-side power.

source
PowerModelsDistribution.variable_mc_switch_stateMethod

switch state (open/close) variables

source
PowerModelsDistribution.variable_mc_transformer_currentMethod
function variable_mc_transformer_current(
+)

For models with explicit neutrals, creates switch active power variables :psw for models with explicit neutrals. This is defined per arc, i.e. with a variable for the from-side and to-side power.

source
PowerModelsDistribution.variable_mc_switch_stateMethod

switch state (open/close) variables

source
PowerModelsDistribution.variable_mc_transformer_currentMethod
function variable_mc_transformer_current(
 	pm::AbstractExplicitNeutralIVRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true,
-)

For IVR models with explicit neutrals, create transformer current variables :crt and :cit, and placeholder dictionaries for the terminal current flows :crt_bus and :cit_bus

source
PowerModelsDistribution.variable_mc_transformer_currentMethod
source
PowerModelsDistribution.variable_mc_transformer_current_imaginaryMethod

variable: ci[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_transformer_current_imaginaryMethod
function variable_mc_transformer_current_imaginary(
+)

For IVR models with explicit neutrals, create transformer current variables :crt and :cit, and placeholder dictionaries for the terminal current flows :crt_bus and :cit_bus

source
PowerModelsDistribution.variable_mc_transformer_currentMethod
source
PowerModelsDistribution.variable_mc_transformer_current_imaginaryMethod

variable: ci[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_transformer_current_imaginaryMethod
function variable_mc_transformer_current_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates transformer imaginary current variables :cit for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_transformer_current_realMethod

variable: cr[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_transformer_current_realMethod
function variable_mc_transformer_current_real(
+)

Creates transformer imaginary current variables :cit for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_transformer_current_realMethod

variable: cr[l,i,j] for (l,i,j) in arcs

source
PowerModelsDistribution.variable_mc_transformer_current_realMethod
function variable_mc_transformer_current_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates transformer real current variables :crt for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_transformer_powerMethod
function variable_mc_transformer_power(
+)

Creates transformer real current variables :crt for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_transformer_powerMethod
function variable_mc_transformer_power(
 	pm::AbstractExplicitNeutralACRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true,
-)

For ACR models with explicit neutrals, creates transfomer power variables :pt and :qt, and placeholder dictionaries for transformer terminal power flows :pt_bus and :qt_bus

source
PowerModelsDistribution.variable_mc_transformer_powerMethod
function variable_mc_transformer_power(
+)

For ACR models with explicit neutrals, creates transfomer power variables :pt and :qt, and placeholder dictionaries for transformer terminal power flows :pt_bus and :qt_bus

source
PowerModelsDistribution.variable_mc_transformer_powerMethod
function variable_mc_transformer_power(
 	pm::AbstractNLExplicitNeutralIVRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true,
-)

For non-linear IVR models with explicit neutrals, no power variables are required.

source
PowerModelsDistribution.variable_mc_transformer_powerMethod
function variable_mc_transformer_power(
+)

For non-linear IVR models with explicit neutrals, no power variables are required.

source
PowerModelsDistribution.variable_mc_transformer_powerMethod
function variable_mc_transformer_power(
 	pm::AbstractQuadraticExplicitNeutralIVRModel;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true,
-)

For quadratic IVR models with explicit neutrals, creates transformer power variables :pt and :qt

source
PowerModelsDistribution.variable_mc_transformer_powerMethod

defines matrix transformer power variables for the unbalanced branch flow models

source
PowerModelsDistribution.variable_mc_transformer_powerMethod

Creates variables for both active and reactive power flow at each transformer.

source
PowerModelsDistribution.variable_mc_transformer_powerMethod

Creates variables for both active and reactive power flow at each transformer.

source
PowerModelsDistribution.variable_mc_transformer_powerMethod

Creates variables for both active and reactive power flow at each transformer.

source
PowerModelsDistribution.variable_mc_transformer_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_transformer_power_imaginaryMethod

Create variables for the reactive power flowing into all transformer windings.

source
PowerModelsDistribution.variable_mc_transformer_power_imaginaryMethod
function variable_mc_transformer_power_imaginary(
+)

For quadratic IVR models with explicit neutrals, creates transformer power variables :pt and :qt

source
PowerModelsDistribution.variable_mc_transformer_powerMethod

defines matrix transformer power variables for the unbalanced branch flow models

source
PowerModelsDistribution.variable_mc_transformer_powerMethod

Creates variables for both active and reactive power flow at each transformer.

source
PowerModelsDistribution.variable_mc_transformer_powerMethod

Creates variables for both active and reactive power flow at each transformer.

source
PowerModelsDistribution.variable_mc_transformer_powerMethod

Creates variables for both active and reactive power flow at each transformer.

source
PowerModelsDistribution.variable_mc_transformer_power_imaginaryMethod

apo models ignore reactive power flows

source
PowerModelsDistribution.variable_mc_transformer_power_imaginaryMethod

Create variables for the reactive power flowing into all transformer windings.

source
PowerModelsDistribution.variable_mc_transformer_power_imaginaryMethod
function variable_mc_transformer_power_imaginary(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates transformer reactive power variables :qt for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_transformer_power_realMethod

Create variables for the active power flowing into all transformer windings.

source
PowerModelsDistribution.variable_mc_transformer_power_realMethod
function variable_mc_transformer_power_real(
+)

Creates transformer reactive power variables :qt for models with explicit neutrals

source
PowerModelsDistribution.variable_mc_transformer_power_realMethod

Create variables for the active power flowing into all transformer windings.

source
PowerModelsDistribution.variable_mc_transformer_power_realMethod
function variable_mc_transformer_power_real(
 	pm::ExplicitNeutralModels;
 	nw::Int=nw_id_default,
 	bounded::Bool=true,
 	report::Bool=true
-)

Creates transformer active power variables :pt for models with explicit neutrals

source
PowerModelsDistribution.variable_mx_complexMethod
variable_mx_complex(
+)

Creates transformer active power variables :pt for models with explicit neutrals

source
PowerModelsDistribution.variable_mx_complexMethod
variable_mx_complex(
     model::JuMP.Model,
     indices::Array{T,1},
     N::Dict{T,Vector{Int}},
@@ -204,7 +204,7 @@
     symm_bound::Union{Missing, Dict{T,<:Matrix{<:Real}}}=missing,
     name::Union{String, Tuple{String,String}}="",
     prefix::String=""
-)::Tuple where T

Shorthand to create two real matrix variables, where the first is the real part and the second the imaginary part.

If the name argument is a String, it will be suffixed with 're' and 'im'. It is possible to specify the names of the real and imaginary part directly as a Tuple as well (to achieve P and Q instead of Sre and Sim for example).

source
PowerModelsDistribution.variable_mx_complex_with_diagMethod
variable_mx_complex_with_diag(
+)::Tuple where T

Shorthand to create two real matrix variables, where the first is the real part and the second the imaginary part.

If the name argument is a String, it will be suffixed with 're' and 'im'. It is possible to specify the names of the real and imaginary part directly as a Tuple as well (to achieve P and Q instead of Sre and Sim for example).

source
PowerModelsDistribution.variable_mx_complex_with_diagMethod
variable_mx_complex_with_diag(
     model::JuMP.Model,
     indices::Array{T,1},
     N::Dict{T,Vector{Int}};
@@ -215,7 +215,7 @@
     diag_im::Dict{T,<:Vector{<:Any}}=Dict([(i, zeros(length(N[i]))) for i in indices]),
     name::Union{String, Tuple{String,String}}="",
     prefix::String=""
-)::Tuple where T

Same as variable_mx_complex, but square and the diagonal of the matrix variables consists of the constants passed as the diagre and diagim argument. The diag argument is a dictionary of (index, 1d-array) pairs.

Useful for power matrices with specified diagonals (constant power wye loads).

source
PowerModelsDistribution.variable_mx_hermitianMethod
variable_mx_hermitian(
+)::Tuple where T

Same as variable_mx_complex, but square and the diagonal of the matrix variables consists of the constants passed as the diagre and diagim argument. The diag argument is a dictionary of (index, 1d-array) pairs.

Useful for power matrices with specified diagonals (constant power wye loads).

source
PowerModelsDistribution.variable_mx_hermitianMethod
variable_mx_hermitian(
     model::JuMP.Model,
     indices::Array{T,1},
     N::Dict{T,Vector{Int}};
@@ -228,7 +228,7 @@
     imag_set_diag_to_zero::Bool=true,
     name::Union{String,Tuple{String,String}}="",
     prefix::String=""
-)::Tuple where T

Returns a pair of symmetric and skew-symmetric matrix variables.

source
PowerModelsDistribution.variable_mx_realMethod
variable_mx_real(
+)::Tuple where T

Returns a pair of symmetric and skew-symmetric matrix variables.

source
PowerModelsDistribution.variable_mx_realMethod
variable_mx_real(
     model::JuMP.Model,
     indices::Array{T,1},
     N::Dict{T,Vector{Int}},
@@ -237,7 +237,7 @@
     lower_bound::Union{Missing, Dict{T,<:Matrix{<:Real}}}=missing,
     name::String="",
     prefix::String=""
-) where T

This function creates a set of real matrix variables of size NxM, indexed over the elements of the indices argument. The upper and lower bounds have to be specified, and are dictionaries with the indices as keys and the matrix bounds as values. The name and prefix arguments will be combined into the base_name argument for JuMP; the prefix will typically be the network number nw. Instead of sequentially creating the matrix variables, the elements of the matrices are created sequentially for all matrices at once. I.e., we loop over the elements, and not over the indices. This is needed so that the variable names printed by JuMP are in line with the current design.

Returns a dictionary of (index, matrix variable) pairs

source
PowerModelsDistribution.variable_mx_real_skewsymmetricMethod
variable_mx_real_skewsymmetric(
+) where T

This function creates a set of real matrix variables of size NxM, indexed over the elements of the indices argument. The upper and lower bounds have to be specified, and are dictionaries with the indices as keys and the matrix bounds as values. The name and prefix arguments will be combined into the base_name argument for JuMP; the prefix will typically be the network number nw. Instead of sequentially creating the matrix variables, the elements of the matrices are created sequentially for all matrices at once. I.e., we loop over the elements, and not over the indices. This is needed so that the variable names printed by JuMP are in line with the current design.

Returns a dictionary of (index, matrix variable) pairs

source
PowerModelsDistribution.variable_mx_real_skewsymmetricMethod
variable_mx_real_skewsymmetric(
     model::JuMP.Model,
     indices::Array{T,1},
     N::Dict{T,Vector{Int}};
@@ -246,7 +246,7 @@
     set_diag_to_zero::Bool=true,
     name::String="",
     prefix::String=""
-)::Dict where T

Same as variable_mx_real, but adds skew-symmetry structure.

source
PowerModelsDistribution.variable_mx_real_symmetricMethod
variable_mx_real_symmetric(
+)::Dict where T

Same as variable_mx_real, but adds skew-symmetry structure.

source
PowerModelsDistribution.variable_mx_real_symmetricMethod
variable_mx_real_symmetric(
     model::JuMP.Model,
     indices::Array{T,1},
     N::Dict{T,Vector{Int}};
@@ -254,7 +254,7 @@
     lower_bound::Union{Missing, Dict{T,<:Matrix{<:Real}}}=missing,
     name::String="",
     prefix::String=""
-)::Dict where T

Same as variable_mx_real, but adds symmetry structure

source
PowerModelsDistribution.variable_mx_real_with_diagMethod
variable_mx_real_with_diag(
+)::Dict where T

Same as variable_mx_real, but adds symmetry structure

source
PowerModelsDistribution.variable_mx_real_with_diagMethod
variable_mx_real_with_diag(
     model::JuMP.Model,
     indices::Array{T,1},
     N::Dict{T,Vector{Int}};
@@ -263,4 +263,4 @@
     diag::Dict{T,<:Vector{<:Any}}=Dict([(i, fill(0, length(N[i]))) for i in indices]),
     name::String="",
     prefix::String=""
-) where T

Same as variable_mx_real, but has to be square and the diagonal of the matrix variables consists of the elements passed as the diag argument. The diag argument is a dictionary of (index, 1d-array) pairs. Useful for power matrices with specified diagonals (constant power wye loads). If not specified, the diagonal elements are set to zero.

source
PowerModelsDistribution.variable_storage_chargeMethod
source
PowerModelsDistribution.variable_storage_complementary_indicatorMethod
source
PowerModelsDistribution.variable_storage_dischargeMethod
source
PowerModelsDistribution.variable_storage_energyMethod
source
+) where T

Same as variable_mx_real, but has to be square and the diagonal of the matrix variables consists of the elements passed as the diag argument. The diag argument is a dictionary of (index, 1d-array) pairs. Useful for power matrices with specified diagonals (constant power wye loads). If not specified, the diagonal elements are set to zero.

source
PowerModelsDistribution.variable_storage_chargeMethod
source
PowerModelsDistribution.variable_storage_complementary_indicatorMethod
source
PowerModelsDistribution.variable_storage_dischargeMethod
source
PowerModelsDistribution.variable_storage_energyMethod
source
diff --git a/dev/search.html b/dev/search.html index 9431f07da..926bb52af 100644 --- a/dev/search.html +++ b/dev/search.html @@ -1,2 +1,2 @@ -Search · PowerModelsDistribution

Loading search...

    +Search · PowerModelsDistribution

    Loading search...

      diff --git a/dev/tutorials/Beginners Guide.html b/dev/tutorials/Beginners Guide.html index a026bcebe..e72135528 100644 --- a/dev/tutorials/Beginners Guide.html +++ b/dev/tutorials/Beginners Guide.html @@ -352,8 +352,8 @@ Documenter.jl version 0.27.25 on - - Thursday 4 April 2024 + + Thursday 25 April 2024 . Using Julia version 1.10.2.

      diff --git a/dev/tutorials/Beginners Guide.jl.html b/dev/tutorials/Beginners Guide.jl.html index 2cd65f00c..2b6f3fe22 100644 --- a/dev/tutorials/Beginners Guide.jl.html +++ b/dev/tutorials/Beginners Guide.jl.html @@ -1,15 +1,17 @@ - -
      \ No newline at end of file + + +
      \ No newline at end of file diff --git a/dev/tutorials/Engineering Model - Helper Functions.html b/dev/tutorials/Engineering Model - Helper Functions.html index d4b8e4c1f..33f4e6050 100644 --- a/dev/tutorials/Engineering Model - Helper Functions.html +++ b/dev/tutorials/Engineering Model - Helper Functions.html @@ -352,8 +352,8 @@ Documenter.jl version 0.27.25 on - - Thursday 4 April 2024 + + Thursday 25 April 2024 . Using Julia version 1.10.2.

      diff --git a/dev/tutorials/Engineering Model - Helper Functions.jl.html b/dev/tutorials/Engineering Model - Helper Functions.jl.html index 70049f219..8ac393a07 100644 --- a/dev/tutorials/Engineering Model - Helper Functions.jl.html +++ b/dev/tutorials/Engineering Model - Helper Functions.jl.html @@ -1,15 +1,17 @@ - -
      \ No newline at end of file + + +
      \ No newline at end of file diff --git a/dev/tutorials/Explicit Neutral Models.html b/dev/tutorials/Explicit Neutral Models.html index 80b6ed161..b7623fc70 100644 --- a/dev/tutorials/Explicit Neutral Models.html +++ b/dev/tutorials/Explicit Neutral Models.html @@ -352,8 +352,8 @@ Documenter.jl version 0.27.25 on - - Thursday 4 April 2024 + + Thursday 25 April 2024 . Using Julia version 1.10.2.

      diff --git a/dev/tutorials/Explicit Neutral Models.jl.html b/dev/tutorials/Explicit Neutral Models.jl.html index ba03b9b0d..8be33f7d7 100644 --- a/dev/tutorials/Explicit Neutral Models.jl.html +++ b/dev/tutorials/Explicit Neutral Models.jl.html @@ -1,15 +1,17 @@ - -
      \ No newline at end of file + + +
      \ No newline at end of file diff --git a/dev/tutorials/Extension Tutorial.html b/dev/tutorials/Extension Tutorial.html index 3bfd83549..bc308e51c 100644 --- a/dev/tutorials/Extension Tutorial.html +++ b/dev/tutorials/Extension Tutorial.html @@ -352,8 +352,8 @@ Documenter.jl version 0.27.25 on - - Thursday 4 April 2024 + + Thursday 25 April 2024 . Using Julia version 1.10.2.

      diff --git a/dev/tutorials/Extension Tutorial.jl.html b/dev/tutorials/Extension Tutorial.jl.html index 11d5a45f5..21082f996 100644 --- a/dev/tutorials/Extension Tutorial.jl.html +++ b/dev/tutorials/Extension Tutorial.jl.html @@ -1,15 +1,17 @@ - -
      \ No newline at end of file + + +
      \ No newline at end of file diff --git a/dev/tutorials/Native Power Flow.html b/dev/tutorials/Native Power Flow.html index e6a209f03..a23a513ea 100644 --- a/dev/tutorials/Native Power Flow.html +++ b/dev/tutorials/Native Power Flow.html @@ -352,8 +352,8 @@ Documenter.jl version 0.27.25 on - - Thursday 4 April 2024 + + Thursday 25 April 2024 . Using Julia version 1.10.2.

      diff --git a/dev/tutorials/Native Power Flow.jl.html b/dev/tutorials/Native Power Flow.jl.html index ed1b53735..6200c179e 100644 --- a/dev/tutorials/Native Power Flow.jl.html +++ b/dev/tutorials/Native Power Flow.jl.html @@ -1,15 +1,17 @@ - -
      \ No newline at end of file + + +
      \ No newline at end of file diff --git a/dev/tutorials/The Engineering Model.html b/dev/tutorials/The Engineering Model.html index 8b25a71f8..03c1ad504 100644 --- a/dev/tutorials/The Engineering Model.html +++ b/dev/tutorials/The Engineering Model.html @@ -352,8 +352,8 @@ Documenter.jl version 0.27.25 on - - Thursday 4 April 2024 + + Thursday 25 April 2024 . Using Julia version 1.10.2.

      diff --git a/dev/tutorials/The Engineering Model.jl.html b/dev/tutorials/The Engineering Model.jl.html index 3422a0a79..baee0b6f5 100644 --- a/dev/tutorials/The Engineering Model.jl.html +++ b/dev/tutorials/The Engineering Model.jl.html @@ -1,15 +1,17 @@ - -
      \ No newline at end of file + + +
      \ No newline at end of file diff --git a/dev/tutorials/basic.html b/dev/tutorials/basic.html index 400f07a28..093fb6c4b 100644 --- a/dev/tutorials/basic.html +++ b/dev/tutorials/basic.html @@ -352,8 +352,8 @@ Documenter.jl version 0.27.25 on - - Thursday 4 April 2024 + + Thursday 25 April 2024 . Using Julia version 1.10.2.

      diff --git a/dev/tutorials/basic.jl.html b/dev/tutorials/basic.jl.html index 8f1735524..c7df16b84 100644 --- a/dev/tutorials/basic.jl.html +++ b/dev/tutorials/basic.jl.html @@ -1,15 +1,17 @@ - -
      \ No newline at end of file + + +
      \ No newline at end of file