Modeling Components

ThreePhasePowerModels.jl Library

LinDist3Flow per Sankur et al 2016, using vector variables for power, voltage and current in scalar form

source
source

default Lin3Distflow constructor for scalar form

source

LinDist3Flow per Sankur et al 2016, using vector variables for power, voltage and current

source
source

default LP unbalanced DistFlow constructor

source

Simplified BFM per Gan and Low 2014, PSCC, using matrix variables for power, voltage and current

source
source

default LP unbalanced DistFlow constructor

source

SDP BFM per Gan and Low 2014, PSCC

source
source

default SDP unbalanced DistFlow constructor

source

SOC relaxation of SDPUBFForm per Kim, Kojima, & Yamashita 2003, cast as a SOC

source
source

default SOC unbalanced DistFlow constructor

source

SOC relaxation of SDPUBFForm per Kim, Kojima, & Yamashita 2003, cast as an QCP

source
source

default SOC unbalanced DistFlow constructor

source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source
source

Abstract form for linear unbalanced power flow models

source
source

Structure representing OpenDSS dss_source_id giving the type of the component dss_type, its name dss_name, and the active phases active_phases

source
source

Adds arcs for TPPM transformers; for dclines and branches this is done in PMs

source
source
source
source
source
add_component!(dss_data, ctype_name, compDict)

Adds a component of type ctype_name with properties given by compDict to the existing dss_data structure. If a component of the same type has already been added to dss_data, the new component is appeneded to the existing array of components of that type, otherwise a new array is created.

source
source
add_property(compDict, key, value)

Adds a property to an existing component properties dictionary compDict given the key and value of the property. If a property of the same name already exists inside compDict, the original value is converted to an array, and the new value is appended to the end.

source

adds voltage balance indicators; should only be called after addsetpointbus_voltage!

source

Helper function to add a new shunt. The shunt element is always inserted at the internal bus of the second winding in OpenDSS. If one of the branches of the loss model connected to this bus, has zero impedance (for example, if XHL==0 or XLT==0 or R[3]==0), then this bus might be removed by rmredundantpd_elements!, in which case a new shunt should be inserted at the remaining bus of the removed branch.

source
function adjust_base!(tppm_data)

Updates the voltage base at each bus, so that the ratios of the voltage bases across a transformer are consistent with the ratios of voltage ratings of the windings. Default behaviour is to start at the primary winding of the first transformer, and to propagate from there. Branches are updated; the impedances and addmittances are rescaled to be consistent with the new voltage bases.

source

Rescales the parameters of a branch to reflect a change in voltage base.

source

This is the recursive code that goes with adjustbase!; adjustbase! initializes arrays and other data that is passed along in the calls to this recursive function. For very large networks, this might have to be rewritten to not rely on recursion.

source

Rescales the parameters of a shunt to reflect a change in voltage base.

source
adjust_sourcegen_bounds!(tppm_data)

Changes the bounds for the sourcebus generator by checking the emergamps of all of the branches attached to the sourcebus and taking the sum of non-infinite values. Defaults to Inf if all emergamps connected to sourcebus are also Inf. This method was updated to include connected transformers as well. It know has to occur after the call to InfrastructureModels.arraystodicts, so the code was adjusted to accomodate that.

source
assign_property!(dss_data, cType, cName, propName, propValue)

Assigns a property with name propName and value propValue to the component of type cType named cName in dss_data.

source
source
check_duplicate_components!(dss_data)

Finds duplicate components in dss_data and merges up, meaning that older data (lower indices) is always overwritten by newer data (higher indices).

source
source

Defines branch flow model power flow equations

source
source
source
source
source

KCL including transformer arcs.

source
source
source
source

KCL including transformer arcs and load variables.

source
source
source
source

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

p[f_idx] ==  (g+g_fr)/tm*v[f_bus]^2 + (-g*tr+b*ti)/tm*(v[f_bus]*v[t_bus]*cos(t[f_bus]-t[t_bus])) + (-b*tr-g*ti)/tm*(v[f_bus]*v[t_bus]*sin(t[f_bus]-t[t_bus]))
q[f_idx] == -(b+b_fr)/tm*v[f_bus]^2 - (-b*tr-g*ti)/tm*(v[f_bus]*v[t_bus]*cos(t[f_bus]-t[t_bus])) + (-g*tr+b*ti)/tm*(v[f_bus]*v[t_bus]*sin(t[f_bus]-t[t_bus]))
source

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

