Radial AC power flows

SpineOpt includes single-phase equivalent AC optimal power flow (OPF) calculation. It is suitable for planning studies and simulating balanced power flow in different operational situations. The AC power flow calculation is suitable for radial networks typical in distribution networks.

Defining the problem for AC flow calculation

Power lines

In the following, it is described how to set up a connection in order to represent an overhead line or cable.

connection: A connection represents the electricity line being modelled. As usual, one has to define the relationships connection__to_node and connection__from_node : These relationships need to be introduced between the connection and each node. The connection should be unidirectional, in other words there should only be connection__from_node or connection__to_node relationship between a node and a connection. Also it is not recommended to define multiple routes for one connection object.

connection__node__node: This relationship should be defined so that the first node is the source bus and second node the destination bus. The connection_has_ac_flow should be set true for this relationship to enable AC flow and indicate positive direction. N.B. Do not manually fix an efficiency for the line (such as via a fix_ratio_out_in_connection_flow parameter).

A Π model with shunt susceptance is used for lines. The physical properties include the series reactance, represented by the parameter reactance, series resistance represented by the parameter resistance and shunt susceptance by the parameter line_shunt_susceptance. It is recommended that these parameters are given as per-unit values.

Buses

In a AC power flow model, node corresponds to a bus. To enable the AC flow calculation, one or more grid objects whose parameter physics_type is set to acflow_physics must be defined. The grid objects must be tied to nodes via node__grid relationships.

Limits on the bus voltage magnitude (stated as per-unit value) can be enforced through the max_voltage and min_voltage parameters. You cannot set limits on the voltage phase angle.

Loads

There is no specific load component. Loads are given as parameters for buses. As usual, you can define a demand value via the demand parameter. This refers to real power demand. Reactive power demand can be defined via the demand_reactive parameter. It is recommended that these parameters are given as per-unit values. However, you can also define power_base for the bus, which allows you to give demand values in absolute units and keep other parameters as per-unit values.

Generators

Generators are represented by SpineOpt units. In a AC power flow model, units can produce both active and reactive power. Units can also absorb reactive power. Reactive power capability is automatically triggered if the unit is connected via unit__to_node or node__to_unit relationship to an AC enabled bus.

It is recommended that the parameter vom_cost_reactive be set to a positive value. Otherwise the relaxed conic constraint may not become binding.

Transformers

There is no separate component for transformers. In the per-unit system you can model a transformer as a connection.

Investments

Power flow is governed by the impedance parameters given for a specific line. The model formulation does not allow adjusting the line sizing within the model. However, the model can include binary investment decisions (go/no-go). Thus investment_variable_type needs to be set to binary or integer. capacity_per_connection should be set to a value which is at least as large as the estimated power carrying capacity of the candidate line. Parameter investment_count_max_cumulative should be set to 1. See the chapter about investment optimization for the other parameters and relationships you need to set to activate investments.

Results

The variable node_voltage_squared tells the squared voltage magnitude in a bus. The variable connection_flow tells the real power flow in a power line, measured in the positive direction (from source to destination bus). Similarly, the variable connection_flow_reactive tells the reactive power flow in a power line. See Managing output about how to add outputs to the model.

Formulations

Currently, there are three formulations for the AC OPF. In decreasing order of accuracy these are:

  • Second order cone programming (SOCP) relaxation of optimal power flow problem in rectangular coordinates.
  • Linear approximation of the SOCP relaxation
  • Linear distflow lossless formulation

The SOCP relaxation is the most accurate of these but in practise only very small models may be feasible. Solver with support for SOCP type models is needed, controlled by solver_mip. See JuMP documentation for available solvers. The Linear distflow formulation can be accurate when voltages remain close to 1 p.u. and is computationally very light. The Linear approximation of SOCP relaxation is between these.

Selection of the formulation takes place by the model-wide parameter ac_opf_model_formulation. The default is the linear approximation of the SOCP relaxation. All formulations are suitable only for radial networks, which are typically found in distribution grids. If loops are present in the network, solution will be returned but the results will not be correct.

Warning

Please note that none of the formulations track the voltage phase angle across the network and thus the results for looped networks will not be correct.

Creating an Example

If we have model that is not currently set up AC flow, we can take the following steps to create our first AC OPF model. This assumes that the basic necessities in the SpineOpt database template already exist.

Model reference

Parameters for AC flow calculation

Parameter NameObject Class ListDescription
ac_opf_model_formulationmodelThe type of model formulation used for AC flow simulation.
vom_cost_reactiveunit__to_node and node__to_unitThe cost of injecting or absorbing reactive power to the bus or from the bus.
vom_costunit__to_node and node__to_unitThe cost of injecting or absorbing real power to the bus or from the bus.
resistanceconnectionThe per-unit resistance of the line.
reactanceconnectionThe per-unit reactance of the line.
line_shunt_susceptanceconnectionThe per-unit shunt susceptance of the line.
demandnodeThe real power demand (p.u. unless you have set power_base).
demand_reactivenodeThe reactive power demand.
power_basenodeThe base power used if calculating with absolute demand values.