Constraints
PowerModelsDistribution.constraint_M_psd
— MethodFor rectangular coordinates of a complex matrix M=Mre+im*Mim, this function applies constraints equivalent to requiring that M itself is PSD.
PowerModelsDistribution.constraint_SWL_psd
— MethodTake 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.
PowerModelsDistribution.constraint_capacitor_on_off
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_capacitor_on_off
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_capacitor_on_off
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_capacitor_on_off
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_capacitor_on_off
— Methodconstraint_capacitor_on_off(pm::FOTRUPowerModel, i::Int; nw::Int=nw_id_default)
Add constraints to model capacitor switching similar to FBSUBFPowerModel
PowerModelsDistribution.constraint_capacitor_on_off
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_ampacity_from
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_ampacity_from
— Methodnothing to do, no voltage variables
PowerModelsDistribution.constraint_mc_ampacity_from
— Methodconstraint_mc_ampacity_from(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for branch current limit constraint from-side
PowerModelsDistribution.constraint_mc_ampacity_from
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_ampacity_from
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_ampacity_from
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_ampacity_to
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_ampacity_to
— Methodnothing to do, no voltage variables
PowerModelsDistribution.constraint_mc_ampacity_to
— Methodconstraint_mc_ampacity_to(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothin
Template function for branch current limit constraint to-side
PowerModelsDistribution.constraint_mc_ampacity_to
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_ampacity_to
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_ampacity_to
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_branch_current_limit
— Methodfunction constraint_mc_branch_current_limit(
pm::AbstractExplicitNeutralACRModel,
nw::Int,
f_idx::Tuple{Int,Int,Int},
t_idx::Tuple{Int,Int,Int},
f_connections::Vector,
t_connections::Vector,
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)
PowerModelsDistribution.constraint_mc_branch_current_limit
— Methodfunction constraint_mc_branch_current_limit(
pm::AbstractExplicitNeutralIVRModel,
nw::Int,
f_idx::Tuple{Int,Int,Int},
t_idx::Tuple{Int,Int,Int},
f_connections::Vector,
t_connections::Vector,
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
PowerModelsDistribution.constraint_mc_branch_current_limit
— Methodfunction 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)
PowerModelsDistribution.constraint_mc_branch_current_series_product_hermitian
— MethodPowerModelsDistribution.constraint_mc_branch_flow
— MethodAlready handled by variablemcbranchpowerreal
PowerModelsDistribution.constraint_mc_branch_flow
— Methodconstraint_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)
PowerModelsDistribution.constraint_mc_bus_voltage_balance
— Methodconstraint_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} }
PowerModelsDistribution.constraint_mc_bus_voltage_drop
— Methodfunction constraint_mc_bus_voltage_drop(
pm::AbstractExplicitNeutralIVRModel,
nw::Int,
i::Int,
f_bus::Int,
t_bus::Int,
f_idx::Tuple{Int,Int,Int},
f_connections::Vector{Int},
t_connections::Vector{Int},
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
PowerModelsDistribution.constraint_mc_bus_voltage_drop
— MethodDefines voltage drop over a branch, linking from and to side complex voltage
PowerModelsDistribution.constraint_mc_bus_voltage_drop
— Methodconstraint_mc_bus_voltage_drop(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for bus voltage drop constraints
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_ll
— MethodPowerModelsDistribution.constraint_mc_bus_voltage_magnitude_negative_sequence
— Methoda = 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
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_on_off
— Methodon/off bus voltage magnitude constraint
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_on_off
— Methodconstraint_mc_bus_voltage_magnitude_on_off(pm::AbstractUnbalancedPowerModel, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})::Nothing
Generic on/off bus voltage magnitude constraint
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_on_off
— Methodconstraint_mc_bus_voltage_magnitude_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for on/off voltage magnitude constraint
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_positive_sequence
— Methoda = 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
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_sqr_on_off
— Methodon/off bus voltage magnitude squared constraint for relaxed formulations
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_sqr_on_off
— Methodconstraint_mc_bus_voltage_magnitude_sqr_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for on/off voltage magnitude squared constraint for relaxed formulations
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_vuf
— Methoda = 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
PowerModelsDistribution.constraint_mc_bus_voltage_magnitude_zero_sequence
— Methoda = 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
PowerModelsDistribution.constraint_mc_bus_voltage_on_off
— Methodbus voltage on/off constraint for load shed problem
PowerModelsDistribution.constraint_mc_bus_voltage_on_off
— Methodbus voltage on/off constraint for load shed problem
PowerModelsDistribution.constraint_mc_bus_voltage_on_off
— Methodon/off bus voltage constraint for DCP formulation, nothing to do
PowerModelsDistribution.constraint_mc_bus_voltage_on_off
— Methodconstraint_mc_bus_voltage_on_off(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)::Nothing
Template function for on/off constraint for bus voltages"
PowerModelsDistribution.constraint_mc_bus_voltage_on_off
— Methodon/off bus voltage constraint for relaxed forms
PowerModelsDistribution.constraint_mc_current_balance
— MethodKirchhoff's current law applied to buses sum(cr + im*ci) = 0
PowerModelsDistribution.constraint_mc_current_balance
— Methodconstraint_mc_current_balance(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for KCL constraints in current-voltage variable space
PowerModelsDistribution.constraint_mc_current_balance
— Methodfunction constraint_mc_current_balance(
pm::RectangularVoltageExplicitNeutralModels,
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}}}
)
Kirchhoff's current law applied to buses sum(cr + im*ci) = 0
PowerModelsDistribution.constraint_mc_current_balance_capc
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_current_balance_capc
— Methodconstraint_mc_current_balance_capc(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for KCL constraints in current-voltage variable space with capacitor control variables.
PowerModelsDistribution.constraint_mc_current_from
— Methodfunction constraint_mc_current_from(
pm::AbstractExplicitNeutralIVRModel,
nw::Int,
f_bus::Int,
f_idx::Tuple{Int,Int,Int},
f_connections::Vector{Int},
g_sh_fr::Matrix{<:Real},
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
PowerModelsDistribution.constraint_mc_current_from
— MethodDefines how current distributes over series and shunt impedances of a pi-model branch
PowerModelsDistribution.constraint_mc_current_from
— Methodconstraint_mc_current_from(pm::AbstractUnbalancedIVRModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for current constraints on branches (from-side)
PowerModelsDistribution.constraint_mc_current_from
— Methodfunction constraint_mc_current_from(
pm::ReducedExplicitNeutralIVRModels,
nw::Int,
f_bus::Int,
f_idx::Tuple{Int,Int,Int},
f_connections::Vector{Int},
g_sh_fr::Matrix{<:Real},
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
PowerModelsDistribution.constraint_mc_current_limit
— MethodBounds the current magnitude at both from and to side of a branch cr[f_idx]^2 + ci[f_idx]^2 <= c_rating_a^2
cr[t_idx]^2 + ci[t_idx]^2 <= c_rating_a^2
PowerModelsDistribution.constraint_mc_current_to
— Methodfunction constraint_mc_current_to(
pm::AbstractExplicitNeutralIVRModel,
nw::Int,
t_bus,
f_idx::Tuple{Int,Int,Int},
t_idx::Tuple{Int,Int,Int},
f_connections::Vector{Int},
t_connections::Vector{Int},
g_sh_to::Matrix{<:Real},
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
PowerModelsDistribution.constraint_mc_current_to
— MethodDefines how current distributes over series and shunt impedances of a pi-model branch
PowerModelsDistribution.constraint_mc_current_to
— Methodconstraint_mc_current_to(pm::AbstractUnbalancedIVRModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for current constraints on branches (to-side)
PowerModelsDistribution.constraint_mc_current_to
— Methodfunction constraint_mc_current_to(
pm::ReducedExplicitNeutralIVRModels,
nw::Int,
t_bus,
f_idx::Tuple{Int,Int,Int},
t_idx::Tuple{Int,Int,Int},
f_connections::Vector{Int},
t_connections::Vector{Int},
g_sh_to::Matrix{<:Real},
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
PowerModelsDistribution.constraint_mc_gen_active_bounds
— Methodpmin <= Re(v*cg') <= pmax
PowerModelsDistribution.constraint_mc_gen_active_bounds
— Methodconstraint_mc_gen_active_bounds(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for defining limits on active power output of a generator where bounds can't be used.
PowerModelsDistribution.constraint_mc_gen_power_on_off
— Methodon/off constraint for generators
PowerModelsDistribution.constraint_mc_gen_power_on_off
— Methodon/off constraint for generators
PowerModelsDistribution.constraint_mc_gen_power_on_off
— Methodconstraint_mc_gen_power_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for generator power on/off constraints (MLD problems)
PowerModelsDistribution.constraint_mc_gen_power_setpoint_real
— Methodpg[i] == pg
PowerModelsDistribution.constraint_mc_gen_power_setpoint_real
— Methodconstraint_mc_gen_power_setpoint_real(pm::AbstractUnbalancedPowerModel, nw::Int, i::Int, pg::Vector{<:Real})::Nothing
Generic generator real power setpoint constraint
\[P_g == P_g^{setpoint}\]
PowerModelsDistribution.constraint_mc_gen_power_setpoint_real
— Methodconstraint_mc_gen_power_setpoint_real(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for generator active power setpoint constraint, for power flow problems
PowerModelsDistribution.constraint_mc_gen_reactive_bounds
— Methodqmin <= Im(v*cg') <= qmax
PowerModelsDistribution.constraint_mc_gen_reactive_bounds
— Methodconstraint_mc_gen_reactive_bounds(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for defines limits on reactive power output of a generator where bounds can't be used.
PowerModelsDistribution.constraint_mc_generator_current
— Methodfunction 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
.
PowerModelsDistribution.constraint_mc_generator_current_delta
— Methodfunction 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
PowerModelsDistribution.constraint_mc_generator_current_wye
— Methodfunction 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
PowerModelsDistribution.constraint_mc_generator_power
— MethodOnly support wye-connected generators.
PowerModelsDistribution.constraint_mc_generator_power
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_generator_power
— MethodLink the current and power withdrawn by a generator at the bus through a PSD constraint. The rank-1 constraint is dropped in this formulation.
PowerModelsDistribution.constraint_mc_generator_power
— Methodfunction constraint_mc_generator_power(
pm::ExplicitNeutralModels,
id::Int;
nw::Int=nw_id_default,
report::Bool=true
)
Constrains generator power variables for models with explicit neutrals.
PowerModelsDistribution.constraint_mc_generator_power_delta
— Methodfunction constraint_mc_generator_power_delta(
pm::AbstractExplicitNeutralACRModel,
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
)
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
PowerModelsDistribution.constraint_mc_generator_power_delta
— Methodfunction constraint_mc_generator_power_delta(
pm::AbstractNLExplicitNeutralIVRModel,
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
)
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
PowerModelsDistribution.constraint_mc_generator_power_delta
— Methodfunction constraint_mc_generator_power_delta(
pm::AbstractQuadraticExplicitNeutralIVRModel,
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
)
For quadratic IVR models with explicit neutrals, links the generator power variables :pd
and :qd
of delta-connected generators to the voltage and current
PowerModelsDistribution.constraint_mc_generator_power_delta
— MethodPowerModelsDistribution.constraint_mc_generator_power_delta
— MethodPowerModelsDistribution.constraint_mc_generator_power_delta
— Methodconstraint_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} \\ &\text{Initial line-line voltage: } V_0^\Delta = M^\Delta V_0 \\ &\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}\]
PowerModelsDistribution.constraint_mc_generator_power_delta
— Methodconstraint_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} \\ &\text{Initial line-line voltage: } V_0^\Delta = M^\Delta V_0 \\ &\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}\]
PowerModelsDistribution.constraint_mc_generator_power_delta
— Methodconstraint_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} \\ &\text{Initial line-line voltage: } V_0^\Delta = M^\Delta V_0 \\ &\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}\]
PowerModelsDistribution.constraint_mc_generator_power_delta
— Methoddelta connected generator setpoint constraint for IVR formulation
PowerModelsDistribution.constraint_mc_generator_power_delta
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_generator_power_delta
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_generator_power_wye
— Methodfunction constraint_mc_generator_power_wye(
pm::AbstractExplicitNeutralACRModel,
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
)
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
PowerModelsDistribution.constraint_mc_generator_power_wye
— Methodfunction constraint_mc_generator_power_wye(
pm::AbstractNLExplicitNeutralIVRModel,
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
)
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
PowerModelsDistribution.constraint_mc_generator_power_wye
— Methodfunction constraint_mc_generator_power_wye(
pm::AbstractQuadraticExplicitNeutralIVRModel,
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
)
For quadratic IVR models with explicit neutrals, links the generator power variables :pd
and :qd
of wye-connected generators to the voltage and current
PowerModelsDistribution.constraint_mc_generator_power_wye
— MethodPowerModelsDistribution.constraint_mc_generator_power_wye
— Methodwye connected generator setpoint constraint for IVR formulation
PowerModelsDistribution.constraint_mc_load_current
— Methodfunction 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
PowerModelsDistribution.constraint_mc_load_current
— Methodfunction 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
PowerModelsDistribution.constraint_mc_load_current_delta
— Methodfunction constraint_mc_load_current_delta(
pm::AbstractExplicitNeutralIVRModel,
nw::Int,
id::Int,
bus_id::Int,
connections::Vector{Int},
a::Vector{<:Real},
alpha::Vector{<:Real},
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
PowerModelsDistribution.constraint_mc_load_current_delta
— Methodfunction 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
PowerModelsDistribution.constraint_mc_load_current_delta
— MethodWe 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
PowerModelsDistribution.constraint_mc_load_current_delta
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_load_current_wye
— Methodfunction constraint_mc_load_current_wye(
pm::AbstractExplicitNeutralIVRModel,
nw::Int,
id::Int,
bus_id::Int,
connections::Vector{Int},
a::Vector{<:Real},
alpha::Vector{<:Real},
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
PowerModelsDistribution.constraint_mc_load_current_wye
— Methodfunction 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
PowerModelsDistribution.constraint_mc_load_power
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_load_power
— Methodfunction 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
PowerModelsDistribution.constraint_mc_load_power
— MethodCreates the constraints modelling the (relaxed) voltage-dependent loads.
PowerModelsDistribution.constraint_mc_load_power
— MethodOnly support wye-connected, constant-power loads.
PowerModelsDistribution.constraint_mc_load_power
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_load_power
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_load_power
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_load_power
— Methodconstraint_mc_load_power(pm::FOTRUPowerModel, load_id::Int; nw::Int=nw_id_default, report::Bool=true)
Load model is linearized around initial operating point similar to FBSUBFPowerModel.
PowerModelsDistribution.constraint_mc_load_power
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_load_power
— MethodCreates the constraints modelling the (relaxed) voltage-dependent loads for the matrix KCL formulation.
PowerModelsDistribution.constraint_mc_load_power
— Methodfunction constraint_mc_load_power(
pm::ExplicitNeutralModels,
id::Int;
nw::Int=nw_id_default,
report::Bool=true
)
Constrains load power variables for models with explicit neutrals.
PowerModelsDistribution.constraint_mc_load_power_delta
— Methodfunction constraint_mc_load_power_delta(
pm::AbstractExplicitNeutralACRModel,
nw::Int,
id::Int,
bus_id::Int,
connections::Vector{Int},
a::Vector{<:Real},
alpha::Vector{<:Real},
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
PowerModelsDistribution.constraint_mc_load_power_delta
— Methodfunction constraint_mc_load_power_delta(
pm::AbstractQuadraticExplicitNeutralIVRModel,
nw::Int,
id::Int,
bus_id::Int,
connections::Vector{Int},
model::LoadModel,
a::Vector{<:Real},
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
PowerModelsDistribution.constraint_mc_load_power_delta
— MethodPowerModelsDistribution.constraint_mc_load_power_delta
— MethodPowerModelsDistribution.constraint_mc_load_power_delta
— Methoddelta connected load setpoint constraint for IVR formulation
PowerModelsDistribution.constraint_mc_load_power_wye
— Methodfunction constraint_mc_load_power_wye(
pm::AbstractExplicitNeutralACRModel,
nw::Int,
id::Int,
bus_id::Int,
connections::Vector{Int},
a::Vector{<:Real},
alpha::Vector{<:Real},
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
PowerModelsDistribution.constraint_mc_load_power_wye
— Methodfunction constraint_mc_load_power_wye(
pm::AbstractQuadraticExplicitNeutralIVRModel,
nw::Int,
id::Int,
bus_id::Int,
connections::Vector{Int},
model::LoadModel,
a::Vector{<:Real},
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
PowerModelsDistribution.constraint_mc_load_power_wye
— MethodPowerModelsDistribution.constraint_mc_load_power_wye
— MethodPowerModelsDistribution.constraint_mc_load_power_wye
— Methodwye connected load setpoint constraint for IVR formulation
PowerModelsDistribution.constraint_mc_model_current
— MethodDefines relationship between branch (series) power flow, branch (series) current and node voltage magnitude
PowerModelsDistribution.constraint_mc_model_current
— Methodconstraint_mc_model_current(pm::AbstractUBFModels; nw::Int=nw_id_default)::Nothing
Template function for constraints for model current
PowerModelsDistribution.constraint_mc_model_current
— MethodDefines relationship between branch (series) power flow, branch (series) current and node voltage magnitude
PowerModelsDistribution.constraint_mc_model_current
— MethodDefines relationship between branch (series) power flow, branch (series) current and node voltage magnitude
PowerModelsDistribution.constraint_mc_model_current
— MethodDefines relationship between branch (series) power flow, branch (series) current and node voltage magnitude
PowerModelsDistribution.constraint_mc_model_voltage
— Methodnothing to do, these models do not have complex voltage constraints
PowerModelsDistribution.constraint_mc_model_voltage
— Methoddo nothing by default
PowerModelsDistribution.constraint_mc_model_voltage
— Methodconstraint_mc_model_voltage(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)::Nothing
Template function for model voltage constraints.
PowerModelsDistribution.constraint_mc_model_voltage_magnitude_difference
— MethodDefines voltage drop over a branch, linking from and to side voltage
PowerModelsDistribution.constraint_mc_model_voltage_magnitude_difference
— Methodconstraint_mc_model_voltage_magnitude_difference(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for constraints for modeling voltage magnitude difference across branches
PowerModelsDistribution.constraint_mc_model_voltage_magnitude_difference
— Methodconstraint_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,\\ &\text{Series real current flow: } cr_s^{fr} = \frac{(p_s^{fr} ⋅ v_{r0}^{fr} + q_s^{fr} ⋅ v_{i0}^{fr})}{{(v_{m0}^{fr})}^2},\\ &\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}\]
PowerModelsDistribution.constraint_mc_model_voltage_magnitude_difference
— MethodDefines voltage drop over a branch, linking from and to side voltage
PowerModelsDistribution.constraint_mc_network_power_balance
— MethodPowerModelsDistribution.constraint_mc_network_power_balance
— Methodconstraint_mc_network_power_balance(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for constraints that ensures that power generation and demand are balanced in OBF problem
PowerModelsDistribution.constraint_mc_ohms_yt_from
— Methodfunction constraint_mc_ohms_yt_from(
pm::AbstractExplicitNeutralACRModel,
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}
)
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])
PowerModelsDistribution.constraint_mc_ohms_yt_from
— MethodCreates 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]) +
-b[c,d]*vm_fr[c]*vm_to[d]*sin(va_fr[c]-va_to[d]) for d in conductor_ids(pm))
+ g_fr[c,c] * vm_fr[c]^2 +
sum( g_fr[c,d]*vm_fr[c]*vm_fr[d]*cos(va_fr[c]-va_fr[d]) +
b_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)
)
q_fr == -b[c,c] *vm_fr[c]^2 -
sum( b[c,d]*vm_fr[c]*vm_fr[d]*cos(va_fr[c]-va_fr[d]) -
g[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(-b[c,d]*vm_fr[c]*vm_to[d]*cos(va_fr[c]-va_to[d]) +
g[c,d]*vm_fr[c]*vm_to[d]*sin(va_fr[c]-va_to[d]) for d in conductor_ids(pm))
-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)
)
PowerModelsDistribution.constraint_mc_ohms_yt_from
— MethodCreates Ohms constraints
sfr = vfr.conj(Y(vfr-vto)) sfr = (vrfr+imvi_fr).(G-imB)([vrfr-vrto]-im[vifr-vito]) sfr = (vrfr+imvifr).([Gvrfr-Gvr_to-Bvifr+B*vito]-im[Gvifr-G*vito+Bvr_fr-Bvr_to])
PowerModelsDistribution.constraint_mc_ohms_yt_from
— MethodCreates 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])
PowerModelsDistribution.constraint_mc_ohms_yt_from
— Methodnothing to do, no voltage angle variables
PowerModelsDistribution.constraint_mc_ohms_yt_from
— Methodconstraint_mc_ohms_yt_from(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for ohms constraint for branches on the from-side
PowerModelsDistribution.constraint_mc_ohms_yt_from
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_ohms_yt_from
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_ohms_yt_to
— Methodfunction constraint_mc_ohms_yt_to(
pm::AbstractExplicitNeutralACRModel,
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
)
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]))
PowerModelsDistribution.constraint_mc_ohms_yt_to
— MethodCreates 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]))
PowerModelsDistribution.constraint_mc_ohms_yt_to
— MethodCreates 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]))
PowerModelsDistribution.constraint_mc_ohms_yt_to
— MethodDo nothing, this model is symmetric
PowerModelsDistribution.constraint_mc_ohms_yt_to
— Methodconstraint_mc_ohms_yt_to(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for ohms constraint for branches on the to-side
PowerModelsDistribution.constraint_mc_ohms_yt_to
— MethodCreates Ohms constraints (yt post fix indicates that Y and T values are in rectangular form)
PowerModelsDistribution.constraint_mc_ohms_yt_to
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_ohms_yt_to
— Methodconstraint_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)
PowerModelsDistribution.constraint_mc_ohms_yt_to
— Methodnothing to do, this model is symmetric
PowerModelsDistribution.constraint_mc_oltc_tap_fix
— MethodFor 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.
PowerModelsDistribution.constraint_mc_power_balance
— MethodPowerModelsDistribution.constraint_mc_power_balance
— MethodPowerModelsDistribution.constraint_mc_power_balance
— Methodconstraint_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\]
PowerModelsDistribution.constraint_mc_power_balance
— Methodconstraint_mc_power_balance(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for KCL constraints.
PowerModelsDistribution.constraint_mc_power_balance
— MethodPowerModelsDistribution.constraint_mc_power_balance
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_power_balance
— Methodconstraint_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) + \begin{bmatrix} v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) \\ v_{m0}^t \cdot \cos(v_{a0}^t-v_{a0}^u) \\ -v_{m0}^t \cdot v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) \\ v_{m0}^t \cdot v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) \end{bmatrix}^\top \begin{bmatrix} v_m^t-v_{m0}^t \\ v_m^u-v_{m0}^u \\ v_a^t-v_{a0}^t \\ v_a^u-v_{a0}^u \end{bmatrix} \\ & v_m^t \cdot v_m^u \cdot \sin(v_a^t-v_a^u) \Rightarrow v_{m0}^t \cdot v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) + \begin{bmatrix} v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) \\ v_{m0}^t \cdot \sin(v_{a0}^t-v_{a0}^u) \\ v_{m0}^t \cdot v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) \\ -v_{m0}^t \cdot v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) \end{bmatrix}^\top \begin{bmatrix} v_m^t-v_{m0}^t \\ v_m^u-v_{m0}^u \\ v_a^t-v_{a0}^t \\ v_a^u-v_{a0}^u \end{bmatrix} \end{align}\]
PowerModelsDistribution.constraint_mc_power_balance
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_power_balance
— MethodPowerModelsDistribution.constraint_mc_power_balance
— MethodShunt handling in matrix form: I = Y.U S = U.I' = U.(Y.U)' = U.U'.Y' = W.Y' = (Wr+j.Wi)(G+jB)' = (Wr+j.Wi)(G'-j.B') = (Wr.G'+Wi.B')+j(-Wr.B'+Wi.G') P = Wr.G'+Wi.B' Q = -Wr.B'+Wi.G'
PowerModelsDistribution.constraint_mc_power_balance
— Methodfunction constraint_mc_power_balance(
pm::RectangularVoltageExplicitNeutralModels,
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}}}
)
Imposes power balance constraints at each ungrounded terminal of bus i
for rectangular voltage models with explicit neutrals. sum(p + im*q) = 0
PowerModelsDistribution.constraint_mc_power_balance_capc
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_power_balance_capc
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_power_balance_capc
— Methodnothing to do in capc, no complex voltage variables in these models
PowerModelsDistribution.constraint_mc_power_balance_capc
— Methodconstraint_mc_power_balance_capc(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for KCL constraints with capacitor control variables.
PowerModelsDistribution.constraint_mc_power_balance_capc
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_power_balance_capc
— Methodconstraint_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} B_{s0} \cdot v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) \\ B_{s0} \cdot v_{m0}^t \cdot \cos(v_{a0}^t-v_{a0}^u) \\ -B_{s0} \cdot v_{m0}^t \cdot v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) \\ B_{s0} \cdot v_{m0}^t \cdot v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) \\ v_{m0}^t \cdot v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) \end{bmatrix}^\top \begin{bmatrix} v_m^t-v_{m0}^t \\ v_m^u-v_{m0}^u \\ v_a^t-v_{a0}^t \\ v_a^u-v_{a0}^u \\ B_{s} -B_{s0} \end{bmatrix} \\ & B_s \cdot v_m^t \cdot v_m^u \cdot \sin(v_a^t-v_a^u) \Rightarrow B_{s0} \cdot v_{m0}^t \cdot v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) + \begin{bmatrix} B_{s0} \cdot v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) \\ B_{s0} \cdot v_{m0}^t \cdot \sin(v_{a0}^t-v_{a0}^u) \\ B_{s0} \cdot v_{m0}^t \cdot v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) \\ -B_{s0} \cdot v_{m0}^t \cdot v_{m0}^u \cdot \cos(v_{a0}^t-v_{a0}^u) \\ v_{m0}^t \cdot v_{m0}^u \cdot \sin(v_{a0}^t-v_{a0}^u) \end{bmatrix}^\top \begin{bmatrix} v_m^t-v_{m0}^t \\ v_m^u-v_{m0}^u \\ v_a^t-v_{a0}^t \\ v_a^u-v_{a0}^u \\ B_{s} -B_{s0} \end{bmatrix} \end{align}\]
PowerModelsDistribution.constraint_mc_power_balance_capc
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_power_balance_capc
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_power_balance_shed
— MethodPowerModelsDistribution.constraint_mc_power_balance_shed
— MethodPowerModelsDistribution.constraint_mc_power_balance_shed
— Methodpower balance constraint with line shunts and transformers for load shed problem, DCP formulation
PowerModelsDistribution.constraint_mc_power_balance_shed
— Methodconstraint_mc_power_balance_shed(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for KCL constraints for load shed problem
PowerModelsDistribution.constraint_mc_power_balance_shed
— MethodKCL for load shed problem with transformers (AbstractWForms)
PowerModelsDistribution.constraint_mc_power_balance_shed_simple
— Methodpower balance constraint with line shunts and transformers for load shed problem, DCP formulation
PowerModelsDistribution.constraint_mc_power_balance_simple
— MethodPowerModelsDistribution.constraint_mc_power_balance_simple
— MethodPowerModelsDistribution.constraint_mc_power_balance_simple
— Methodconstraint_mc_power_balance_simple(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for KCL constraints for simple load shedding
PowerModelsDistribution.constraint_mc_power_balance_slack
— MethodPowerModelsDistribution.constraint_mc_power_balance_slack
— MethodPowerModelsDistribution.constraint_mc_power_balance_slack
— Methodconstraint_mc_power_balance_slack(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for KCL constraints which include a slack power at every bus
PowerModelsDistribution.constraint_mc_power_balance_slack
— MethodPowerModelsDistribution.constraint_mc_power_losses
— MethodDefines branch flow model power flow equations
PowerModelsDistribution.constraint_mc_power_losses
— Methodconstraint_mc_power_losses(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for constraints for modeling power losses across branches
PowerModelsDistribution.constraint_mc_power_losses
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_power_losses
— MethodDefines branch flow model power flow equations
PowerModelsDistribution.constraint_mc_regen_setpoint_active
— Methodqq[i] == qq
PowerModelsDistribution.constraint_mc_storage_current_limit
— MethodPowerModelsDistribution.constraint_mc_storage_current_limit
— MethodPowerModelsDistribution.constraint_mc_storage_current_limit
— Methodconstraint_mc_storage_current_limit(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for storage current limit constraints
PowerModelsDistribution.constraint_mc_storage_losses
— MethodNeglects the active and reactive loss terms associated with the squared current magnitude.
PowerModelsDistribution.constraint_mc_storage_losses
— MethodNeglects the active and reactive loss terms associated with the squared current magnitude.
PowerModelsDistribution.constraint_mc_storage_losses
— MethodPowerModelsDistribution.constraint_mc_storage_losses
— MethodPowerModelsDistribution.constraint_mc_storage_losses
— MethodPowerModelsDistribution.constraint_mc_storage_losses
— Methodactive power only, lossless model
PowerModelsDistribution.constraint_mc_storage_losses
— MethodPowerModelsDistribution.constraint_mc_storage_losses
— Methodactive power only
PowerModelsDistribution.constraint_mc_storage_losses
— Methodconstraint_mc_storage_losses(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for storage loss constraints
PowerModelsDistribution.constraint_mc_storage_losses
— MethodPowerModelsDistribution.constraint_mc_storage_on_off
— MethodPowerModelsDistribution.constraint_mc_storage_on_off
— MethodPowerModelsDistribution.constraint_mc_storage_on_off
— Methodconstraint_mc_storage_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Tempate function for storage on/off constraints for MLD problems
PowerModelsDistribution.constraint_mc_storage_power_setpoint_real
— Methodconstraint_mc_storage_power_setpoint_real(pm::AbstractUnbalancedPowerModel, nw::Int, i::Int, ps::Real)::Nothing
Generic storage real power setpoint constraint
\[P_s == P_s^{setpoint}\]
PowerModelsDistribution.constraint_mc_storage_power_setpoint_real
— Methodconstraint_mc_storage_power_setpoint_real(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for storage active power setpoint constraint, for power flow problems
PowerModelsDistribution.constraint_mc_storage_thermal_limit
— MethodPowerModelsDistribution.constraint_mc_storage_thermal_limit
— MethodPowerModelsDistribution.constraint_mc_storage_thermal_limit
— Methodconstraint_mc_storage_thermal_limit(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for storage thermal limit constraints
PowerModelsDistribution.constraint_mc_storage_thermal_limit
— Methodconstraintmcstoragethermallimit(pm::AbstractUnbalancedPowerModel, nw::Int, i::Int, connections::Vector{Int}, rating::Real)
Linear version of storage thermal limit constraint
PowerModelsDistribution.constraint_mc_switch_ampacity
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_switch_ampacity
— Methodnothing to do, no voltage variables
PowerModelsDistribution.constraint_mc_switch_ampacity
— Methodconstraint_mc_switch_ampacity(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for switch current limit constraint from-side
PowerModelsDistribution.constraint_mc_switch_ampacity
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_switch_ampacity
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_switch_ampacity
— Methodconstraint_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
PowerModelsDistribution.constraint_mc_switch_current
— Methodfunction constraint_mc_switch_current(
pm::AbstractExplicitNeutralIVRModel,
nw::Int,
id::Int,
f_idx::Tuple{Int,Int,Int},
t_idx::Tuple{Int,Int,Int},
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
PowerModelsDistribution.constraint_mc_switch_current
— Methodfunction constraint_mc_switch_current(
pm::ExplicitNeutralModels,
id::Int;
nw::Int=nw_id_default,
report::Bool=true
)
For models with explicit neutrals, link the switch currents or create appropiate expressions for them.
PowerModelsDistribution.constraint_mc_switch_current_limit
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_switch_current_limit
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_switch_current_limit
— MethodPowerModelsDistribution.constraint_mc_switch_current_limit
— Methodconstraint_mc_switch_current_limit(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for switch current limit constraints
PowerModelsDistribution.constraint_mc_switch_power
— Methodfunction constraint_mc_switch_power(
pm::AbstractExplicitNeutralACRModel,
nw::Int,
id::Int,
f_idx::Tuple{Int,Int,Int},
t_idx::Tuple{Int,Int,Int},
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
PowerModelsDistribution.constraint_mc_switch_power
— Methodfunction 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
PowerModelsDistribution.constraint_mc_switch_power_on_off
— MethodPowerModelsDistribution.constraint_mc_switch_power_on_off
— MethodPowerModelsDistribution.constraint_mc_switch_state
— Methodconstraint_mc_switch_state(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for switch state constraints
PowerModelsDistribution.constraint_mc_switch_state_closed
— MethodPowerModelsDistribution.constraint_mc_switch_state_closed
— MethodPowerModelsDistribution.constraint_mc_switch_state_closed
— MethodPowerModelsDistribution.constraint_mc_switch_state_closed
— MethodPowerModelsDistribution.constraint_mc_switch_state_closed
— Methodnothing to do
PowerModelsDistribution.constraint_mc_switch_state_closed
— MethodPowerModelsDistribution.constraint_mc_switch_state_closed
— Methodconstraint_mc_switch_state_closed(pm::FBSUBFPowerModel, nw::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int})
Voltage constraints for closed switches similar to ACRUPowerModel.
PowerModelsDistribution.constraint_mc_switch_state_on_off
— MethodPowerModelsDistribution.constraint_mc_switch_state_on_off
— MethodPowerModelsDistribution.constraint_mc_switch_state_on_off
— MethodPowerModelsDistribution.constraint_mc_switch_state_on_off
— Methodconstraint_mc_switch_state_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default, relax::Bool=false)::Nothing
Template function for switch state on/off constraints (MLD problems)
PowerModelsDistribution.constraint_mc_switch_state_on_off
— MethodPowerModelsDistribution.constraint_mc_switch_state_open
— MethodPowerModelsDistribution.constraint_mc_switch_state_open
— MethodPowerModelsDistribution.constraint_mc_switch_state_open
— MethodPowerModelsDistribution.constraint_mc_switch_thermal_limit
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_switch_thermal_limit
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_switch_thermal_limit
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_switch_thermal_limit
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_switch_thermal_limit
— Methodconstraint_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}
PowerModelsDistribution.constraint_mc_switch_thermal_limit
— Methodconstraint_mc_switch_thermal_limit(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for switch thermal limit constraint
PowerModelsDistribution.constraint_mc_thermal_limit_from
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_thermal_limit_from
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_thermal_limit_from
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_thermal_limit_from
— Method-rate_a <= p[f_idx] <= rate_a
PowerModelsDistribution.constraint_mc_thermal_limit_from
— Methodp[f_idx]^2 + q[f_idx]^2 <= rate_a^2
PowerModelsDistribution.constraint_mc_thermal_limit_from
— Methodconstraint_mc_thermal_limit_from(pm::AbstractUnbalancedPowerModel, nw::Int, f_idx::Tuple{Int,Int,Int}, f_connections::Vector{Int}, rate_a::Vector{<:Real})::Nothing
Generic thermal limit constraint for branches (from-side)
PowerModelsDistribution.constraint_mc_thermal_limit_from
— Methodconstraint_mc_thermal_limit_from(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for branch thermal constraints (from-side)
PowerModelsDistribution.constraint_mc_thermal_limit_to
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_thermal_limit_to
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_thermal_limit_to
— Methodfunction 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.
PowerModelsDistribution.constraint_mc_thermal_limit_to
— MethodPowerModelsDistribution.constraint_mc_thermal_limit_to
— Methodp[t_idx]^2 + q[t_idx]^2 <= rate_a^2
PowerModelsDistribution.constraint_mc_thermal_limit_to
— Methodconstraint_mc_thermal_limit_to(pm::AbstractUnbalancedPowerModel, nw::Int, t_idx::Tuple{Int,Int,Int}, t_connections::Vector{Int}, rate_a::Vector{<:Real})::Nothing
Generic thermal limit constraint for branches (to-side)
PowerModelsDistribution.constraint_mc_thermal_limit_to
— Methodconstraint_mc_thermal_limit_to(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for branch thermal constraints (to-side)
PowerModelsDistribution.constraint_mc_theta_ref
— MethodCreates phase angle constraints at reference buses
PowerModelsDistribution.constraint_mc_theta_ref
— Methodnothing to do, no voltage angle variables
PowerModelsDistribution.constraint_mc_theta_ref
— MethodCreates phase angle constraints at reference buses
PowerModelsDistribution.constraint_mc_theta_ref
— Methodconstraint_mc_theta_ref(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for reference angle constraints.
PowerModelsDistribution.constraint_mc_theta_ref
— Methoddo nothing, no way to represent this in these variables
PowerModelsDistribution.constraint_mc_theta_ref
— MethodPowerModelsDistribution.constraint_mc_theta_ref
— Methodconstraint_mc_theta_ref(pm::FBSUBFPowerModel, nw::Int, i::Int, va_ref::Vector{<:Real})
Creates phase angle constraints at reference buses similar to ACRUPowerModel.
PowerModelsDistribution.constraint_mc_theta_ref
— Methodbalanced three-phase phasor
PowerModelsDistribution.constraint_mc_theta_ref
— Methodfunction 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
PowerModelsDistribution.constraint_mc_transformer_current
— Methodfunction 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
PowerModelsDistribution.constraint_mc_transformer_current_dy
— Methodfunction constraint_mc_transformer_current_dy(
pm::AbstractExplicitNeutralIVRModel,
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
)
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
PowerModelsDistribution.constraint_mc_transformer_current_yy
— Methodfunction constraint_mc_transformer_current_yy(
pm::AbstractExplicitNeutralIVRModel,
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
)
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
PowerModelsDistribution.constraint_mc_transformer_power
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_transformer_power
— Methodconstraint_mc_transformer_power(pm::NFAUPowerModel, i::Int; nw::Int=nw_id_default)
transformer active power only constraint pf=-pt
\[p_f[fc] == -pt[tc]\]
PowerModelsDistribution.constraint_mc_transformer_power_dy
— Methodfunction constraint_mc_transformer_power_dy(
pm::AbstractExplicitNeutralACRModel,
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
)
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.
PowerModelsDistribution.constraint_mc_transformer_power_dy
— MethodPowerModelsDistribution.constraint_mc_transformer_power_dy
— MethodThis function adds all constraints required to model a two-winding, delta-wye connected transformer.
PowerModelsDistribution.constraint_mc_transformer_power_dy
— Methoddelta-wye transformer power constraint for IVR formulation
PowerModelsDistribution.constraint_mc_transformer_power_dy
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_transformer_power_dy
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_transformer_power_dy
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_transformer_power_dy
— Methodconstraint_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 \\ & {s}_{fr}^\Delta + {s}_{to} = 0\\ & {M}_{\Delta} = \begin{bmatrix} {W}_{fr} & {X}_{t} \\ {X}_{t}^{\text{H}} & {L}_{\Delta} \end{bmatrix} \succeq 0 \end{align}\]
PowerModelsDistribution.constraint_mc_transformer_power_yy
— Methodfunction constraint_mc_transformer_power_yy(
pm::AbstractExplicitNeutralACRModel,
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
)
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.
PowerModelsDistribution.constraint_mc_transformer_power_yy
— MethodPowerModelsDistribution.constraint_mc_transformer_power_yy
— MethodThis function adds all constraints required to model a two-winding, wye-wye connected transformer.
PowerModelsDistribution.constraint_mc_transformer_power_yy
— Methodwye-wye transformer power constraint for IVR formulation
PowerModelsDistribution.constraint_mc_transformer_power_yy
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_transformer_power_yy
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_transformer_power_yy
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_transformer_power_yy
— MethodLinks to and from power and voltages in a wye-wye transformer, assumes tm_fixed is true
\[w_fr_i=(pol_i*tm_scale*tm_i)^2w_to_i\]
PowerModelsDistribution.constraint_mc_transformer_power_yy
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_transformer_thermal_limit
— Methodfunction constraint_mc_transformer_thermal_limit(
pm::AbstractExplicitNeutralACRModel,
nw::Int,
id::Int,
f_idx::Tuple,
t_idx::Tuple,
f_bus::Int,
t_bus::Int,
f_connections::Vector,
t_connections::Vector,
config::ConnConfig,
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
PowerModelsDistribution.constraint_mc_transformer_thermal_limit
— Methodfunction constraint_mc_transformer_thermal_limit(
pm::AbstractNLExplicitNeutralIVRModel,
nw::Int,
id::Int,
f_idx::Tuple,
t_idx::Tuple,
f_bus::Int,
t_bus::Int,
f_connections::Vector,
t_connections::Vector,
config::ConnConfig,
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
PowerModelsDistribution.constraint_mc_transformer_thermal_limit
— Methodfunction constraint_mc_transformer_thermal_limit(
pm::AbstractQuadraticExplicitNeutralIVRModel,
nw::Int,
id::Int,
f_idx::Tuple,
t_idx::Tuple,
f_bus::Int,
t_bus::Int,
f_connections::Vector,
t_connections::Vector,
config::ConnConfig,
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
PowerModelsDistribution.constraint_mc_transformer_thermal_limit
— Methodfunction constraint_mc_transformer_thermal_limit(
pm::ExplicitNeutralModels,
id::Int;
nw::Int=nw_id_default,
bounded::Bool=true,
report::Bool=true,
)
Imposes a bound on the total apparent at each transformer winding
PowerModelsDistribution.constraint_mc_transformer_voltage
— Methodfunction constraint_mc_transformer_voltage(
pm::ExplicitNeutralModels,
i::Int;
nw::Int=nw_id_default,
fix_taps::Bool=true
)
For models with explicit neutrals, links the voltage of the from-side and to-side transformer windings
PowerModelsDistribution.constraint_mc_transformer_voltage_dy
— Methodfunction constraint_mc_transformer_voltage_dy(
pm::RectangularVoltageExplicitNeutralModels,
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
)
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)
PowerModelsDistribution.constraint_mc_transformer_voltage_yy
— Methodfunction constraint_mc_transformer_voltage_yy(
pm::RectangularVoltageExplicitNeutralModels,
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
)
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)
PowerModelsDistribution.constraint_mc_voltage_absolute
— Methodfunction constraint_mc_voltage_absolute(
pm::RectangularVoltageExplicitNeutralModels,
nw::Int,
i::Int,
terminals::Vector{Int},
grounded::Vector{Bool},
vmin::Vector{<:Real},
vmax::Vector{<:Real};
report::Bool=true
)
Imposes absolute voltage magnitude bounds for models with explicit neutrals
PowerModelsDistribution.constraint_mc_voltage_absolute
— Methodfunction 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
PowerModelsDistribution.constraint_mc_voltage_angle_difference
— MethodThis is duplicated at PowerModelsDistribution level to correctly handle the indexing of the shunts.
PowerModelsDistribution.constraint_mc_voltage_angle_difference
— MethodPowerModelsDistribution.constraint_mc_voltage_angle_difference
— MethodBounds the voltage angle difference between bus pairs
PowerModelsDistribution.constraint_mc_voltage_angle_difference
— Methodnothing to do, these models do not have angle difference constraints
PowerModelsDistribution.constraint_mc_voltage_angle_difference
— MethodPowerModelsDistribution.constraint_mc_voltage_angle_difference
— Methodconstraint_mc_voltage_angle_difference(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for constraints of the voltage angle difference across branches
PowerModelsDistribution.constraint_mc_voltage_angle_difference
— Methodconstraint_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"
PowerModelsDistribution.constraint_mc_voltage_angle_difference
— Methodconstraint_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"
PowerModelsDistribution.constraint_mc_voltage_fixed
— Methodfunction constraint_mc_voltage_fixed(
pm::RectangularVoltageExplicitNeutralModels,
nw::Int,
i::Int,
vm::Vector{<:Real},
va::Vector{<:Real},
terminals::Vector{Int},
grounded::Vector{Bool}
)
Fixes the voltage variables at bus i
to vm.*exp.(im*va)
PowerModelsDistribution.constraint_mc_voltage_magnitude_bounds
— Methodvmin <= vm[i] <= vmax
PowerModelsDistribution.constraint_mc_voltage_magnitude_bounds
— Methodconstraint_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.
PowerModelsDistribution.constraint_mc_voltage_magnitude_bounds
— Methodconstraint_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}\]
PowerModelsDistribution.constraint_mc_voltage_magnitude_bounds
— Methodconstraint_mc_voltage_magnitude_bounds(pm::FOTRUPowerModel, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})
Linearized voltage magnitude limits similar to FBSUBFPowerModel.
PowerModelsDistribution.constraint_mc_voltage_magnitude_fixed
— Methodfunction constraint_mc_voltage_magnitude_fixed(
pm::RectangularVoltageExplicitNeutralModels,
nw::Int,
i::Int,
vm::Vector{<:Real},
va::Vector{<:Real},
terminals::Vector{Int},
grounded::Vector{Bool}
)
Fixes the voltage variables at bus i
to vm.*exp.(im*va)
PowerModelsDistribution.constraint_mc_voltage_magnitude_only
— Methodvm[i] == vmref
PowerModelsDistribution.constraint_mc_voltage_magnitude_only
— Methodvm[i] == vmref
PowerModelsDistribution.constraint_mc_voltage_magnitude_only
— Methodnothing to do
PowerModelsDistribution.constraint_mc_voltage_magnitude_only
— Methodconstraint_mc_voltage_magnitude_only(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for voltage magnitude setpoint constraint
PowerModelsDistribution.constraint_mc_voltage_magnitude_only
— Methodvm[i] == vmref
PowerModelsDistribution.constraint_mc_voltage_pairwise
— Methodfunction constraint_mc_voltage_pairwise(
pm::RectangularVoltageExplicitNeutralModels,
nw::Int,
i::Int,
terminals::Vector{Int},
grounded::Vector{Bool},
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
PowerModelsDistribution.constraint_mc_voltage_pairwise
— Methodfunction 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
PowerModelsDistribution.constraint_mc_voltage_psd
— MethodAdd explicit PSD-ness of W for nodes where it is not implied
PowerModelsDistribution.constraint_mc_voltage_psd
— MethodAdd explicit PSD-ness of W for nodes where it is not implied
PowerModelsDistribution.constraint_mc_voltage_psd
— MethodAdd explicit PSD-ness of W for nodes where it is not implied
PowerModelsDistribution.constraint_mc_voltage_reference
— Methodfunction constraint_mc_voltage_reference(
pm::ExplicitNeutralModels,
id::Int;
nw::Int=nw_id_default,
bounded::Bool=true,
report::Bool=true,
)
Imposes suitable constraints for the voltage at the reference bus
PowerModelsDistribution.constraint_pqw
— MethodCreates 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
PowerModelsDistribution.constraint_storage_complementarity_mi
— MethodPowerModelsDistribution.constraint_storage_complementarity_mi
— Methodconstraint_storage_complementarity_mi(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for mixed-integer storage complementarity constraints
PowerModelsDistribution.constraint_storage_complementarity_nl
— MethodPowerModelsDistribution.constraint_storage_complementarity_nl
— Methodconstraint_storage_complementarity_nl(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for nonlinear storage complementarity constraints
PowerModelsDistribution.constraint_storage_complementarity_nl
— Methodconstraint_storage_complementarity_nl(pm::LPUBFDiagModel, n::Int, i::Int)
Linear version of storage complementarity constraint
PowerModelsDistribution.constraint_storage_state
— MethodPowerModelsDistribution.constraint_storage_state
— Methodconstraint_storage_state(pm::AbstractUnbalancedPowerModel, i::Int, nw_1::Int, nw_2::Int)::Nothing
Template function for storage state constraints for multinetwork problems
PowerModelsDistribution.constraint_storage_state
— Methodconstraint_storage_state(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)::Nothing
Template function for storage state constraints (non multinetwork)
PowerModelsDistribution.constraint_storage_state_initial
— MethodPowerModelsDistribution.constraint_switch_thermal_limit
— Methodconstraint_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
Relaxation Helpers
PowerModelsDistribution.cut_complex_product_and_angle_difference
— Methodcut_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}, }
PowerModelsDistribution.relaxation_psd_to_psd_real
— Methodrelaxation_psd_to_psd_real(m, mxreal, mximag; ndim=3)
For debugging / exploration: real-valued SDP to SDP relaxation based on PSDness of principal minors, default is 3x3 SDP relaxation
PowerModelsDistribution.relaxation_psd_to_soc
— Methodrelaxation_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} }
PowerModelsDistribution.relaxation_psd_to_soc_complex
— Methodrelaxation_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},
journal = {Optimization Methods and Software},
number = {5},
pages = {535--541},
volume = {18},
year = {2003}
}
PowerModelsDistribution.relaxation_psd_to_soc_complex_conic
— Methodrelaxation_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},
journal = {Optimization Methods and Software},
number = {5},
pages = {535--541},
volume = {18},
year = {2003}
}
PowerModelsDistribution.relaxation_psd_to_soc_conic
— Methodrelaxation_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} }
PowerModelsDistribution.relaxation_psd_to_soc_real
— Methodrelaxation_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},
journal = {Optimization Methods and Software},
number = {5},
pages = {535--541},
volume = {18},
year = {2003}
}
PowerModelsDistribution.relaxation_psd_to_soc_real_conic
— Methodrelaxation_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},
journal = {Optimization Methods and Software},
number = {5},
pages = {535--541},
volume = {18},
year = {2003}
}
Miscellaneous Helpers
PowerModelsDistribution.calculate_tm_scale
— FunctionCalculates the tap scale factor for the non-dimensionalized equations.
PowerModelsDistribution.calc_branch_y
— Functioncalc_branch_y(branch::Dict{String,<:Any})
computes branch admittance matrices
PowerModelsDistribution.calc_buspair_parameters
— Functioncalc_buspair_parameters(buses, branches)
Computes the buspair parameters for the network