p_fr =  g_fr[c]*(vr_fr[c]^2+vi_fr[c]^2)+ sum(
                                     vr_fr[c]*(g[c,d]*(vr_fr[d]-vr_to[d])-b[c,d]*(vi_fr[d]-vi_to[d]))
                                    -vi_fr[c]*(-b[c,d]*(vr_fr[d]-vr_to[d])-g[c,d]*(vi_fr[d]-vi_to[d]))
                                for d in PMs.conductor_ids(pm))
q_fr =  -b_fr[c]*(vr_fr[c]^2+vi_fr[c]^2)+ sum(
                                        -vr_fr[c]*(b[c,d]*(vr_fr[d]-vr_to[d])+g[c,d]*(vi_fr[d]-vi_to[d]))
                                        +vi_fr[c]*(g[c,d]*(vr_fr[d]-vr_to[d])-b[c,d]*(vi_fr[d]-vi_to[d]))
                                    for d in PMs.conductor_ids(pm))
source

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

p[f_idx] == -b*(t[f_bus] - t[t_bus])
source

nothing to do, no voltage angle variables

source

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

source
source
p[f_idx] == z*(g/tm*v[f_bus]^2 + (-g*tr+b*ti)/tm*(v[f_bus]*v[t_bus]*cos(t[f_bus]-t[t_bus])) + (-b*tr-g*ti)/tm*(v[f_bus]*v[t_bus]*sin(t[f_bus]-t[t_bus])))
q[f_idx] == z*(-(b+c/2)/tm*v[f_bus]^2 - (-b*tr-g*ti)/tm*(v[f_bus]*v[t_bus]*cos(t[f_bus]-t[t_bus])) + (-g*tr+b*ti)/tm*(v[f_bus]*v[t_bus]*sin(t[f_bus]-t[t_bus])))
source

-b*(t[f_bus] - t[t_bus] + vad_min*(1-branch_z[i])) <= p[f_idx] <= -b*(t[f_bus] - t[t_bus] + vad_max*(1-branch_z[i]))

source

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

p[f_idx] ==        g/tm*w_fr[i] + (-g*tr+b*ti)/tm*(wr[i]) + (-b*tr-g*ti)/tm*(wi[i])
q[f_idx] == -(b+c/2)/tm*w_fr[i] - (-b*tr-g*ti)/tm*(wr[i]) + (-g*tr+b*ti)/tm*(wi[i])
source
source

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

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

Do nothing, this model is symmetric

source

nothing to do, this model is symmetric

source

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

