ThreePhasePowerModels.jl Library
LinDist3Flow per Sankur et al 2016, using vector variables for power, voltage and current in scalar form
ThreePhasePowerModels.LPLinUBFPowerModel
— Method.default Lin3Distflow constructor for scalar form
LinDist3Flow per Sankur et al 2016, using vector variables for power, voltage and current
default LP unbalanced DistFlow constructor
Simplified BFM per Gan and Low 2014, PSCC, using matrix variables for power, voltage and current
default LP unbalanced DistFlow constructor
ThreePhasePowerModels.SDPUBFForm
— Type.SDP BFM per Gan and Low 2014, PSCC
ThreePhasePowerModels.SDPUBFPowerModel
— Method.default SDP unbalanced DistFlow constructor
SOC relaxation of SDPUBFForm per Kim, Kojima, & Yamashita 2003, cast as a SOC
default SOC unbalanced DistFlow constructor
SOC relaxation of SDPUBFForm per Kim, Kojima, & Yamashita 2003, cast as an QCP
default SOC unbalanced DistFlow constructor
ThreePhasePowerModels.run_ac_tp_opf
— Method.ThreePhasePowerModels.run_ac_tp_opf_lm
— Method.ThreePhasePowerModels.run_ac_tp_opf_oltc
— Method.ThreePhasePowerModels.run_ac_tp_pf
— Method.ThreePhasePowerModels.run_ac_tp_pf_lm
— Method.ThreePhasePowerModels.run_tp_opf
— Method.ThreePhasePowerModels.run_tp_opf
— Method.ThreePhasePowerModels.run_tp_opf_bctr
— Method.ThreePhasePowerModels.run_tp_opf_bctr
— Method.ThreePhasePowerModels.run_tp_opf_bf
— Method.ThreePhasePowerModels.run_tp_opf_bf
— Method.ThreePhasePowerModels.run_tp_opf_lm
— Method.ThreePhasePowerModels.run_tp_opf_lm
— Method.ThreePhasePowerModels.run_tp_opf_oltc
— Method.ThreePhasePowerModels.run_tp_opf_oltc
— Method.ThreePhasePowerModels.run_tp_opf_pbs
— Method.ThreePhasePowerModels.run_tp_opf_pbs
— Method.ThreePhasePowerModels.run_tp_ots
— Method.ThreePhasePowerModels.run_tp_ots
— Method.ThreePhasePowerModels.run_tp_pf
— Method.ThreePhasePowerModels.run_tp_pf
— Method.ThreePhasePowerModels.run_tp_pf_bf
— Method.ThreePhasePowerModels.run_tp_pf_bf
— Method.ThreePhasePowerModels.run_tp_pf_lm
— Method.ThreePhasePowerModels.run_tp_pf_lm
— Method.ThreePhasePowerModels.run_tp_pf_pbs
— Method.ThreePhasePowerModels.run_tp_pf_pbs
— Method.Abstract form for linear unbalanced power flow models
Structure representing OpenDSS dss_source_id
giving the type of the component dss_type
, its name dss_name
, and the active phases active_phases
PowerModels.constraint_branch_current
— Method.ThreePhasePowerModels.add_arcs_trans!
— Method.Adds arcs for TPPM transformers; for dclines and branches this is done in PMs
ThreePhasePowerModels.add_component!
— Method.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.
ThreePhasePowerModels.add_property
— Method.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.
adds voltage balance indicators; should only be called after addsetpointbus_voltage!
ThreePhasePowerModels.add_shunt!
— Method.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.
ThreePhasePowerModels.adjust_base!
— Method.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.
Rescales the parameters of a branch to reflect a change in voltage base.
ThreePhasePowerModels.adjust_base_rec!
— Method.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.
ThreePhasePowerModels.adjust_base_shunt!
— Method.Rescales the parameters of a shunt to reflect a change in voltage base.
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.
ThreePhasePowerModels.assign_property!
— Method.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
.
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).
ThreePhasePowerModels.check_network_data
— Method.Defines branch flow model power flow equations
KCL including transformer arcs.
KCL including transformer arcs and load variables.
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]))
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))
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])
nothing to do, no voltage angle variables
Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)
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])))
-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]))
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])
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]))
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]))
Do nothing, this model is symmetric
nothing to do, this model is symmetric
Creates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)
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])))
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])
Do nothing, this model is symmetric
Defines relationship between branch (series) power flow, branch (series) current and node voltage magnitude
Defines relationship between branch (series) power flow, branch (series) current and node voltage magnitude
Defines relationship between branch (series) power flow, branch (series) current and node voltage magnitude
Defines relationship between branch (series) power flow, branch (series) current and node voltage magnitude
Defines branch flow model power flow loss equations
Defines branch flow model power flow equations
Defines branch flow model power flow equations
Defines branch flow model power flow equations
ThreePhasePowerModels.constraint_tp_load
— Method.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.
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
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
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
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
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))
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))
Links the power flowing into both windings of a variable tap transformer.
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.
Links the voltage at both windings of a variable tap transformer.
Creates phase angle constraints at reference buses
nothing to do, no voltage angle variables
Creates phase angle constraints at reference buses
do nothing, no way to represent this in these variables
Links the power flowing into both windings of a fixed tap transformer.
nothing to do, this model is symmetric
Links the power flowing into both windings of a variable tap transformer.
Links the voltage at both windings of a fixed tap transformer.
nothing to do, no voltage variables
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
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
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
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
delegate back to PowerModels by default
nothing to do, these models do not have complex voltage 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} }
Defines branch flow model power flow equations
Defines voltage drop over a branch, linking from and to side voltage
Defines voltage drop over a branch, linking from and to side voltage
Defines voltage drop over a branch, linking from and to side voltage
Defines voltage drop over a branch, linking from and to side voltage magnitude
ThreePhasePowerModels.createCapacitor
— Function.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.
ThreePhasePowerModels.createGenerator
— Method.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.
ThreePhasePowerModels.createLine
— Method.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.
ThreePhasePowerModels.createLinecode
— Method.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.
ThreePhasePowerModels.createLoad
— Method.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.
ThreePhasePowerModels.createPVSystem
— Method.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.
ThreePhasePowerModels.createReactor
— Function.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.
ThreePhasePowerModels.createStorage
— Method.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.
ThreePhasePowerModels.createTransformer
— Method.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.
ThreePhasePowerModels.createVSource
— Function.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.
ThreePhasePowerModels.create_starbus
— Method.creates a starbus from a 3-winding transformer
ThreePhasePowerModels.create_vbranch!
— Method.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.
ThreePhasePowerModels.create_vbus!
— Method.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.
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.
ThreePhasePowerModels.discover_buses
— Method.discover_buses(dss_data)
Discovers all of the buses (not separately defined in OpenDSS), from "lines".
ThreePhasePowerModels.dss2tppm_branch!
— Method.dss2tppm_branch!(tppm_data, dss_data)
Adds PowerModels-style branches to tppm_data
from dss_data
.
ThreePhasePowerModels.dss2tppm_bus!
— Function.dss2tppm_bus!(tppm_data, dss_data)
Adds PowerModels-style buses to tppm_data
from dss_data
.
ThreePhasePowerModels.dss2tppm_gen!
— Method.dss2tppm_gen!(tppm_data, dss_data)
Adds PowerModels-style generators to tppm_data
from dss_data
.
ThreePhasePowerModels.dss2tppm_load!
— Method.dss2tppm_load!(tppm_data, dss_data)
Adds PowerModels-style loads to tppm_data
from dss_data
.
ThreePhasePowerModels.dss2tppm_pvsystem!
— Method.dss2tppmpvsystem!(tppmdata, dss_data)
Adds PowerModels-style pvsystems to tppm_data
from dss_data
.
ThreePhasePowerModels.dss2tppm_shunt!
— Method.dss2tppm_shunt!(tppm_data, dss_data)
Adds PowerModels-style shunts to tppm_data
from dss_data
.
dss2tppm_transformer!(tppm_data, dss_data, import_all)
Adds PowerModels-style transformers (branches) to tppm_data
from dss_data
.
ThreePhasePowerModels.find_bus
— Method.find_bus(busname, tppm_data)
Finds the index number of the bus in existing data from the given busname
.
ThreePhasePowerModels.find_component
— Method.find_component(tppm_data, name, compType)
Returns the component of compType
with name
from data
of type Dict{String,Array}.
get_conductors_ordered(busname)
Returns an ordered list of defined conductors.
ThreePhasePowerModels.get_dtypes
— Method.Returns a Dict{String,Type} for the desired component comp
, giving all of the expected data types
ThreePhasePowerModels.get_linecode
— Method.returns the linecode with name id
ThreePhasePowerModels.get_pbs_solution
— Method.ThreePhasePowerModels.get_prop_name
— Method.get_prop_name(ctype, i)
Returns the i
th property name for a given component type ctype
.
ThreePhasePowerModels.get_prop_name
— Method.get_prop_name(ctype)
Returns the property names in order for a given component type ctype
.
ThreePhasePowerModels.get_solution_tp
— Method.ThreePhasePowerModels.isa_array
— Method.checks if data
is an opendss-style array string
ThreePhasePowerModels.isa_conn
— Method.checks is a string is a connection by checking the values
ThreePhasePowerModels.isa_matrix
— Method.checks if data
is an opendss-style matrix string
ThreePhasePowerModels.isa_rpn
— Method.detects if expr
is Reverse Polish Notation expression
ThreePhasePowerModels.make_mpv!
— Method.collects several fromkeys in an array and sets it to the tokey, removes from_keys
ThreePhasePowerModels.matlab_to_tppm
— Method.Converts a Matlab dict into a ThreePhasePowerModels dict
ThreePhasePowerModels.merge_dss!
— Method.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.
ThreePhasePowerModels.ml2pm_branch
— Method.convert raw branch data into arrays
ThreePhasePowerModels.ml2pm_bus
— Method.convert raw bus data into arrays
ThreePhasePowerModels.ml2pm_gen
— Method.convert raw generator data into arrays
ThreePhasePowerModels.ml2pm_load
— Method.convert raw load data into arrays
ThreePhasePowerModels.ml2pm_shunt
— Method.convert raw shunt data into arrays
a quadratic penalty for bus power slack variables
ThreePhasePowerModels.parse_array
— Function.parse matrices according to active nodes
ThreePhasePowerModels.parse_array
— Method.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.
ThreePhasePowerModels.parse_buscoords
— Method.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.
ThreePhasePowerModels.parse_busname
— Method.parse_busname(busname)
Parses busnames as defined in OpenDSS, e.g. "primary.1.2.3.0".
ThreePhasePowerModels.parse_component
— Function.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.
ThreePhasePowerModels.parse_conn
— Method.parses connection "conn" specification reducing to wye or delta
ThreePhasePowerModels.parse_dss
— Method.ThreePhasePowerModels.parse_dss
— Method.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.
Parses a component's OpenDSS source information into the dss_source_id
struct
ThreePhasePowerModels.parse_dss_with_dtypes!
— Function.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.
parses the raw dss values into their expected data types
ThreePhasePowerModels.parse_file
— Method.parse_file(io)
Parses the IOStream of a file into a Three-Phase PowerModels data structure.
ThreePhasePowerModels.parse_file
— Method.ThreePhasePowerModels.parse_line
— Function.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.
ThreePhasePowerModels.parse_matlab
— Method.ThreePhasePowerModels.parse_matlab
— Method.ThreePhasePowerModels.parse_matrix
— Method.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.
ThreePhasePowerModels.parse_matrix
— Method.parse matrices according to active nodes
ThreePhasePowerModels.parse_opendss
— Method.Parses a Dict resulting from the parsing of a DSS file into a PowerModels usable format.
ThreePhasePowerModels.parse_opendss
— Method.Parses a DSS file into a PowerModels usable format.
ThreePhasePowerModels.parse_options
— Method.parse_options(options)
Parses options defined with the set
command in OpenDSS.
ThreePhasePowerModels.parse_properties
— Method.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.
ThreePhasePowerModels.parse_rpn
— Function.parses Reverse Polish Notation expr
ThreePhasePowerModels.post_tp_opf
— Method.ThreePhasePowerModels.post_tp_opf_bctr
— Method.ThreePhasePowerModels.post_tp_opf_bf
— Method.ThreePhasePowerModels.post_tp_opf_lm
— Method.This problem specification includes advanced load models, including constant power, constant current and constabt impedance delta-connected and wye-connected
ThreePhasePowerModels.post_tp_opf_oltc
— Method.ThreePhasePowerModels.post_tp_opf_pbs
— Method.ThreePhasePowerModels.post_tp_ots
— Method.ThreePhasePowerModels.post_tp_pf
— Method.ThreePhasePowerModels.post_tp_pf_bf
— Method.ThreePhasePowerModels.post_tp_pf_lm
— Method.ThreePhasePowerModels.post_tp_pf_pbs
— Method.ThreePhasePowerModels.post_tp_strg_opf
— Method.ThreePhasePowerModels.push_dict_ret_key!
— Method.This function appends a component to a component dictionary of a tppm data model.
real-valued SDP to SDP relaxation based on PSDness of principal minors, default is 3x3 SDP relaxation
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} }
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}
}
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}
}
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} }
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}
}
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}
}
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.
ThreePhasePowerModels.roll
— Method.rolls a 1d array left or right by idx
ThreePhasePowerModels.run_dc_tp_opf_lm
— Method.ThreePhasePowerModels.run_dc_tp_pf
— Method.ThreePhasePowerModels.run_mn_tp_strg_opf
— Method.multi-network opf with storage
ThreePhasePowerModels.run_tp_strg_opf
— Method.opf with storage
ThreePhasePowerModels.sc2br_impedance
— Method.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.
ThreePhasePowerModels.set_default
— Method.checks if the given dict has a value, if not, sets a default value
ThreePhasePowerModels.solution_bctr!
— Method.ThreePhasePowerModels.sqr
— Method.Squares x
, for parsing Reverse Polish Notation
ThreePhasePowerModels.strip_comments
— Method.Strips comments, defined by "!" from the ends of lines
ThreePhasePowerModels.strip_lines
— Method.strips lines that are either commented (block or single) or empty
ThreePhasePowerModels.to_sym_keys
— Method.converts Dict{String,Any} to Dict{Symbol,Any} for passing as kwargs
ThreePhasePowerModels.translate_version!
— Method.Translates legacy versions into current version format
generates variables for both active
and reactive
slack at each bus
ThreePhasePowerModels.variable_load
— Method.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.
variable: p_lt[l,i,j]
for (l,i,j)
in arcs
variable: q_lt[l,i,j]
for (l,i,j)
in arcs
Create tap variables.
variables for modeling storage units, includes grid injection and internal variables
Create variables for the active power flowing into all transformer windings.
Create variables for the active power flowing into all transformer windings.
Creates variables for both active
and reactive
power flow at each transformer.
Create variables for the reactive power flowing into all transformer windings.
do nothing, no reactive power in this model
variable: w[i] >= 0
for i
in bus
es
variable: p_ut[l,i,j]
for (l,i,j)
in arcs
variable: q_ut[l,i,j]
for (l,i,j)
in arcs
ThreePhasePowerModels.where_is_comp
— Method.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.