Methods

Model builders

BusInjectionModel.build_bim_rectangular!Function
build_bim_rectangular!(m::JuMP.AbstractModel, net::Network, mtype::ModelType=Unrelaxed)

Top-level model builder that dispatches the ModelType enum

source
build_bim_rectangular!(m::JuMP.AbstractModel, net::Network{SinglePhase}, ::Val{Unrelaxed})

Model builder for single-phase, unrelaxed BIM with rectangular voltage variables. See the Single Phase Bus Injection Model (Unrelaxed) math for details.

Adds the variables:

  • m[:v] with complex values for all busses in CommonOPF.busses(net)
  • m[:s0] for the complex slack bus power injection
source
build_bim_rectangular!(m::JuMP.AbstractModel, net::Network{MultiPhase}, ::Val{Unrelaxed})

Model builder for multi-phase, unrelaxed BIM with rectangular voltage variables. See the Multi-Phase Bus Injection Model (Unrelaxed) math for details.

Adds the variables:

  • m[:v] with complex values for all busses in CommonOPF.busses(net)
  • m[:s0] for the complex slack bus power injection
source
build_bim_rectangular!(m::JuMP.Model, net::Network, ::Val{FixedPointLinear})

Build the fixed point linear model.

source
BusInjectionModel.build_bim_polar!Function
build_bim_polar!(m::JuMP.AbstractModel, net::Network{SinglePhase}, ::Val{DC})

Build the classic DC OPF model.

Variables:

  • pj net bus power injection variable
  • p_gen all generators are given real power injection decision variables at their busses.
  • v_ang voltage angle at all busses
source
build_bim_polar!(m::JuMP.AbstractModel, net::Network, mtype::ModelType=Unrelaxed)

Top-level model builder that dispatches the ModelType enum

source
build_bim_polar!(m::JuMP.AbstractModel, net::Network{SinglePhase}, ::Val{Unrelaxed})

Model builder for single-phase, unrelaxed BIM with polar voltage variables. See the Single Phase Bus Injection Model (Unrelaxed) math for details.

Adds the variables:

  • m[:v_mag] for all busses in CommonOPF.busses(net)
  • m[:v_ang] for all busses in CommonOPF.busses(net)
  • m[:pj] and m[:qj] for the bus power injections
  • m[:q_gen] for any P-V busses (via the CommonOPF.Generator)
source
BusInjectionModel.add_or_update_fixed_point_constraintFunction
 add_or_update_fixed_point_constraint(
    m::JuMP.Model, 
    net::Network, 
    v_fp::Matrix{ComplexF64},
)

Apply the fixed point voltage constraint to the model m. If :fixed_point_con in keys(m.obj_dict) then the existing constraints are deleted first.

source
BusInjectionModel.add_complex_terminal_power_variableFunction
add_complex_terminal_power_variable(
    m::JuMP.Model, 
    net::Network, 
    trmnls::Vector{CommonOPF.BusTerminal},
)

Add an :s variable to the model. If the net.bounds for s missing the default bounds are zero (to keep the model bounded).

source