source
source
p[t_idx] == z*(g*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] == z*(-(b+c/2)*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

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

p[t_idx] ==        g*w_to[i] + (-g*tr-b*ti)/tm*(wr[i]) + (-b*tr+g*ti)/tm*(-wi[i])
q[t_idx] == -(b+c/2)*w_to[i] - (-b*tr+g*ti)/tm*(wr[i]) + (-g*tr-b*ti)/tm*(-wi[i])
source

Do nothing, this model is symmetric

source

Defines relationship between branch (series) power flow, branch (series) current and node voltage magnitude

source

Defines relationship between branch (series) power flow, branch (series) current and node voltage magnitude

source

Defines relationship between branch (series) power flow, branch (series) current and node voltage magnitude

source

Defines relationship between branch (series) power flow, branch (series) current and node voltage magnitude

source

Defines branch flow model power flow loss equations

source

Defines branch flow model power flow equations

source

Defines branch flow model power flow equations

source

Defines branch flow model power flow equations

source

CONSTANT POWER Fixes the load power sd. sd = [sd1, sd2, sd3] 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. sd1 = va.conj(ia) = 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 sd1 = vab.conj(iab) = (va-vb).conj(iab) We can relate this to the per-phase power by sna = va.conj(ia) = va.conj(iab-ica) = va.conj(conj(sab/vab) - conj(sca/vca)) = va.(sab/(va-vb) - sca/(vc-va)) So for delta, sn is constrained indirectly.

source

We want to express sab = cp.|vab|+im.cq.|vab| iab = conj(sab/vab) = |vab|.(cq-im.cq)/conj(vab) = (1/|vab|).(cp-im.cq)*vab idem for ibc and ica And then sa = va.conj(ia) = va.conj(iab-ica) idem for sb and sc

source

We want to express sab = cp.|vab|+im.cq.|vab| iab = conj(sab/vab) = |vab|.(cq-im.cq)/conj(vab) = (1/|vab|).(cp-im.cq)*vab idem for ibc and ica And then sa = va.conj(ia) = va.conj(iab-ica) idem for sb and sc

source

We want to express sab = cp.|vab|^2+im.cq.|vab|^2 iab = conj(sab/vab) = |vab|^2.(cq-im.cq)/conj(vab) = (cp-im.cq)*vab idem for ibc and ica And then sa = va.conj(ia) = va.conj(iab-ica) idem for sb and s_c

source

We want to express sab = cp.|vab|^2+im.cq.|vab|^2 iab = conj(sab/vab) = |vab|^2.(cq-im.cq)/conj(vab) = (cp-im.cq)*vab idem for ibc and ica And then sa = va.conj(ia) = va.conj(iab-ica) idem for sb and s_c

source

For a delta load, sd = (sab, sbc, sca), but we want to fix s = (sa, sb, sc) s is a non-linear transform of v and sd, s=f(v,sd) sa = vaconj(sab/(va-vb) - sca/(vc-va)) sb = vbconj(sab/(va-vb) - sca/(vc-va)) sc = vc*conj(sab/(va-vb) - sca/(vc-va))

source

For a delta load, sd = (sab, sbc, sca), but we want to fix s = (sa, sb, sc) s is a non-linear transform of v and sd, s=f(v,sd) sa = vaconj(sab/(va-vb) - sca/(vc-va)) sb = vbconj(sab/(va-vb) - sca/(vc-va)) sc = vc*conj(sab/(va-vb) - sca/(vc-va))

source

Links the power flowing into both windings of a variable tap transformer.

source

For a variable tap transformer, fix the tap variables which are fixed. For example, an OLTC where the third phase is fixed, will have tap variables for all phases, but the third tap variable should be fixed.

source

Links the voltage at both windings of a variable tap transformer.

source
source
source
source

Creates phase angle constraints at reference buses

source

nothing to do, no voltage angle variables

source

Creates phase angle constraints at reference buses

source

do nothing, no way to represent this in these variables

source
source

Links the power flowing into both windings of a fixed tap transformer.

source

nothing to do, this model is symmetric

source

Links the power flowing into both windings of a variable tap transformer.

source

Links the voltage at both windings of a fixed tap transformer.

source

nothing to do, no voltage variables

source
source

a = exp(im2π/3) U+ = (1Ua + aUb a^2Uc)/3 U- = (1Ua + a^2Ub aUc)/3 vuf = |U-|/|U+| |U-| <= vufmax|U+| |U-|^2 <= vufmax^2*|U+|^2

source

a = exp(im2π/3) U+ = (1Ua + aUb a^2Uc)/3 U- = (1Ua + a^2Ub aUc)/3 vuf = |U-|/|U+| |U-| <= vufmax|U+| |U-|^2 <= vufmax^2*|U+|^2

source

a = exp(im2π/3) U+ = (1Ua + aUb a^2Uc)/3 U- = (1Ua + a^2Ub aUc)/3 vuf = |U-|/|U+| |U-| <= vufmax|U+| |U-|^2 <= vufmax^2*|U+|^2

source

a = exp(im2π/3) U+ = (1Ua + aUb a^2Uc)/3 U- = (1Ua + a^2Ub aUc)/3 vuf = |U-|/|U+| |U-| <= vufmax|U+| |U-|^2 <= vufmax^2*|U+|^2

source

delegate back to PowerModels by default

source
source

nothing to do, these models do not have complex voltage constraints

source
source

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

Defines branch flow model power flow equations

source

Defines voltage drop over a branch, linking from and to side voltage

source

Defines voltage drop over a branch, linking from and to side voltage

source

Defines voltage drop over a branch, linking from and to side voltage

source
source

Defines voltage drop over a branch, linking from and to side voltage magnitude

source
createCapacitor(bus1, name, bus2=0; kwargs)

Creates a Dict{String,Any} containing all of the expected properties for a Capacitor. If bus2 is not specified, the capacitor will be treated as a shunt. See OpenDSS documentation for valid fields and ways to specify the different properties.

source
createGenerator(bus1, name; kwargs...)

Creates a Dict{String,Any} containing all of the expected properties for a Generator. See OpenDSS documentation for valid fields and ways to specify the different properties.

source
createLine(bus1, bus2, name; kwargs...)

Creates a Dict{String,Any} containing all of the properties for a Line. See OpenDSS documentation for valid fields and ways to specify the different properties.

source
createLinecode(name; kwargs...)

Creates a Dict{String,Any} containing all of the properties of a Linecode. See OpenDSS documentation for valid fields and ways to specify the different properties. DEPRECIATED: Calculation all done inside of createLine() due to Rg, Xg. Merge linecode values into line kwargs values BEFORE calling createLine(). This is now mainly used for parsing linecode dicts into correct data types.

source
createLoad(bus1, name; kwargs...)

Creates a Dict{String,Any} containing all of the expected properties for a Load. See OpenDSS documentation for valid fields and ways to specify the different properties.

source
createPVSystem(bus1, name; kwargs...)

Creates a Dict{String,Any} containing all of the expected properties for a PVSystem. See OpenDSS document https://github.com/tshort/OpenDSS/blob/master/Doc/OpenDSS%20PVSystem%20Model.doc for valid fields and ways to specify the different properties.

source
createReactor(bus1, name, bus2=0; kwargs...)

Creates a Dict{String,Any} containing all of the expected properties for a Reactor. If bus2 is not specified Reactor is treated like a shunt. See OpenDSS documentation for valid fields and ways to specify the different properties.

source
createStorage(bus1, name; kwargs...)

Creates a Dict{String,Any} containing all expected properties for a storage element. See OpenDSS documentation for valid fields and ways to specify the different properties.

source
createTransformer(name; kwargs...)

Creates a Dict{String,Any} containing all of the expected properties for a Transformer. See OpenDSS documentation for valid fields and ways to specify the different properties.

source
createVSource(bus1, name, bus2=0; kwargs...)

Creates a Dict{String,Any} containing all of the expected properties for a Voltage Source. If bus2 is not specified, VSource will be treated like a generator. Mostly used as sourcebus which represents the circuit. See OpenDSS documentation for valid fields and ways to specify the different properties.

source

creates a starbus from a 3-winding transformer

source

This function adds a new branch to the data model and returns its dictionary. It is virtual in the sense that it does not correspond to a branch in the network, but is part of the decomposition of the transformer.

source

This function adds a new bus to the data model and returns its dictionary. It is virtual in the sense that it does not correspond to a bus in the network, but is part of the decomposition of the transformer.

source
function decompose_transformers!(tppm_data)

Replaces complex transformers with a composition of ideal transformers and branches which model losses. New buses (virtual, no physical meaning) are added.

source
discover_buses(dss_data)

Discovers all of the buses (not separately defined in OpenDSS), from "lines".

source
dss2tppm_branch!(tppm_data, dss_data)

Adds PowerModels-style branches to tppm_data from dss_data.

source
dss2tppm_bus!(tppm_data, dss_data)

Adds PowerModels-style buses to tppm_data from dss_data.

source
dss2tppm_gen!(tppm_data, dss_data)

Adds PowerModels-style generators to tppm_data from dss_data.

source
dss2tppm_load!(tppm_data, dss_data)

Adds PowerModels-style loads to tppm_data from dss_data.

source

dss2tppmpvsystem!(tppmdata, dss_data)

Adds PowerModels-style pvsystems to tppm_data from dss_data.

source
dss2tppm_shunt!(tppm_data, dss_data)

Adds PowerModels-style shunts to tppm_data from dss_data.

source
dss2tppm_transformer!(tppm_data, dss_data, import_all)

Adds PowerModels-style transformers (branches) to tppm_data from dss_data.

source
find_bus(busname, tppm_data)

Finds the index number of the bus in existing data from the given busname.

source
find_component(tppm_data, name, compType)

Returns the component of compType with name from data of type Dict{String,Array}.

source
get_conductors_ordered(busname)

Returns an ordered list of defined conductors.

source

Returns a Dict{String,Type} for the desired component comp, giving all of the expected data types

source

returns the linecode with name id

source
source
get_prop_name(ctype, i)

Returns the ith property name for a given component type ctype.

source
get_prop_name(ctype)

Returns the property names in order for a given component type ctype.

source
source

checks if data is an opendss-style array string

source

checks is a string is a connection by checking the values

source

checks if data is an opendss-style matrix string

source

detects if expr is Reverse Polish Notation expression

source

collects several fromkeys in an array and sets it to the tokey, removes from_keys

source

Converts a Matlab dict into a ThreePhasePowerModels dict

source
merge_dss!(dss_prime, dss_to_add)

Merges two (partially) parsed OpenDSS files to the same dictionary dss_prime. Used in cases where files are referenced via the "compile" or "redirect" OpenDSS commands inside the originating file.

source

convert raw branch data into arrays

source

convert raw bus data into arrays

source

convert raw generator data into arrays

source

convert raw load data into arrays

source

convert raw shunt data into arrays

source

a quadratic penalty for bus power slack variables

source

parse matrices according to active nodes

source
parse_array(dtype, data)

Parses a OpenDSS style array string data into a one dimensional array of type dtype. Array strings are capped by either brackets, single quotes, or double quotes, and elements are separated by spaces.

source
parse_buscoords(file)

Parses a Bus Coordinate file, in either "dat" or "csv" formats, where in "dat", columns are separated by spaces, and in "csv" by commas. File expected to contain "bus,x,y" on each line.

source
parse_busname(busname)

Parses busnames as defined in OpenDSS, e.g. "primary.1.2.3.0".

source
parse_component(component, properies, compDict=Dict{String,Any}())

Parses a component with properties into a compDict. If compDict is not defined, an empty dictionary will be used. Assumes that unnamed properties are given in order, but named properties can be given anywhere.

source

parses connection "conn" specification reducing to wye or delta

source
source
parse_dss(filename)

Parses a OpenDSS file given by filename into a Dict{Array{Dict}}. Only supports components and options, but not commands, e.g. "plot" or "solve". Will also parse files defined inside of the originating DSS file via the "compile", "redirect" or "buscoords" commands.

source

Parses a component's OpenDSS source information into the dss_source_id struct

source
parse_dss_with_dtypes!(dss_data, toParse)

Parses the data in keys defined by toParse in dss_data using types given by the default properties from the get_prop_default function.

source

parses the raw dss values into their expected data types

source
parse_file(io)

Parses the IOStream of a file into a Three-Phase PowerModels data structure.

source
source
parse_line(elements, curCompDict=Dict{String,Any}())

Parses an already separated line given by elements (an array) of an OpenDSS file into curCompDict. If not defined, curCompDict is an empty dictionary.

source
source
source
source
parse_matrix(dtype, data)

Parses a OpenDSS style triangular matrix string data into a two dimensional array of type dtype. Matrix strings are capped by either parenthesis or brackets, rows are separated by "|", and columns are separated by spaces.

source

parse matrices according to active nodes

source

Parses a Dict resulting from the parsing of a DSS file into a PowerModels usable format.

source

Parses a DSS file into a PowerModels usable format.

source
parse_options(options)

Parses options defined with the set command in OpenDSS.

source
parse_properties(properties)

Parses a string of properties of a component type, character by character into an array with each element containing (if present) the property name, "=", and the property value.

source

parses Reverse Polish Notation expr

source
source
source
source
source

This problem specification includes advanced load models, including constant power, constant current and constabt impedance delta-connected and wye-connected

source
source
source
source
source
source
source
source
source

This function appends a component to a component dictionary of a tppm data model.

source

real-valued SDP to SDP relaxation based on PSDness of principal minors, default is 3x3 SDP relaxation

source

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

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},
journal = {Optimization Methods and Software},
number = {5},
pages = {535--541},
volume = {18},
year = {2003}
}
source

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},
journal = {Optimization Methods and Software},
number = {5},
pages = {535--541},
volume = {18},
year = {2003}
}
source

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

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},
journal = {Optimization Methods and Software},
number = {5},
pages = {535--541},
volume = {18},
year = {2003}
}
source

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},
journal = {Optimization Methods and Software},
number = {5},
pages = {535--541},
volume = {18},
year = {2003}
}
source

