Single Phase Models
BusInjectionModel.jl provides methods to build many different variations of the Branch Flow Model, including single phase and multiphase models. Each of the single phase model types supported are documented below.
Unrelaxed models
The Unrelaxed multiphase model is built by passing a JuMP.Model, Network{SinglePhase}, and the Unrelaxed type to build_bim_rectangular! or build_bim_polar!.
Rectangular Voltage
net = CommonOPF.Network_IEEE13_SinglePhase()
m = JuMP.Model()
build_bim_rectangular!(m, net, Unrelaxed)
println("Variable information:")
CommonOPF.print_var_info(net)
println("Constraint information:")
CommonOPF.print_constraint_info(net)Variable information:
┌────────┬───────────────────────────────────────────────────────────┬──────────────────┬─────────────┐
│ symbol │ description │ units │ dimensions │
├────────┼───────────────────────────────────────────────────────────┼──────────────────┼─────────────┤
│ s0 │ complex net bus power injection at the net.substation_bus │ ComplexPowerUnit │ (Bus, Time) │
├────────┼───────────────────────────────────────────────────────────┼──────────────────┼─────────────┤
│ v │ complex voltage vector │ VoltUnit │ (Bus, Time) │
└────────┴───────────────────────────────────────────────────────────┴──────────────────┴─────────────┘
Constraint information:
┌─────────────────────────────────┬────────────────────────────────────────────┬──────────────────────────────────────┬─────────────┐
│ symbol │ description │ set_type │ dimensions │
├─────────────────────────────────┼────────────────────────────────────────────┼──────────────────────────────────────┼─────────────┤
│ bus_power_injection_constraints │ net power injection definition at each bus │ MathOptInterface.EqualTo{ComplexF64} │ (Bus, Time) │
└─────────────────────────────────┴────────────────────────────────────────────┴──────────────────────────────────────┴─────────────┘The math underlying the model is as follows:
\[s_j = \sum_{k: j \sim k} Y_{jk}^* \left( |v_j|^2 - v_j v_k^* \right) \quad \forall j \in \mathcal{N}\]
For the nomenclature see TODO.
Polar Voltage
net = CommonOPF.Network_IEEE13_SinglePhase()
m = JuMP.Model()
build_bim_polar!(m, net, Unrelaxed)
println("Variable information:")
CommonOPF.print_var_info(net)
println("Constraint information:")
CommonOPF.print_constraint_info(net)Variable information:
┌────────┬──────────────────────────────────┬───────────────────┬─────────────┐
│ symbol │ description │ units │ dimensions │
├────────┼──────────────────────────────────┼───────────────────┼─────────────┤
│ pj │ real net bus power injection │ RealPowerUnit │ (Bus, Time) │
├────────┼──────────────────────────────────┼───────────────────┼─────────────┤
│ qj │ reactive net bus power injection │ ReactivePowerUnit │ (Bus, Time) │
├────────┼──────────────────────────────────┼───────────────────┼─────────────┤
│ v_ang │ voltage angle │ RadiansUnit │ (Bus, Time) │
├────────┼──────────────────────────────────┼───────────────────┼─────────────┤
│ v_mag │ voltage magnitude │ VoltUnit │ (Bus, Time) │
└────────┴──────────────────────────────────┴───────────────────┴─────────────┘
Constraint information:
┌──────────────────────────────────────────┬─────────────────────────────────────────────────────┬───────────────────────────────────┬─────────────┐
│ symbol │ description │ set_type │ dimensions │
├──────────────────────────────────────────┼─────────────────────────────────────────────────────┼───────────────────────────────────┼─────────────┤
│ bus_reactive_power_injection_constraints │ net reactive power injection definition at each bus │ MathOptInterface.EqualTo{Float64} │ (Bus, Time) │
├──────────────────────────────────────────┼─────────────────────────────────────────────────────┼───────────────────────────────────┼─────────────┤
│ bus_real_power_injection_constraints │ net real power injection definition at each bus │ MathOptInterface.EqualTo{Float64} │ (Bus, Time) │
└──────────────────────────────────────────┴─────────────────────────────────────────────────────┴───────────────────────────────────┴─────────────┘The math underlying the model is as follows:
\[\begin{aligned} &p_j = |v_j| \sum_{i \in 1\dots\mathcal{N}} |v_i| \left[ G_{\left[i,j\right]} \cos(\angle v_j - \angle v_i) + B_{\left[i,j\right]} \sin(\angle v_j - \angle v_i) \right] \quad \forall j \in \mathcal{N} \\ &q_j = |v_j| \sum_{i \in 1\dots\mathcal{N}} |v_i| \left[ G_{\left[i,j\right]} \sin(\angle v_j - \angle v_i) - B_{\left[i,j\right]} \cos(\angle v_j - \angle v_i) \right] \quad \forall j \in \mathcal{N} \\ &|v_{\text{substation bus}}| = v_0 \\ &\angle v_{\text{substation bus}} = 0 \end{aligned}\]
DC Model
net = CommonOPF.Network_IEEE5()
m = JuMP.Model()
build_bim_polar!(m, net, DC)
println("Variable information:")
CommonOPF.print_var_info(net)
println("Constraint information:")
CommonOPF.print_constraint_info(net)Variable information:
┌────────┬───────────────────────────────┬───────────────┬─────────────┐
│ symbol │ description │ units │ dimensions │
├────────┼───────────────────────────────┼───────────────┼─────────────┤
│ pj │ real net bus power injection │ RealPowerUnit │ (Bus, Time) │
├────────┼───────────────────────────────┼───────────────┼─────────────┤
│ v_ang │ voltage angle │ RadiansUnit │ (Bus, Time) │
└────────┴───────────────────────────────┴───────────────┴─────────────┘
Constraint information:
┌────────┬─────────────┬──────────┬────────────┐
│ symbol │ description │ set_type │ dimensions │
└────────┴─────────────┴──────────┴────────────┘The math underlying the model is as follows:
\[\boldsymbol p_j = -\boldsymbol B \boldsymbol \theta_j \]
where
\[B = \text{imag}(Y)\]