Variables and Constraints
Variables
PowerModelsONM.variable_block_indicator
— Methodvariable_block_indicator(
pm::AbstractUnbalancedPowerModel;
nw::Int=nw_id_default,
relax::Bool=false,
report::Bool=true
)
Create variables for block status by load block, $z^{bl}_i\in{0,1}~\forall i \in B$, binary if relax=false
. Variables will appear in solution if report=true
.
PowerModelsONM.variable_bus_voltage_indicator
— Methodvariable_bus_voltage_indicator(
pm::AbstractUnbalancedPowerModel;
nw::Int=nw_id_default,
relax::Bool=false,
report::Bool=true
)
Variables for switching buses on/off $z^{bus}_i,~\forall i \in N$, binary if relax=false
. Variables will appear in solution if report=true
.
PowerModelsONM.variable_generator_indicator
— Methodvariable_generator_indicator(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Variables for switching generators on/off $z^{gen}_i,~\forall i \in G$, binary if relax=false
. Variables will appear in solution if report=true
.
PowerModelsONM.variable_inverter_indicator
— Methodvariable_inverter_indicator(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Variables for indicating whether a DER (storage or gen) is in grid-forming mode (1) or grid-following mode (0), binary is relax=false
. Variables will appear in solution if report=true
. If "inverter"==GRID_FOLLOWING on the device, the inverter variable will be a constant.
PowerModelsONM.variable_load_indicator
— Methodvariable_load_indicator(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Variables for switching loads on/off $z^{d}_i,~\forall i \in L$, binary if relax=false
. Variables will appear in solution if report=true
.
PowerModelsONM.variable_mc_load_power_block_scenario
— Methodvariable_mc_load_power(pm::PMD.AbstractUBFModels, scen::Int; nw=nw_id_default, report::Bool=false)
Load variables creation for robust mld problem. The bounds are different for each scenario.
PowerModelsONM.variable_mc_storage_power_mi_on_off
— Methodvariable_mc_storage_power_mi_on_off(
pm::AbstractUnbalancedPowerModel;
nw::Int=nw_id_default,
relax::Bool=false,
bounded::Bool=true,
report::Bool=true
)
Variables for storage, omitting the storage indicator $z^{strg}_i$ variable:
\[\begin{align} p^{strg}_i,~\forall i \in S \\ q^{strg}_i,~\forall i \in S \\ q^{sc}_{i},~\forall i \in S \\ \epsilon_i,~\forall i \in S \\ c^{strg}_i,~\forall i \in S \\ c^{on}_i \in {0,1},~\forall i \in S \\ d^{on}_i \in {0,1},~\forall i \in S \\ \end{align}\]
\[c^{on}_i\]
, $d^{on}_i$ will be binary if relax=false
. Variables will appear in solution if report=true
.
PowerModelsONM.variable_robust_inverter_indicator
— Methodvariable_robust_inverter_indicator(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, report::Bool=true)
Robust mld (outer) problem solution for indicating whether a DER (storage or gen) is in grid-forming mode (1) or grid-following mode (0).
PowerModelsONM.variable_robust_switch_state
— Methodvariable_robust_switch_state(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, report::Bool=true)
Robust mld (outer) problem solution for switch state (open/close) variables
PowerModelsONM.variable_storage_indicator
— Methodvariable_storage_indicator(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Variables for switching storage on/off $z^{strg}_i,~\forall i \in E$, binary if relax=false
. Variables will appear in solution if report=true
.
PowerModelsONM.variable_switch_state
— Methodvariable_switch_state(
pm::AbstractUnbalancedPowerModel;
nw::Int=nw_id_default,
report::Bool=true,
relax::Bool=false
)
Create variables for switch state (open/close) variables, $\gamma_i\in{0,1}~\forall i \in S$, binary if relax=false
. Variables for non-dispatchable switches will be constants, rather than VariableRef
. Variables will appear in solution if report=true
.
Constraints
PowerModelsONM.constraint_disable_networking
— Methodconstraint_disable_networking(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false)
Template function for constraint to disable microgrid networking.
PowerModelsONM.constraint_grid_forming_inverter_per_cc_block
— Methodconstraint_grid_forming_inverter_per_cc_block(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false)
Template function for constraining the number of grid-forming inverters per connected component in the block mld problem
PowerModelsONM.constraint_grid_forming_inverter_per_cc_traditional
— Methodconstraint_grid_forming_inverter_per_cc_traditional(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false)
Template function for constraining the number of grid-forming inverters per connected component in the block mld problem
PowerModelsONM.constraint_isolate_block
— Methodconstraint_isolate_block(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)
Template function of constraint to ensure that blocks are properly isolated by open switches in block mld problem.
PowerModelsONM.constraint_isolate_block_traditional
— Methodconstraint_isolate_block_traditional(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)
Template function for constraint to ensure that blocks are properly isolated by open switches in a traditional mld problem.
PowerModelsONM.constraint_mc_bus_voltage_block_on_off
— Methodconstraint_mc_bus_voltage_block_on_off(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)
Template function for bus voltage block on/off constraint.
PowerModelsONM.constraint_mc_bus_voltage_traditional_on_off
— Methodconstraint_mc_bus_voltage_traditional_on_off(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)
Template function for bus voltage traditional on/off constraint.
PowerModelsONM.constraint_mc_generator_power_block_on_off
— Methodconstraint_mc_generator_power_block_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for generator power block on/off constraint.
PowerModelsONM.constraint_mc_generator_power_traditional_on_off
— Methodconstraint_mc_generator_power_traditional_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for generator power traditional on/off constraint.
PowerModelsONM.constraint_mc_inverter_theta_ref
— Methodconstraint_mc_inverter_theta_ref(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)
Template function for setting the reference bus theta constraint to only the bus with a grid-forming inverter
PowerModelsONM.constraint_mc_power_balance_shed_block
— Methodconstraint_mc_power_balance_shed_block(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for power balance constraints for block load shed.
PowerModelsONM.constraint_mc_power_balance_shed_traditional
— Methodconstraint_mc_power_balance_shed_traditional(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for power balance constraints for traditional load shed.
PowerModelsONM.constraint_mc_storage_block_on_off
— Methodconstraint_mc_storage_block_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for storage block on/off constraint
PowerModelsONM.constraint_mc_storage_losses_block_on_off
— Methodconstraint_mc_storage_losses_block_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for storage losses block on/off constraint.
PowerModelsONM.constraint_mc_storage_losses_traditional_on_off
— Methodconstraint_mc_storage_losses_traditional_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for storage losses traditional on/off constraint.
PowerModelsONM.constraint_mc_storage_phase_unbalance
— Methodconstraint_mc_storage_phase_unbalance(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Constraint template for constraint to enforce balance between phases of ps/qs on storage.
PowerModelsONM.constraint_mc_storage_phase_unbalance_grid_following
— Methodconstraint_mc_storage_phase_unbalance_grid_following(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Constraint template for constraint to enforce balance between phases of ps/qs on storage for grid-following inverters only. Requires z_inverter
variables to indicate if a DER is grid-forming or grid-following
PowerModelsONM.constraint_mc_storage_traditional_on_off
— Methodconstraint_mc_storage_traditional_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for storage traditional on/off constraint.
PowerModelsONM.constraint_mc_switch_open_voltage_distance
— Methodconstraint_mc_switch_open_voltage_distance(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for constraint to encourage voltage matching at partition boundaries
PowerModelsONM.constraint_mc_switch_state_open_close
— Methodconstraint_mc_switch_state_open_close(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Voltage and power constraints for open/close switches
PowerModelsONM.constraint_mc_transformer_power_block_on_off
— Methodconstraint_mc_transformer_power_block_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default, fix_taps::Bool=true)
Template function for transformer power constraints for block mld problem.
PowerModelsONM.constraint_mc_transformer_power_traditional_on_off
— Methodconstraint_mc_transformer_power_traditional_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default, fix_taps::Bool=true)
Template function for transformer power constraints for traditional mld problem.
PowerModelsONM.constraint_radial_topology
— Methodconstraint_radial_topology(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, relax::Bool=false)
Template function radial topology constraint.
PowerModelsONM.constraint_storage_complementarity_mi_block_on_off
— Methodconstraint_storage_complementarity_mi_block_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for mixed-integer storage complementarity constraints.
PowerModelsONM.constraint_storage_complementarity_mi_traditional_on_off
— Methodconstraint_storage_complementarity_mi_traditional_on_off(pm::AbstractUnbalancedPowerModel, i::Int; nw::Int=nw_id_default)
Template function for mixed-integer storage complementarity constraints.
PowerModelsONM.constraint_switch_close_action_limit
— Methodconstraint_switch_close_action_limit(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)
Template function for constraint of maximum switch closes per timestep (allows unlimited switch opens).
PowerModelsONM.constraint_disable_networking
— Methodconstraint_disable_networking(pm::AbstractUnbalancedPowerModel, nw::Int; relax::Bool=false)
Constrains each microgrid to not network with another microgrid, while still allowing them to expand.
\[\begin{align} \sum_{k \in |{\cal L}|} y^k_{ab} = 1, \forall ab \in {\cal S}\\ y^k_{ab} - (1 - z_{ab}) \le x_k^{mg} \le y^k_{ab} + (1 - z_{ab}), \forall k \in {\cal L}\\ y^{k'}_{dc} - (1 - z_{dc}) - (1 - z_{ab}) \le y^{k'}_{ab} \le y^{k'}_{dc} + (1 - z_{dc}) + (1 - z_{ab}), \forall k \in {\cal L}, \forall ab \in {\cal T}_k, \forall dc \in {\cal T}_k\setminus {ab} \end{align}\]
PowerModelsONM.constraint_energized_blocks_strictly_increasing
— Methodconstraint_energized_blocks_strictly_increasing(pm::AbstractUnbalancedPowerModel, n_1::Int, n_2::Int)
Constraint to ensure that the number of energized load blocks from one timestep to another is strictly increasing and that once energized, a load block cannot be shed in a later timestep.
PowerModelsONM.constraint_energized_loads_strictly_increasing
— Methodconstraint_energized_loads_strictly_increasing(pm::AbstractUnbalancedPowerModel, n_1::Int, n_2::Int)
Constraint to ensure that the number of energized load blocks from one timestep to another is strictly increasing and that once energized, a load block cannot be shed in a later timestep.
PowerModelsONM.constraint_grid_forming_inverter_per_cc_block
— Methodconstraint_grid_forming_inverter_per_cc(pm::AbstractUnbalancedPowerModel, nw::Int; relax::Bool=false)
Constrains each connected component of the load block graph to have only one grid-forming inverter, if the block is enabled
\[\begin{align} & \sum_{k \in {\cal B}} y^k_{ab} \le z^{sw}_{ab} &\forall ab \in {\cal E}_{sw} \\ & \sum_{ab \in {\cal T}_k} (1-z^{sw}_{ab}) - |{\cal T}_k| + z^{bl}_k \le \sum_{i \in {\cal D}_k} z^{inv}_i \le z^{bl}_k & \forall k \in {\cal B} \\ & S^g_i \le \overline{S}^g_i (\sum_{ab \in {\cal T}_k} z^{sw}_{ab} + \sum_{j \in {\cal D}_k} z^{inv}_j) & \forall i \in {\cal G} \\ & S^g_i \le \overline{S}^g_i (\sum_{ab \in {\cal T}_k} \sum_{k \in {\cal B}} y_{ab}^k + \sum_{j \in {\cal D}_k} z^{sw}_j) & \forall i \in {\cal G} \\ & S^g_i \ge \underline{S}^g_i (\sum_{ab \in {\cal T}_k} z^{sw}_{ab} + \sum_{j \in {\cal D}_k} z^{inv}_j) & \forall i \in {\cal G} \\ & S^g_i \ge \underline{S}^g_i (\sum_{ab \in {\cal T}_k} \sum_{k \in {\cal B}} y_{ab}^k + \sum_{j \in {\cal D}_k} z^{sw}_j) & \forall i \in {\cal G} \\ & y^k_{ab} - (1 - z^{sw}_{ab}) \le \sum_{i \in {\cal D}_k} z^{inv}_i \le y^k_{ab} + (1 - z^{sw}_{ab}) & \forall k \in {\cal B},\forall ab \in {\cal E}_{sw} \\ & y^{k'}_{dc} - (1 - z^{sw}_{dc}) - (1 - z^{sw}_{ab}) \le y^{k'}_{ab} \le y^{k'}_{dc} + (1 - z^{sw}_{dc}) + (1 - z^{sw}_{ab}) \\ & ~~~~ \forall k \in {\cal B},\forall k' \in {\cal B}/{k},\forall ab \in {\cal E}_{sw},\forall dc \in {\cal E}_{sw}/{ab} \nonumber \\ & y_{ab}^k \le \sum_{i \in {\cal D}_k} z^{inv}_i & \forall k \in {\cal B},\forall ab \in {\cal E}_{sw} \\ & -z^{sw}_{ab} |{\cal B}| \le f_{ab}^k \le z^{sw}_{ab} |{\cal B}| & \forall k \in {\cal B},\forall ab \in {\cal E}_{sw} \\ & 0 \le \xi_{ab}^k \le 1 & \forall k \in {\cal B},\forall ab \in {\cal E}_{sw} \\ & \sum_{ab \in {\cal T}_k : a = k} f_{ab}^k - \sum_{ab \in {\cal T}_k : b = k} f_{ab}^k + \sum_{ab \in {\cal E}_v^k} \xi_{ab}^k = |{\cal B}| - 1 & \forall k \in {\cal B} \\ & \sum_{ab \in {\cal T}_{k'} : a = k'} f_{ab}^k - \sum_{ab \in {\cal T}_{k'} : b = k'} f_{ab}^k - \xi_{kk'}^k = -1, \;\;\; \forall k' \ne k & \forall k \in {\cal B} \\ & y_{ab}^k \le 1 - \xi_{kk'}^k & \forall k' \ne k, ab \in {\cal T}_{k'} \\ & z^{bl}_k \le \sum_{i \in {\cal D}_k} z^{inv}_i + \sum_{ab \in {\cal T}_k} \sum_{k \in {\cal B}} y^k_{ab} \end{align}\]
PowerModelsONM.constraint_grid_forming_inverter_per_cc_traditional
— Methodconstraint_grid_forming_inverter_per_cc_traditional(pm::AbstractUnbalancedPowerModel, nw::Int; relax::Bool=false)
Constrains each connected component of the graph to have only one grid-forming inverter, if the component is enabled
\[\begin{align} & \sum_{k \in {\cal B}} y^k_{ab} \le z^{sw}_{ab} &\forall ab \in {\cal E}_{sw} \\ & \sum_{ab \in {\cal T}_k} (1-z^{sw}_{ab}) - |{\cal T}_k| + 1 \le \sum_{i \in {\cal D}_k} z^{inv}_i \le 1 & \forall k \in {\cal B} \\ & S^g_i \le \overline{S}^g_i (\sum_{ab \in {\cal T}_k} z^{sw}_{ab} + \sum_{j \in {\cal D}_k} z^{inv}_j) & \forall i \in {\cal G} \\ & S^g_i \le \overline{S}^g_i (\sum_{ab \in {\cal T}_k} \sum_{k \in {\cal B}} y_{ab}^k + \sum_{j \in {\cal D}_k} z^{sw}_j) & \forall i \in {\cal G} \\ & S^g_i \ge \underline{S}^g_i (\sum_{ab \in {\cal T}_k} z^{sw}_{ab} + \sum_{j \in {\cal D}_k} z^{inv}_j) & \forall i \in {\cal G} \\ & S^g_i \ge \underline{S}^g_i (\sum_{ab \in {\cal T}_k} \sum_{k \in {\cal B}} y_{ab}^k + \sum_{j \in {\cal D}_k} z^{sw}_j) & \forall i \in {\cal G} \\ & y^k_{ab} - (1 - z^{sw}_{ab}) \le \sum_{i \in {\cal D}_k} z^{inv}_i \le y^k_{ab} + (1 - z^{sw}_{ab}) & \forall k \in {\cal B},\forall ab \in {\cal E}_{sw} \\ & y^{k'}_{dc} - (1 - z^{sw}_{dc}) - (1 - z^{sw}_{ab}) \le y^{k'}_{ab} \le y^{k'}_{dc} + (1 - z^{sw}_{dc}) + (1 - z^{sw}_{ab}) \\ & ~~~~ \forall k \in {\cal B},\forall k' \in {\cal B}/{k},\forall ab \in {\cal E}_{sw},\forall dc \in {\cal E}_{sw}/{ab} \nonumber \\ & y_{ab}^k \le \sum_{i \in {\cal D}_k} z^{inv}_i & \forall k \in {\cal B},\forall ab \in {\cal E}_{sw} \\ & -z^{sw}_{ab} |{\cal B}| \le f_{ab}^k \le z^{sw}_{ab} |{\cal B}| & \forall k \in {\cal B},\forall ab \in {\cal E}_{sw} \\ & 0 \le \xi_{ab}^k \le 1 & \forall k \in {\cal B},\forall ab \in {\cal E}_{sw} \\ & \sum_{ab \in {\cal T}_k : a = k} f_{ab}^k - \sum_{ab \in {\cal T}_k : b = k} f_{ab}^k + \sum_{ab \in {\cal E}_v^k} \xi_{ab}^k = |{\cal B}| - 1 & \forall k \in {\cal B} \\ & \sum_{ab \in {\cal T}_{k'} : a = k'} f_{ab}^k - \sum_{ab \in {\cal T}_{k'} : b = k'} f_{ab}^k - \xi_{kk'}^k = -1, \;\;\; \forall k' \ne k & \forall k \in {\cal B} \\ & y_{ab}^k \le 1 - \xi_{kk'}^k & \forall k' \ne k, ab \in {\cal T}_{k'} \\ \end{align}\]
PowerModelsONM.constraint_isolate_block
— Methodconstraint_isolate_block(pm::AbstractUnbalancedPowerModel, nw::Int)
constraint to ensure that blocks get properly isolated by open switches by comparing the states of two neighboring blocks. If the neighboring block indicators are not either both 0 or both 1, the switch between them should be OPEN (0)
\[\begin{align*} & (z^{bl}_{fr} - z^{bl}_{to}) \leq \gamma_{i}\ ~\forall i \in S \\ & (z^{bl}_{fr} - z^{bl}_{fr}) \geq - \gamma_{i}\ ~\forall i \in S \\ & z^{bl}_b \leq N_{gen} + N_{strg} + N_{neg load} + \sum_{i \in S \in b} \gamma_i, ~\forall b \in B \end{align*}\]
where $z^{bl}_{fr}$ and $z^{bl}_{to}$ are the indicator variables for the blocks on either side of switch $i$.
PowerModelsONM.constraint_isolate_block_traditional
— Methodconstraint_isolate_block_traditional(pm::AbstractUnbalancedPowerModel, nw::Int)
Constraint to simulate block isolation constraint in the traditional mld problem
\[\begin{align} & z^{bus}_{fr} - z^{bus}_{to} \leq (1-\gamma_i), ~\forall i \in S \\ & z^{bus}_{fr} - z^{bus}_{to} \geq -(1-\gamma_i), ~\forall i \in S \\ & z^{d}_i \leq z^{d}_j, ~\forall (i,j) \in D \in B \\ & z^{d}_i \leq z^{bus}_j, ~\forall i \in D \in B, ~i \in j \in V \in B \\ & z^{bus}_i \leq z^{bus}_j, ~\forall (i,j) \in V \in B \\ & z^{bl}_b \leq N_{gen} + N_{strg} + N_{neg load} + \sum_{i \in S \in {b \in B}} \gamma_i, ~\forall b \in B \end{align}\]
PowerModelsONM.constraint_mc_generator_power_block_on_off
— Methodconstraint_mc_generator_power_block_on_off(
pm::AbstractUnbalancedPowerModel,
nw::Int,
i::Int,
connections::Vector{Int},
pmin::Vector{<:Real},
pmax::Vector{<:Real},
qmin::Vector{<:Real},
qmax::Vector{<:Real}
)
Generic block mld on/off constraint for generator power
\[\begin{align} S_i \geq z^{bl}_b S^{lb}_i, i \in {b \in B} \\ S_i \leq z^{bl}_b S^{ub}_i, i \in {b \in B} \end{align}\]
PowerModelsONM.constraint_mc_generator_power_traditional_on_off
— Methodconstraint_mc_generator_power_traditional_on_off(pm::AbstractUnbalancedPowerModel, nw::Int, i::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, qmin::Vector{<:Real}, qmax::Vector{<:Real})
Generic traditional mld on/off constraint for generator power
\[\begin{align} S_i \geq z^{gen}_i S^{lb}_i \\ S_i \leq z^{gen}_i S^{ub}_i \end{align}\]
PowerModelsONM.constraint_mc_storage_block_on_off
— Methodconstraint_mc_storage_block_on_off(
pm::AbstractUnbalancedPowerModel,
nw::Int,
i::Int,
connections::Vector{Int},
pmin::Real,
pmax::Real,
qmin::Real,
qmax::Real,
charge_ub::Real,
discharge_ub::Real
)
block on/off constraint for storage
\[\begin{align} \sum_{\substack{c \in \Gamma}} S_{i,c} \geq z^{bl}_b S^{lb}_i, i \in {b \in B} \\ \sum_{\substack{c \in \Gamma}} S_{i,c} \leq z^{bl}_b S^{ub}_i, i \in {b \in B} \end{align}\]
PowerModelsONM.constraint_mc_storage_phase_unbalance
— Methodconstraint_mc_storage_phase_unbalance(
pm::AbstractUnbalancedPowerModel,
nw::Int,
i::Int,
connections::Vector{Int},
unbalance_factor::Real
)
Enforces that storage inputs/outputs are (approximately) balanced across each phase, by some unbalance_factor
\[S^{strg}_{i,c} \geq S^{strg}_{i,d} - f^{unbal} \left( -d^{on}_i S^{strg}_{i,d} + c^{on}_i S^{strg}_{i,d} \right) \forall c,d \in C S^{strg}_{i,c} \leq S^{strg}_{i,d} + f^{unbal} \left( -d^{on}_i S^{strg}_{i,d} + c^{on}_i S^{strg}_{i,d} \right) \forall c,d \in C\]
PowerModelsONM.constraint_mc_storage_phase_unbalance_grid_following
— Methodconstraint_mc_storage_phase_unbalance_grid_following(
pm::AbstractUnbalancedPowerModel,
nw::Int,
i::Int,
connections::Vector{Int},
unbalance_factor::Real
)
Enforces that storage inputs/outputs are (approximately) balanced across each phase, by some unbalance_factor
on grid-following inverters only. Requires z_inverter variable
\[S^{strg}_{i,c} \geq S^{strg}_{i,d} - f^{unbal} \left( -d^{on}_i S^{strg}_{i,d} + c^{on}_i S^{strg}_{i,d} \right) \forall c,d \in C S^{strg}_{i,c} \leq S^{strg}_{i,d} + f^{unbal} \left( -d^{on}_i S^{strg}_{i,d} + c^{on}_i S^{strg}_{i,d} \right) \forall c,d \in C\]
PowerModelsONM.constraint_mc_storage_traditional_on_off
— Methodconstraint_mc_storage_traditional_on_off(
pm::AbstractUnbalancedPowerModel,
nw::Int,
i::Int,
connections::Vector{Int},
pmin::Real,
pmax::Real,
qmin::Real,
qmax::Real,
charge_ub::Real,
discharge_ub::Real
)
Traditional on/off constraint for storage
\[\begin{align} \sum_{\substack{c \in \Gamma}} S_{i,c} \geq z^{strg}_i S^{lb}_i \\ \sum_{\substack{c \in \Gamma}} S_{i,c} \leq z^{strg}_i S^{ub}_i \end{align}\]
PowerModelsONM.constraint_mc_switch_power_open_close
— Methodconstraint_mc_switch_power_open_close(
pm::AbstractUnbalancedPowerModel,
nw::Int,
i::Int,
f_bus::Int,
t_bus::Int,
f_connections::Vector{Int},
t_connections::Vector{Int}
)
generic switch power open/closed constraint
\[\begin{align} & S^{sw}_{i,c} \leq S^{swu}_{i,c} z^{sw}_i\ \forall i \in S,\forall c \in C \\ & S^{sw}_{i,c} \geq -S^{swu}_{i,c} z^{sw}_i\ \forall i \in S,\forall c \in C \end{align}\]
PowerModelsONM.constraint_radial_topology
— Methodconstraint_radial_topology(pm::AbstractUnbalancedPowerModel, nw::Int; relax::Bool=false)
Constraint to enforce a radial topology
See 10.1109/TSG.2020.2985087
\[\begin{align} \mathbf{\beta} \in \mathbf{\Omega} \\ \alpha_{ij} \leq \beta_{ij},\forall(i,j) \in L \\ \sum_{\substack{(j,i_r)\in L}}f^{k}_{ji_r} - \sum_{\substack{(i_r,j)\in L}}f^{k}_{i_rj}=-1,~\forall k \in N\setminus i_r \\ \sum_{\substack{(j,k)\in L}}f^{k}_{jk} - \sum_{\substack{(k,j)\in L}}f^k_{kj} = 1,~\forall k \in N\setminus i_r \\ \sum_{\substack{(j,i)\in L}}f^k_{ji}-\sum_{\substack{(i,j)\in L}}f^k_{ij}=0,~\forall k \in N\setminus i_r,\forall i \in N\setminus {i_r,k} \\ 0 \leq f^k_{ij} \leq \lambda_{ij},0 \leq f^k_{ji} \leq \lambda_{ji},\forall k \in N\setminus i_r,\forall(i,j)\in L \\ \sum_{\substack{(i,j)\in L}}\left(\lambda_{ij} + \lambda_{ji} \right ) = \left | N \right | - 1 \\ \lambda_{ij} + \lambda_{ji} = \beta_{ij},\forall(i,j)\in L \\ \lambda_{ij},\lambda_{ji}\in\left \{ 0,1 \right \},\forall(i,j)\in L \end{align}\]
PowerModelsONM.constraint_storage_complementarity_mi_block_on_off
— Methodconstraint_storage_complementarity_mi_block_on_off(
pm::AbstractUnbalancedPowerModel,
n::Int,
i::Int,
charge_ub::Real,
discharge_ub::Real
)
Nonlinear storage complementarity mi constraint for block mld problem.
math``` \begin{align} c^{on}i * d^{on}i == z^{bl}b, i \in {b \in B} \ c^{on}i c^{ub}i \geq ci \ d^{on}i d^{ub}i \geq d_i \end{align} ```
PowerModelsONM.constraint_storage_complementarity_mi_traditional_on_off
— Methodconstraint_storage_complementarity_mi_traditional_on_off(
pm::AbstractUnbalancedPowerModel,
n::Int,
i::Int,
charge_ub::Real,
discharge_ub::Real
)
Nonlinear storage complementarity mi constraint for traditional mld problem.
math``` \begin{align} c^{on}i d^{on}i = z^{strg}i \ c^{on}i c^{ub}i \geq ci \ d^{on}i d^{ub}i \geq d_i \end{align} ```
PowerModelsONM.constraint_switch_close_action_limit
— Methodconstraint_switch_close_action_limit(pm::AbstractUnbalancedPowerModel, nw_1::Int, nw_2::Int)
Constraint for maximum allowed switch close actions between time steps, as defined by ref(pm, nw, :switch_close_actions_ub)
\[\begin{align} \Delta^{\gamma}_i, ~\forall i \in S & \\ \gamma^{t}_i, ~\forall i \in S, ~\forall t \in T & \\ \gamma^{t_1,t_2}_i, ~\forall i \in S, ~\forall (t_1,t_2) \in T & \\ s.t. & \\ & \gamma^{t_1,t_2}_i \geq 0 \\ & \gamma^{t_1,t_2}_i \geq \gamma^{t_2}_i + \gamma^{t_1}_i - 1 \\ & \gamma^{t_1,t_2}_i \leq \gamma{t_1}_i \\ & \gamma^{t_1,t_2}_i \leq \gamma{t_2}_i \\ & \Delta^{\gamma}_i \geq \gamma^{t_2}+i - \gamma^{t_1,t_2}_i \\ & \Delta^{\gamma}_i \geq \gamma^{t_2}+i + \gamma^{t_1,t_2}_i \\ & \sum_{\substack{i \in S}} \Delta^{\gamma}_i \leq N_{\gamma=1}^{ub} \end{align}\]
PowerModelsONM.constraint_switch_close_action_limit
— Methodconstraint_switch_close_action_limit(pm::AbstractUnbalancedPowerModel, nw::Int)
Constraint for maximum allowed switch close actions in a single time step, as defined by ref(pm, nw, :switch_close_actions_ub)
\[\begin{align} \Delta^{\gamma}_i,~\forall i \in S & \\ s.t. & \\ & \Delta^{\gamma}_i \geq \gamma \left( 1 - \gamma_0 \right) \\ & \Delta^{\gamma}_i \geq -\gamma \left( 1 - \gamma_0 \right) \\ & \sum_{\substack{i \in S}} \Delta^{\gamma}_i \leq N_{\gamma=1}^{ub} \end{align}\]
PowerModelsONM.constraint_mc_bus_voltage_block_on_off
— MethodPowerModelsONM.constraint_mc_bus_voltage_magnitude_block_on_off
— Methodconstraint_mc_bus_voltage_magnitude_block_on_off(pm::PMD.AbstractUnbalancedACPModel, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})
on/off bus voltage magnitude block constraint for relaxed formulations
PowerModelsONM.constraint_mc_bus_voltage_magnitude_traditional_on_off
— Methodconstraint_mc_bus_voltage_magnitude_traditional_on_off(pm::PMD.AbstractUnbalancedACPModel, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})
on/off bus voltage magnitude traditional constraint for relaxed formulations
PowerModelsONM.constraint_mc_bus_voltage_traditional_on_off
— MethodPowerModelsONM.constraint_mc_power_balance_shed_block
— Methodconstraint_mc_power_balance_shed_block(pm::PMD.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}}}
)
KCL for block load shed problem with transformers (ACPU Form)
PowerModelsONM.constraint_mc_power_balance_shed_traditional
— Methodconstraint_mc_power_balance_shed_traditional(pm::PMD.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}}}
)
KCL for traditional load shed problem with transformers (ACPU Form)
PowerModelsONM.constraint_mc_storage_losses_block_on_off
— Methodconstraint_mc_storage_losses_block_on_off(pm::PMD.AbstractUnbalancedACPModel, nw::Int, i::Int, bus::Int, connections::Vector{Int}, r::Real, x::Real, p_loss::Real, q_loss::Real)
Non-linear storage loss constraint
PowerModelsONM.constraint_mc_storage_losses_traditional_on_off
— Methodconstraint_mc_storage_losses_traditional_on_off(pm::PMD.AbstractUnbalancedACPModel, nw::Int, i::Int, bus::Int, connections::Vector{Int}, r::Real, x::Real, p_loss::Real, q_loss::Real)
Non-linear storage loss constraint
PowerModelsONM.constraint_mc_switch_voltage_open_close
— Methodconstraint_mc_switch_state_voltage_open_closed(pm::PMD.AbstractUnbalancedACPModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int})
Linear switch power on/off constraint for ACPU form.
\[\begin{align} & |V^{fr}_{i,c}| - |V^{to}_{i,c}| \leq \left ( v^u_{i,c} - v^l_{i,c} \right ) \left ( 1 - z^{sw}_i \right )\ \forall i \in S,\forall c \in C \\ & |V^{fr}_{i,c}| - |V^{to}_{i,c}| \geq -\left ( v^u_{i,c} - v^l_{i,c} \right ) \left ( 1 - z^{sw}_i \right )\ \forall i \in S,\forall c \in C \\ \end{align}\]
PowerModelsONM.constraint_mc_transformer_power_yy_block_on_off
— Methodconstraint_mc_transformer_power_yy_on_off(
pm::PMD.AbstractUnbalancedACPModel,
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
)
Links 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\]
PowerModelsONM.constraint_mc_bus_voltage_block_on_off
— MethodPowerModelsONM.constraint_mc_bus_voltage_magnitude_block_on_off
— Methodconstraint_mc_bus_voltage_magnitude_block_on_off(pm::PMD.AbstractUnbalancedACRModel, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})
on/off block bus voltage magnitude squared constraint for ac-rect form
PowerModelsONM.constraint_mc_bus_voltage_magnitude_traditional_on_off
— Methodconstraint_mc_bus_voltage_magnitude_traditional_on_off(pm::PMD.AbstractUnbalancedACRModel, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})
on/off block bus voltage magnitude squared constraint for ac-rect form
PowerModelsONM.constraint_mc_bus_voltage_traditional_on_off
— MethodPowerModelsONM.constraint_mc_inverter_theta_ref
— Methodconstraint_mc_inverter_theta_ref(pm::PMD.AbstractUnbalancedACRModel, nw::Int, i::Int, va_ref::Vector{<:Real})
Creates phase angle constraints at reference buses for the ACR formulation
math\begin{align} \Im(V) = \tan(V_a^{ref}) \Re(V) \end{align}
PowerModelsONM.constraint_mc_power_balance_shed_block
— Methodconstraint_mc_power_balance_shed_block(pm::PMD.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}}}
)
KCL for block load shed problem with transformers (ac-rect form)
PowerModelsONM.constraint_mc_power_balance_shed_traditional
— Methodconstraint_mc_power_balance_shed_traditional(pm::PMD.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}}}
)
KCL for traditional load shed problem with transformers (ac-rect form)
PowerModelsONM.constraint_mc_storage_losses_block_on_off
— Methodconstraint_mc_storage_losses_block_on_off(pm::PMD.AbstractUnbalancedACRModel, nw::Int, i::Int, bus::Int, connections::Vector{Int}, r::Real, x::Real, p_loss::Real, q_loss::Real)
Nonlinear storage losses constraint for ac-rect form.
PowerModelsONM.constraint_mc_storage_losses_traditional_on_off
— Methodconstraint_mc_storage_losses_traditional_on_off(pm::PMD.AbstractUnbalancedACRModel, nw::Int, i::Int, bus::Int, connections::Vector{Int}, r::Real, x::Real, p_loss::Real, q_loss::Real)
Nonlinear storage losses constraint for ac-rect form.
PowerModelsONM.constraint_mc_switch_voltage_open_close
— Methodconstraint_mc_switch_voltage_open_close(pm::PMD.AbstractUnbalancedACRModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int})
nonlinear switch power on/off constraint for ac-rect form
\[\begin{align} & \\ & \end{align}\]
PowerModelsONM.constraint_mc_transformer_power_yy_block_on_off
— Methodconstraint_mc_transformer_power_yy_block_on_off(
pm::PMD.AbstractUnbalancedACRModel,
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
)
Links to and from power and voltages in a wye-wye transformer, assumes tm_fixed is true
PowerModelsONM.constraint_mc_bus_voltage_block_on_off
— Methoddo nothing, no voltage variables
PowerModelsONM.constraint_mc_bus_voltage_traditional_on_off
— Methoddo nothing, no voltage variables
PowerModelsONM.constraint_mc_generator_power_block_on_off
— Methodconstraint_mc_generator_power_block_on_off(pm::PMD.AbstractUnbalancedNFAModel, nw::Int, i::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, ::Vector{<:Real}, ::Vector{<:Real})
on/off block constraint for generators for NFA model
PowerModelsONM.constraint_mc_generator_power_traditional_on_off
— Methodconstraint_mc_generator_power_traditional_on_off(pm::PMD.AbstractUnbalancedNFAModel, nw::Int, i::Int, connections::Vector{Int}, pmin::Vector{<:Real}, pmax::Vector{<:Real}, ::Vector{<:Real}, ::Vector{<:Real})
on/off traditional constraint for generators for NFAU form
PowerModelsONM.constraint_mc_inverter_theta_ref
— Methodnothing to do, no voltage angle variables
PowerModelsONM.constraint_mc_power_balance_shed_block
— Methodconstraint_mc_power_balance_shed_block(pm::PMD.AbstractUnbalancedNFAModel, 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}}}
)
KCL for block load shed problem with transformers (NFAU Form)
PowerModelsONM.constraint_mc_power_balance_shed_traditional
— Methodconstraint_mc_power_balance_shed_traditional(pm::PMD.AbstractUnbalancedNFAModel, 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}}}
)
KCL for traditional load shed problem with transformers (NFAU Form)
PowerModelsONM.constraint_mc_storage_block_on_off
— Methodconstraint_mc_storage_block_on_off(pm::PMD.AbstractUnbalancedNFAModel, nw::Int, i::Int, connections::Vector{Int}, pmin::Real, pmax::Real, ::Real, ::Real, ::Real, ::Real)
block on/off constraint for storage in NFAU Form.
PowerModelsONM.constraint_mc_storage_losses_block_on_off
— Methodconstraint_mc_storage_losses_block_on_off(pm::PMD.AbstractUnbalancedNFAModel, nw::Int, i::Int, bus::Int, connections::Vector{Int}, ::Real, ::Real, ::Real, ::Real)
Neglects all losses (lossless model), NFAU Form.
PowerModelsONM.constraint_mc_storage_losses_traditional_on_off
— Methodconstraint_mc_storage_losses_traditional_on_off(pm::PMD.AbstractUnbalancedNFAModel, nw::Int, i::Int, bus::Int, connections::Vector{Int}, ::Real, ::Real, ::Real, ::Real)
Neglects all losses (lossless model), NFAU Form.
PowerModelsONM.constraint_mc_storage_phase_unbalance_grid_following
— Methodconstraint_mc_storage_phase_unbalance_grid_following(
pm::AbstractUnbalancedPowerModel,
nw::Int,
i::Int,
connections::Vector{Int},
unbalance_factor::Real
)
Enforces that storage inputs/outputs are (approximately) balanced across each phase, by some unbalance_factor
on grid-following inverters only. Requires z_inverter variable. Variant for Active Power Only models.
\[S^{strg}_{i,c} \geq S^{strg}_{i,d} - f^{unbal} \left( -d^{on}_i S^{strg}_{i,d} + c^{on}_i S^{strg}_{i,d} \right) \forall c,d \in C\]
PowerModelsONM.constraint_mc_storage_traditional_on_off
— Methodconstraint_mc_storage_traditional_on_off(pm::PMD.AbstractUnbalancedNFAModel, nw::Int, i::Int, connections::Vector{Int}, pmin::Real, pmax::Real, ::Real, ::Real, ::Real, ::Real)
traditional on/off constraint for storage in NFAU Form.
PowerModelsONM.constraint_mc_switch_open_voltage_distance
— Methoddo nothing, no voltage variables
PowerModelsONM.constraint_mc_switch_power_open_close
— Methodconstraint_mc_switch_power_open_close(pm::PMD.AbstractUnbalancedNFAModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int})
Linear switch power on/off constraint for Active Power Only Models. If relax
, an indicator constraint is used.
\[\begin{align} & P^{sw}_{i,c} \leq P^{swu}_{i,c} z^{sw}_i\ \forall i \in P,\forall c \in C \\ & P^{sw}_{i,c} \geq -P^{swu}_{i,c} z^{sw}_i\ \forall i \in P,\forall c \in C \end{align}\]
PowerModelsONM.constraint_mc_switch_voltage_open_close
— Methodconstraint_mc_switch_voltage_open_close(pm::PMD.AbstractUnbalancedNFAModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int})
No voltage variables, do nothing
PowerModelsONM.constraint_mc_transformer_power_block_on_off
— Methodconstraint_mc_transformer_power_block_on_off(pm::PMD.AbstractUnbalancedNFAModel, i::Int; nw::Int=nw_id_default, fix_taps::Bool=false)
transformer active power only constraint pf=-pt
\[p_f[fc] == -pt[tc]\]
PowerModelsONM.constraint_mc_transformer_power_traditional_on_off
— MethodPowerModelsONM.constraint_storage_complementarity_mi_block_on_off
— Methodconstraint_storage_complementarity_mi_block_on_off(pm::Union{PMD.LPUBFDiagModel,PMD.AbstractUnbalancedNFAModel}, n::Int, i::Int, charge_ub::Real, discharge_ub::Real)
linear storage complementarity mi constraint for block mld problem
mathsc_{on} + sd_{on} == z_{block}
PowerModelsONM.constraint_storage_complementarity_mi_traditional_on_off
— Methodconstraint_storage_complementarity_mi_traditional_on_off(
pm::Union{PMD.LPUBFDiagModel,PMD.AbstractUnbalancedNFAModel},
n::Int,
i::Int,
charge_ub::Real,
discharge_ub::Real
)
linear storage complementarity mi constraint for traditional mld problem
mathsc_{on} + sd_{on} == z_{block}
PowerModelsONM.constraint_mc_inverter_theta_ref
— Methodconstraint_mc_inverter_theta_ref(pm::PMD.LPUBFDiagModel, nw::Int, i::Int, ::Vector{<:Real})
Constrains a bus with a connected grid-forming inverter to have a reference bus constraint
PowerModelsONM.constraint_mc_load_power_block_on_off
— MethodDefault to PowerModelsDistribution.constraintmcload_power
PowerModelsONM.constraint_mc_load_power_block_on_off
— 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}\]
PowerModelsONM.constraint_mc_load_power_block_scenario
— Methodconstraint_mc_load_power(pm::PMD.LPUBFDiagModel, load_id::Int, scen::Int; nw::Int=nw_id_default, report::Bool=true)
Load models for LPUBFDiagModel (similar to PMD.constraintmcload_power) for robust mld problem. The constraints are different for each scenario.
PowerModelsONM.constraint_mc_load_power_traditional_on_off
— MethodDefault to PowerModelsDistribution.constraintmcload_power
PowerModelsONM.constraint_mc_load_power_traditional_on_off
— 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}\]
PowerModelsONM.constraint_mc_power_balance_shed_block
— Methodconstraint_mc_power_balance_shed_block(pm::PMD.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}}}
)
KCL for block load shed problem with transformers (LinDistFlow Form)
PowerModelsONM.constraint_mc_power_balance_shed_traditional
— Methodconstraint_mc_power_balance_shed_traditional(pm::PMD.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}}})
KCL for traditional load shed problem with transformers (LinDistFlow Form)
PowerModelsONM.constraint_mc_storage_losses_block_on_off
— Methodconstraint_mc_storage_losses_block_on_off(pm::PMD.LPUBFDiagModel, nw::Int, i::Int, bus::Int, connections::Vector{Int}, r::Real, x::Real, p_loss::Real, q_loss::Real)
Neglects the active and reactive loss terms associated with the squared current magnitude.
PowerModelsONM.constraint_mc_storage_losses_traditional_on_off
— Methodconstraint_mc_storage_losses_traditional_on_off(pm::PMD.LPUBFDiagModel, nw::Int, i::Int, bus::Int, connections::Vector{Int}, r::Real, x::Real, p_loss::Real, q_loss::Real)
Neglects the active and reactive loss terms associated with the squared current magnitude.
PowerModelsONM.constraint_mc_switch_voltage_open_close
— Methodconstraint_mc_switch_voltage_open_close(pm::PMD.LPUBFDiagModel, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int})
Linear switch power on/off constraint for LPUBFDiagModel.
\[\begin{align} & w^{fr}_{i,c} - w^{to}_{i,c} \leq \left ( v^u_{i,c} \right )^2 \left ( 1 - z^{sw}_i \right )\ \forall i \in S,\forall c \in C \\ & w^{fr}_{i,c} - w^{to}_{i,c} \geq -\left ( v^u_{i,c}\right )^2 \left ( 1 - z^{sw}_i \right )\ \forall i \in S,\forall c \in C \end{align}\]
PowerModelsONM.constraint_mc_transformer_power_yy_block_on_off
— Methodconstraint_mc_transformer_power_yy_block_on_off(
pm::PMD.LPUBFDiagModel,
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
)
Links 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\]
PowerModelsONM.constraint_mc_transformer_power_yy_traditional_on_off
— Methodconstraint_mc_transformer_power_yy_traditional_on_off(pm::PMD.LPUBFDiagModel, 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)
Links 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\]
PowerModelsONM.constraint_storage_complementarity_mi_block_on_off
— Methodconstraint_storage_complementarity_mi_block_on_off(pm::PMD.LPUBFDiagModel, n::Int, i::Int, charge_ub::Real, discharge_ub::Real)
linear storage complementarity mi constraint for block mld problem
mathsc_{on} + sd_{on} == z_{block}
PowerModelsONM.constraint_storage_complementarity_mi_traditional_on_off
— Methodconstraint_storage_complementarity_mi_traditional_on_off(pm::PMD.LPUBFDiagModel, n::Int, i::Int, charge_ub::Real, discharge_ub::Real)
linear storage complementarity mi constraint for traditional mld problem
mathsc_{on} + sd_{on} == z_{block}
PowerModelsONM.constraint_mc_bus_voltage_block_on_off
— Methodconstraint_mc_bus_voltage_block_on_off(pm::PMD.AbstractUnbalancedWModels, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})
Redirects to constraint_mc_bus_voltage_magnitude_sqr_block_on_off
for AbstractUnbalancedWModels
PowerModelsONM.constraint_mc_bus_voltage_magnitude_sqr_block_on_off
— Methodconstraint_mc_bus_voltage_magnitude_sqr_block_on_off(
pm::PMD.AbstractUnbalancedWModels,
nw::Int,
i::Int,
vmin::Vector{<:Real},
vmax::Vector{<:Real}
)
on/off block bus voltage magnitude squared constraint for W models
\[\]
PowerModelsONM.constraint_mc_bus_voltage_magnitude_sqr_traditional_on_off
— Methodconstraint_mc_bus_voltage_magnitude_sqr_traditional_on_off(
pm::PMD.AbstractUnbalancedWModels,
nw::Int,
i::Int,
vmin::Vector{<:Real},
vmax::Vector{<:Real}
)
on/off traditional bus voltage magnitude squared constraint for W models
\[\]
PowerModelsONM.constraint_mc_bus_voltage_traditional_on_off
— Methodconstraint_mc_bus_voltage_traditional_on_off(pm::PMD.AbstractUnbalancedWModels, nw::Int, i::Int, vmin::Vector{<:Real}, vmax::Vector{<:Real})
Redirects to constraint_mc_bus_voltage_magnitude_sqr_traditional_on_off
for AbstractUnbalancedWModels
PowerModelsONM.constraint_mc_inverter_theta_ref
— Methodconstraint_mc_inverter_theta_ref(pm::PMD.AbstractUnbalancedPolarModels, nw::Int, i::Int, va_ref::Vector{<:Real})
Phase angle constraints at reference buses for the Unbalanced Polar models
math\begin{align*} V_a - V^{ref}_a \leq 60^{\circ} * (1-\sum{z_{inv}}) V_a - V^{ref}_a \geq -60^{\circ} * (1-\sum{z_{inv}}) \end{align*}
PowerModelsONM.constraint_mc_switch_open_voltage_distance
— Methodconstraint_mc_switch_open_voltage_distance(pm::PMD.AbstractUnbalancedPolarModels, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int}, vm_delta_pu::Real, ::Real)
Constraints for voltages on either side of an open switch to be within some distance of one another (provided by user) for Polar models math``` \begin{align} |V{i,\phi}|-|V{j,\phi}| &\leq \overline{\delta}^{|V|}{k} + \tau^{|V|}{k,\phi}, \; \; & \forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \ -\left[|V{i,\phi}|-|V{j,\phi}|\right] &\leq \overline{\delta}^{|V|}{k} + \tau^{|V|}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \ \angle V{i,\phi}-\angle V{j,\phi} &\leq \overline{\delta}^{\angle V}{k} + \tau^{\angle V}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \ -\left[\angle V{i,\phi}-\angle V{j,\phi}\right] &\leq \overline{\delta}^{\angle V}{k} + \tau^{\angle V}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \end{align}
math```
\begin{align}
\tau^{V}_{k,\phi} = \left(\frac{\tau^{|V|}_{k,\phi}}{\overline{\delta}^{|V|}_{k,\phi}}\right)^2 +\left(\frac{\tau^{\angle V}_{k,\phi}}{\overline{\delta}^{\angle V}_{k,\phi}}\right)^2, \; \; \forall (i,j,k) \in {\cal E}_{sw}^{\mathrm{open}},\forall \phi \in \Phi
\end{align}
PowerModelsONM.constraint_mc_switch_open_voltage_distance
— Methodconstraint_mc_switch_open_voltage_distance(pm::PMD.AbstractUnbalancedRectangularModels, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int}, vm_delta_pu::Real, ::Real)
Constraints for voltages on either side of an open switch to be within some distance of one another (provided by user) for Rectangular models math``` \begin{align} \sqrt{\Re{V{i,\phi}}^2 + \Im{V{i,\phi}}^2}-\sqrt{\Re{V{j,\phi}}^2 + \Im{V{j,\phi}}^2} &\leq \overline{\delta}^{|V|}{k} + \tau^{|V|}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \ -\left[\sqrt{\Re{V{i,\phi}}^2 + \Im{V{i,\phi}}^2}-\sqrt{\Re{V{j,\phi}}^2 + \Im{V{j,\phi}}^2}\right] &\leq \overline{\delta}^{|V|}{k} + \tau^{|V|}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \ \arctan{\left(\frac{\Im{V{i,\phi}}}{\Re{V{i,\phi}}}\right)}-\arctan{\left(\frac{\Im{V{j,\phi}}}{\Re{V{j,\phi}}}\right)} &\leq \overline{\delta}^{\angle V}{k} + \tau^{\angle V}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \ -\left[\arctan{\left(\frac{\Im{V{i,\phi}}}{\Re{V{i,\phi}}}\right)}-\arctan{\left(\frac{\Im{V{j,\phi}}}{\Re{V{j,\phi}}}\right)}\right] &\leq \overline{\delta}^{\angle V}{k} + \tau^{\angle V}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \end{align}
math```
\begin{align}
\tau^{V}_{k,\phi} = \left(\frac{\tau^{|V|}_{k,\phi}}{\overline{\delta}^{|V|}_{k,\phi}}\right)^2 +\left(\frac{\tau^{\angle V}_{k,\phi}}{\overline{\delta}^{\angle V}_{k,\phi}}\right)^2, \; \; \forall (i,j,k) \in {\cal E}_{sw}^{\mathrm{open}},\forall \phi \in \Phi
\end{align}
PowerModelsONM.constraint_mc_switch_open_voltage_distance
— Methodconstraint_mc_switch_open_voltage_distance(pm::PMD.AbstractUnbalancedWModels, nw::Int, i::Int, f_bus::Int, t_bus::Int, f_connections::Vector{Int}, t_connections::Vector{Int}, vm_delta_pu::Real, ::Real)
Constraints for voltages on either side of an open switch to be within some distance of one another (provided by user) for W models
math``` \begin{align} w{i,\phi} - w{j,\phi} &\leq \left(\overline{\delta}^{|V|}{k}\right)^2 + \tau^{w}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \ -\left[w{i,\phi} - w{j,\phi}\right] &\leq \left(\overline{\delta}^{|V|}{k}\right)^2 + \tau^{w}{k,\phi}, \; \; &\forall (i,j,k) \in {\cal E}{sw}^{\mathrm{open}},\forall \phi \in \Phi \end{align}
math```
\begin{align}
\tau^{V}_{k,\phi} = \frac{\upsilon^{w}_{k,\phi}}{\left(\overline{\delta}^{|V|}_{k}\right)^2}, \; \; \forall (i,j,k) \in {\cal E}_{sw}^{\mathrm{open}},\forall \phi \in \Phi
\end{align}
where
math``` \begin{align} \upsilon^{w}{k,\phi} \geq 2 (\underline{\tau}^{|V|}{k})^2 \tau^{w}{k,\phi} - (\underline{\tau}^{|V|}{k})^4 \ \upsilon^{w}{k,\phi} \geq 2 (\overline{\tau}^{|V|}{k})^2 \tau^{w}{k,\phi} - (\overline{\tau}^{|V|}{k})^4 \ \upsilon^{w}{k,\phi} \leq \left((\overline{\tau}^{|V|}{k})^2 + (\underline{\tau}^{|V|}{k})^2\right) \tau^{w}{k,\phi} - (\overline{\tau}^{|V|}{k})^2(\underline{\tau}^{|V|}{k})^2 \ \end{align} ```
PowerModelsONM.constraint_mc_transformer_power_yy_traditional_on_off
— Methodconstraint_mc_transformer_power_yy_block_on_off(
pm::PMD.AbstractUnbalancedACRModel,
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
)
Links to and from power and voltages in a wye-wye transformer, assumes tm_fixed is true
Objectives
PowerModelsONM.objective_mc_min_storage_utilization
— Methodobjective_mc_min_storage_utilization(pm::AbstractUnbalancedPowerModel)
Minimizes the amount of storage that gets utilized in favor of using all available generation first
\[\begin{align*} \mbox{minimize: } & \\ & \sum_{\substack{e \in E,t \in T}} \epsilon^{ub}_{e} - \epsilon_{e,t} \\ \end{align*}\]
PowerModelsONM.objective_min_shed_load_block
— Methodobjective_min_shed_load_block(pm::AbstractUnbalancedPowerModel)
Minimum block load shed objective for rolling horizon problem. Note that the difference between this and objective_min_shed_load_block_rolling_horizon
is that the sum over the switches in line 2 of the objective is optional, as determined by user inputs in the model, i.e., enable_switch_state_open_cost
(default: false), and disable-switch-state-change-cost
(default: false).
```math \begin{align} \mbox{minimize: } & \ & \sum{\substack{b \in B,t \in T}} W^{bl}{b,t} \left(1 - z^{bl}{b,t} \right) \ & + \sum{\substack{s \in S,t \in T}} \left[ W^{sw}{s,t} \left(1 - \gamma{s,t} \right )) + W^{\Delta^{\gamma}}{s,t}\Delta^{\gamma}{s,t}\right ]\ & + \sum{\substack{e \in E,t \in T}} \epsilon^{ub}{e} - \epsilon{e,t} \ & + \sum{\substack{g \in G,t \in T}} f1 P{g,t} + f_0 \end{align}```
PowerModelsONM.objective_min_shed_load_block_rolling_horizon
— Methodobjective_min_shed_load_block_rolling_horizon(pm::AbstractUnbalancedPowerModel)
Minimum block load shed objective for rolling horizon problem. Note that the difference between this and objective_min_shed_load_block
is that the sum over the switches in line 2 of the objective is non-optional.
```math \begin{align} \mbox{minimize: } & \ & \sum{\substack{b \in B,t \in T}} W^{bl}{b,t} \left(1 - z^{bl}{b,t} \right) \ & + \sum{\substack{s \in S,t \in T}} \left[ W^{sw}{s,t} \left(1 - \gamma{s,t} \right )) + W^{\Delta^{\gamma}}{s,t}\Delta^{\gamma}{s,t}\right ]\ & + \sum{\substack{e \in E,t \in T}} \epsilon^{ub}{e} - \epsilon{e,t} \ & + \sum{\substack{g \in G,t \in T}} f1 P{g,t} + f_0 \end{align}```
PowerModelsONM.objective_min_shed_load_traditional
— Methodobjective_min_shed_load_traditional(pm::AbstractUnbalancedPowerModel)
Minimum block load shed objective for rolling horizon problem. Note that the difference between this and objective_min_shed_load_traditional_rolling_horizon
is that the sum over the switches in line 2 of the objective is optional, as determined by user inputs in the model, i.e., enable_switch_state_open_cost
(default: false), and disable-switch-state-change-cost
(default: false).
\[\begin{align*} \mbox{minimize: } & \\ & \sum_{\substack{l \in L,t \in T}} W^{d}_{l,t} \left(1 - z^{d}_{l,t} \right) \\ & + \sum_{\substack{s \in S,t \in T}} \left[ W^{sw}_{s,t} \left(1 - \gamma_{s,t} \right )) + W^{\Delta^{\gamma}}_{s,t}\Delta^{\gamma}_{s,t}\right ]\\ & + \sum_{\substack{e \in E,t \in T}} \epsilon^{ub}_{e} - \epsilon_{e,t} \\ & + \sum_{\substack{g \in G,t \in T}} f_1 P_{g,t} + f_0 \end{align*}\]
PowerModelsONM.objective_min_shed_load_traditional_rolling_horizon
— Methodobjective_min_shed_load_traditional_rolling_horizon(pm::AbstractUnbalancedPowerModel)
Minimum block load shed objective for rolling horizon problem. Note that the difference between this and objective_min_shed_load_traditional
is that the sum over the switches in line 2 of the objective is non-optional.
\[\begin{align*} \mbox{minimize: } & \\ & \sum_{\substack{l \in L,t \in T}} W^{d}_{l,t} \left(1 - z^{d}_{l,t} \right) \\ & + \sum_{\substack{s \in S,t \in T}} \left[ W^{sw}_{s,t} \left(1 - \gamma_{s,t} \right )) + W^{\Delta^{\gamma}}_{s,t}\Delta^{\gamma}_{s,t}\right ]\\ & + \sum_{\substack{e \in E,t \in T}} \epsilon^{ub}_{e} - \epsilon_{e,t} \\ & + \sum_{\substack{g \in G,t \in T}} f_1 P_{g,t} + f_0 \end{align*}\]
PowerModelsONM.objective_robust_min_shed_load_block_rolling_horizon
— Methodobjective_robust_min_shed_load_block_rolling_horizon(pm::AbstractUnbalancedPowerModel, scenarios::Vector{Int})
Minimum block load shed objective (similar to objectiveminshedloadblockrollinghorizon) for robust partitioning problem considering uncertainty
Ref extensions
PowerModelsONM.ref_add_load_blocks!
— Methodref_add_load_blocks!(ref::Dict{Symbol,<:Any}, data::Dict{String,<:Any})
Ref extension to add load blocks to ref for all time steps
PowerModelsONM.ref_add_options!
— Methodref_add_options!(ref::Dict{Symbol,<:Any}, data::Dict{String,<:Any})
Ref extension to add options to ref for all time steps