This function removes zero impedance branches. Only for transformer loss model! Branches with zero impedances are deleted, and one of the buses it connects. For now, the implementation should only be used on the loss model of transformers. When deleting buses, references at shunts, loads... should be updated accordingly. In the current implementation, that is only done for shunts. The other elements, such as loads, do not appear in the transformer loss model.

source

rolls a 1d array left or right by idx

source
source
source

multi-network opf with storage

source

opf with storage

source

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

checks if the given dict has a value, if not, sets a default value

source
source

Squares x, for parsing Reverse Polish Notation

source

Strips comments, defined by "!" from the ends of lines

source

strips lines that are either commented (block or single) or empty

source

converts Dict{String,Any} to Dict{Symbol,Any} for passing as kwargs

source

Translates legacy versions into current version format

source
source

generates variables for both active and reactive slack at each bus

source

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

variable: p_lt[l,i,j] for (l,i,j) in arcs

source

variable: q_lt[l,i,j] for (l,i,j) in arcs

source
source
source
source
source
source

Create tap variables.

source

variables for modeling storage units, includes grid injection and internal variables

source

Create variables for the active power flowing into all transformer windings.

source

Create variables for the active power flowing into all transformer windings.

source

Creates variables for both active and reactive power flow at each transformer.

source

Create variables for the reactive power flowing into all transformer windings.

source

do nothing, no reactive power in this model

source
source
source
source
source

variable: w[i] >= 0 for i in buses

source
source
source
source

variable: p_ut[l,i,j] for (l,i,j) in arcs

source

variable: q_ut[l,i,j] for (l,i,j) in arcs

source
where_is_comp(data, comp_id)

Finds existing component of id comp_id in array of data and returns index. Assumes all components in data are unique.

source