Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

Optimal Power Flow

Introduction to Optimal Power Flow models in PLEXOS

Prerequisites
Before reading this guide we recommend reading the document Concise User Guide.

Version
This document is current as at PLEXOS Version 5.102 R07 and was last modified 24 August
2009.

Document Conventions
The following conventions are used:
 PLEXOS classes are shown underlined like Generator
 Properties are shown in brackets like Generator [Max Capacity]
 Collections are shown bracketed like Generator [Fuels]

About This Document


This document describes the methods and use of optimal power flow algorithms in the PLEXOS
software.
Optimal Power Flow

Contents
1 Introduction .............................................................................................................................................................. 4
1.1 Definitions ........................................................................................................................................................ 4
1.2 OPF Methods ................................................................................................................................................... 5
2 Linearised DC OPF .................................................................................................................................................. 6
2.1 Definitions ........................................................................................................................................................ 6
2.2 Motivation ........................................................................................................................................................ 6
2.3 Formulation ..................................................................................................................................................... 6
3 Fixed Shift Factor OPF........................................................................................................................................... 7
3.1 Introduction .................................................................................................................................................... 7
3.2 Formulation ..................................................................................................................................................... 7
4 Shift Factors .............................................................................................................................................................. 9
4.1 Phase Angles and Injections ..................................................................................................................... 9
4.2 Single Slack Bus........................................................................................................................................... 10
4.3 Distributed Load Slack ............................................................................................................................. 10
4.4 Distributed Generation Slack ................................................................................................................ 10
4.5 Example .......................................................................................................................................................... 11
Single Slack Bus .................................................................................................................................................... 11
Distributed Load Slack Case ............................................................................................................................ 12
5 Economic Dispatch .............................................................................................................................................. 13
6 Locational Marginal Prices ............................................................................................................................... 14
6.1 Energy Charge ............................................................................................................................................. 15
6.2 Congestion Charge ..................................................................................................................................... 16
6.3 Marginal Loss Charge ............................................................................................................................... 16
6.4 Marginal Loss Factor................................................................................................................................. 17
7 Variable Shift Factor OPF.................................................................................................................................. 17
7.1 Introduction ................................................................................................................................................. 17
7.2 Formulation .................................................................................................................................................. 17
8 Loss Modelling ...................................................................................................................................................... 19
8.1 Definitions ..................................................................................................................................................... 19
8.2 Loss Data ........................................................................................................................................................ 20
8.3 Loss Models .................................................................................................................................................. 20
8.4 Loss Models in FS-OPF ............................................................................................................................. 21

Page 2
Optimal Power Flow

Quadratic ................................................................................................................................................................. 21
Piecewise Linear................................................................................................................................................... 22
SLP on Loss Functions ....................................................................................................................................... 22
SLP on Marginal Loss Factors ......................................................................................................................... 22
8.5 Loss Models in VS-OPF ............................................................................................................................. 24
Piecewise Linear................................................................................................................................................... 24
Non-physical Losses ........................................................................................................................................... 25
SLP of Loss Functions ......................................................................................................................................... 26
Quadratic ................................................................................................................................................................. 26
8.6 Losses Embedded in the Load............................................................................................................... 27
8.7 Special Loss Functions ............................................................................................................................. 28
Custom Piecewise Linear Functions ............................................................................................................ 28
Custom Quadratic Loss Equations ................................................................................................................ 28
Marginal Loss Factor Equations .................................................................................................................... 29
8.8 Approximating Losses Using a Penalty Function .......................................................................... 29
9 Security-Constrained Unit Commitment .................................................................................................... 31
9.1 Calculation of Contingency Shift Factors .......................................................................................... 31
9.2 Generator Contingencies ......................................................................................................................... 34
Generation Shift Factor Calculation for the Single Slack ..................................................................... 34
Generation Shift Factor Calculation for the Distributed Slack .......................................................... 35
Flow constraint changes due to the generator outage ......................................................................... 36
9.3 Example .......................................................................................................................................................... 36
Contingency on single line ............................................................................................................................... 36
Contingencies on all lines ................................................................................................................................. 38
10 Transmission Settings ................................................................................................................................... 41
11 Data for 7-Node System ................................................................................................................................ 42
11.1 Network Diagram ....................................................................................................................................... 42
11.2 Input Data ...................................................................................................................................................... 44
11.3 Shift Factors .................................................................................................................................................. 45
12 Bibliography ...................................................................................................................................................... 46

Page 3
Optimal Power Flow

1 Introduction

1.1 Definitions
We define the following terms:

Kirchhoff’s Current Law (KCL)


The current entering any junction is equal to the current leaving that junction: see Power System
Modelling 101

Kirchhoff’s Voltage Law (KVL)


The sum of all the voltages around the loop is equal to zero: see Power System Modelling 101

AC line
A line in the transmission network whose impedance is modelled: in PLEXOS this means that at
least the Line [Reactance] and [Resistance] are defined. AC lines are subject to KCL and KVL.

Bus
Constant voltage construction to which transmission lines are connected.

Node
In PLEXOS, nodes are the fundamental connection points for transmission lines, generators and
other elements such as purchasers. Therefore we use the term “node” interchangeably with
“bus”.

DC line
A line in the transmission network whose flow is subject to KCL but not KVL: in PLEXOS DC lines
are defined using only [Resistance].

Load Participation Factor


For convenience loads are often defined on aggregate at the region level, where a region
contains a number of transmission nodes. The load participation factor for a node is thus the
proportion of the region load that occurs at the node. Region load input combined with static
load participation factors can be exploited by PLEXOS when computing the OPF, however
PLEXOS permits variable load participation factors and even loads defined directly on the
nodes.

OPF
Optimal power flow: refers to the generator dispatch and resulting AC power flows that is
minimum cost and feasible with respect to thermal limits on the AC transmission lines. The OPF
might include other constraints such as interface limits, and other decisions such as the optimal
flow on DC lines and phase shifter angles.

Linearised DC-OPF
The OPF using a linearisation of the power flow equations which considers only real power
flows and assumes voltages are all 1 p.u. It is important not to confuse Linearised DC-OPF with a
transportation solution. In a transportation model the flow on all lines is controllable, but in a
DC-OPF the KVL constraints are applied so flows mimic AC flows.

Page 4
Optimal Power Flow

Shift Factor
The additional power flow that results from a unit increase in injection at one point in the
network matched by a simultaneous withdrawal at one or more pre-defined slack bus(es).

PTDF
Power Transfer Distribution Factor: another name for a shift factor.

Nodal Pricing
Nodal pricing refers to the calculation of electric prices at each node/bus in a power network,
whereby the price reflects the marginal cost (to the system) of serving one more unit of load at
that bus, or alternatively the price (the system) would be prepared to pay for one more unit of
generation at the node.

Locational Marginal Pricing


Locational marginal pricing (LMP) is another name for nodal pricing. The price at a node can be
referred to as its nodal price, or its locational marginal price.

1.2 OPF Methods


PLEXOS models power flows using a linearised DC-OPF. For the purposes of determining real
power flows, the linearised DC-OPF assumes that resistance is small and voltages are all 1 p.u.
This does not, however, preclude the modelling of losses. For example, losses are implemented
in both the New Zealand and Singapore electricity markets using a linearised DC-OPF. Generic
linear constraints can be defined to represent voltage and other AC-OPF issues.

PLEXOS provides two DC-OPF formulations: set by the option Transmission [OPF Method]:

Fixed Shift Factor OPF


Network shift-factors are pre-computed and used to create “side-constraints” to enforce
transmission constraints and model transmission losses.

Variable Shift Factor OPF


Bus (node) phase angles and branch (line) flows are decision variables in the optimisation, thus
the shift-factors are implicit and no pre-computation is required, but the formulation size is
potentially very large.

These options represent the two most commonly used DC-OPF formulations with some unique
and powerful enhancements in modelling losses and security-constrained optimal power flow.

The PLEXOS implementation of these methods is sufficiently flexible that AC network sections
can be combined with non-AC network sections (transportation network), and the network
topography does not need to be contiguous i.e. the network may consist of ‘islanded’ buses or
segments. This feature is particularly useful for modelling AC transmission flows and
constraints in a subset of the network, where detailed analysis is required, while treating the
rest of the network as a more aggregated representation. It is also suitable for multi-region
studies where the regions are connected only by DC lines.

This document first describes the linearised DC-OPF in general, then the Fixed Shift Factor OPF
in PLEXOS. Derivation of nodal prices is explained, then transmission losses. Finally the Variable
Shift Factor OPF is described.

Page 5
Optimal Power Flow

2 Linearised DC OPF
The following is a derivation and motivation for the linearised DC-OPF. This discussion is
adapted from (Broad, 1996).

2.1 Definitions
𝑟 + 𝑗𝑥 impedance represented by the resistance and reactance respectively
𝐺 + 𝑗𝐵 real and imaginary terms of admittance (inverse of impedance). Note that the
approximation of the imaginary term, 1 𝑥 is called susceptance.
bus constant voltage construction to which transmission lines are connected
𝑉𝑞 indicates voltage magnitude and phase angle at a system bus
p.u. “per unit” indicates that the quantity has been scaled down for power calculations,
where the scaling is specified by both a kilovolt and megawatt rating for any given
section of the power system

2.2 Motivation
The linearised DC load flow model is motivated by the observations that in large high voltage
power systems:
1. Line reactance is significantly larger than line resistance x/r 1.0;
2. Bus voltage magnitudes are very similar |V| 1.0 p.u.; and
3. The phase angle difference over transmission lines is small e.g. one would expect that
any given line would have an angular difference less than 30°.

Hence the following approximations can be made:


𝑟
 𝐺 = 2 2 ≅0;
𝑟 +𝑥
−𝑥 1
 𝐵= 𝑟 2 +𝑥 2
≅ 𝑋 ; often the term 𝑔 = 1 𝑥 (susceptance) is used in power equations;
 cos 𝑞𝑘 − 𝑞𝑙 ≅ 1 this is the first term of the power series equivalent of cos(); and
 sin 𝑞𝑘 − 𝑞𝑙 ≅ 𝑞𝑘 − 𝑞𝑙 this is the first term of the power series equivalent of sin().

(Broad, 1996) shows that these assumptions lead to the equation for power flow on a line:

𝑓𝑘𝑙 = −𝐵𝑘𝑙 𝑞𝑘 − 𝑞𝑙 = 𝑔𝑘𝑙 𝑞𝑘 − 𝑞𝑙

where 𝑔𝑘𝑙 is the susceptance such that 𝑔𝑘𝑙 = −𝐵𝑘𝑙 = 1 𝑥 .

Thus the power flow equations are entirely linear and can be represented directly in a linear
programming (LP) framework.

2.3 Formulation
To formulate the OPF in PLEXOS, reactance is converted to susceptance using the formula:

𝑔𝑘𝑙 = 1 𝑥

The susceptance determines the power flow on a line using the equation:

𝑓𝑘𝑙 = 𝑔𝑘𝑙 𝑞𝑘 − 𝑞𝑙

Page 6
Optimal Power Flow

In this equation 𝑞𝑘 − 𝑞𝑙 is the phase angle difference between the buses at each end of the line,
measured in radians.

3 Fixed Shift Factor OPF

3.1 Introduction
The Fixed Shift Factor OPF (FS-OPF) model is a fully integrated transmission-constrained
production cost model designed for transmission studies in large networks i.e. networks with
10,000's of buses and transmission lines. However, it can be equally applied to smaller
networks.

The FS-OPF employs a linearised DC approximation to the optimal power flow problem. It does
a precomputation of network shift factors, which makes the OPF very efficient to solve
particularly when the number of line flows and/or buses whose locational marginal price (LMP)
needs to be calculated is limited, e.g. you might wish to enforce limits only above 60kV and the
FS-OPF is able to exploit this to greatly speed the OPF calculation.

Unlike many other implementations of DC-OPF, the PLEXOS FS-OPF can handle:
 random outages on network lines; and
 addition of new nodes/lines or retirement of nodes/lines mid-simulation.

The FS-OPF can also model transmission losses at all voltage levels in a very fast efficient
manner.

3.2 Formulation
Referring to the line flow definition of DC-OPF:

𝑃𝑗 = 𝐵𝑗 × 𝜃𝑏 − 𝜃𝑎

where:
𝑃𝑗 is the real power flow on transmission line j flowing from node a to node b (in
megawatts)
𝐵𝑗 is the susceptance of line j, which in this linearization is equal to the inverse of the
reactance 𝑋𝑗 (p.u.)
𝜃𝑎 , 𝜃𝑏 are the phase angles at the sending and receiving nodes respectively.

In the FS-OPF the equation for the flow on a branch in the AC network is computed as:

𝑃𝑗 = 𝑃𝑇𝐷𝐹𝑖,𝑗 × 𝑃𝑖
𝑖

where:
𝑃𝑇𝐷𝐹𝑖,𝑗 is the shift-factor between line j and bus i
𝑃𝑖 is the net injection (net of generation and load) at bus i

A shift-factor is equal to the change in flow on the line j for a one megawatt increment in
injection at bus i and simultaneous withdrawal at the slack bus(es). The shift-factors are a
function of the impedances of the paths in the network. The shift-factors though also depend on

Page 7
Optimal Power Flow

the choice of slack bus(es). For any choice of slack bus(es) there will be a set of shift-factors that
completely describe how injections at each bus in the network affect flows throughout the
transmission system. Thus the shift factors can be precomputed and stored prior to the
simulation. During the simulation, the shift factors can be used to compute the flow on any AC
path that is implied by the current set of network injections (generation and load pattern). They
can then be used to formulate constraints that ensure the generation and load solution is
feasible with respect to line thermal limits and other user-defined constraints involving line
flows1.

The transmission-constrained production cost problem using precomputed shift factors


phrased as a linear programming problem is as follows:

Minimize
𝑐𝑘 × 𝑔𝑘
𝑘
subject to

System Supply Demand Balance: (generation = demand):


𝑔𝑘 = D
𝑘
Flow Limits:

𝑓𝑗 ≤ 𝑃𝑇𝐷𝐹𝑖,𝑗 × 𝑔𝑘 − 𝐿𝑃𝐹𝑖 × 𝐷 ≤ 𝑓𝑗 ∀𝑗
𝑖 𝑘∈𝑖
Generation Limits:
𝑔𝑘 ≤ 𝑔𝑘 ≤ 𝑔𝑘

In this formulation:
𝑐𝑘 is the unit cost of production from generator k
𝑔𝑘 is the generation by unit k, which must be between minimum 𝑔𝑘 and maximum 𝑔𝑘
D is the total system demand (load)
𝑖 𝑃𝑇𝐷𝐹𝑖,𝑗 × 𝑘∈𝑖 𝑔𝑘 − 𝐿𝑃𝐹𝑖 × 𝐷 is the power flow on path j, which must be between

minimum 𝑓𝑘 and maximum 𝑓𝑘


LPF𝑖 is the load participation factor for node i

This simplified formulation illustrates how the shift-factors are used to form the transmission
constraints.

In the FS-OPF sets of shift-factors are computed as required during the simulation. A new set is
required for each unique transmission state (topology).

The shift-factors are used in two ways:


1. To compute the flow on Lines, Transformers and Interfaces and any flows involved in a
user-defined transmission constraint (using Constraint objects) and formulate
constraints to enforce their limits;

1Note that in PLEXOS the Diagnostic switch “Shift Factors” will print the shift factors for the network to a
text file located in the same folder as the log file for the simulation. One file is printed for each outage
state of the network , and named with a unique hash-code.

Page 8
Optimal Power Flow

2. To compute the LMP decomposition: the components that make up the nodal prices (see
below).

PLEXOS allows you to choose the slack bus(es) used when computing shift-factors. According to
the definition of a shift factor, the choice of slack bus or buses will affect the calculated values of
the shift-factors: but the choice of slack bus(es) is arbitrary with respect to solving the
production cost problem. However the choice of slack bus does affect the LMP decomposition as
explained below.

Note that if using a single slack bus and the chosen slack bus is far away from the load centres of
the network, there may be many shift-factors computed that are “small”, and this could make
the optimization problem numerically unstable and/or unnecessarily bulky. Distributing the
slack across multiple buses rather than to a single bus can potentially yield a set of shift-factors
that are more stable.

4 Shift Factors
In total there are three available methods for allocation of slack for shift-factor calculations:
1. Single Slack Bus (default)
2. Distributed Load Slack
3. Distributed Generation

Within the latter option there are two alternatives, discussed below. The slack bus selection is
labelled “Shift Factor (PTDF) Method” in Figure 6.

4.1 Phase Angles and Injections


From the linearised DC-OPF we have that:

θ= XP

where:
θ is the vector of node phase angles
P is the vector of node injections
X is the inverse of Y-bus: the N × N matrix of network impedances

The off-diagonal coefficients of Y-bus are simply the susceptance for the line between the buses.
The on-diagonal terms are the sum of all path susceptances into the bus:

1 1
− ⋯
𝑥𝑗 𝑥𝑁,1
𝑗 ∈1
Y-bus = ⋮ ⋱ ⋮
1 1
⋯ −
𝑥1,𝑁 𝑥𝑗
𝑗 ∈𝑁

Given X (the inverse of Y-bus) we can calculate the node phase angles for any set of injections
P. From the phase angles we can then compute the flow on any path in the network. This is the
way shift factors are computed.

Page 9
Optimal Power Flow

However, directly inverting Y-bus is not practical, for all but the smallest systems because the
computational effort required scales exponential with N. Thus, PLEXOS instead:

1. Creates the set of equations A𝑥 = b, where A is the Y-bus matrix, x is a vector of bus
phase angles (in radians) and b is a vector of bus injections (in megawatts)
2. Solves A𝑥 = b for each row i in x, with the vector b having zero values except for unity in
row i
3. Computes the shift-factor for each path j, 𝑃𝑇𝐷𝐹𝑖,𝑗 = 𝑎𝑖,𝑗 × 𝑥𝑗 − 𝑥𝑖

Note that each “projection” (solution of A𝑥 = b) yields a set of shift-factors for all paths with
respect to injections at each bus i. Thus we must compute one projection for each injection point
(Node that has either generation or load). In a large system this could mean solving thousands
of these projections; however, the relatively simple set of linear equations is solved quickly and
efficiently by modern Simplex codes.

PLEXOS reports progress during the calculation of shift factors with log messages like:
Finished 3721 Y-bus projections. Stored 12125328 shift factors out of 13964913. Time:
0:00:10.609.

4.2 Single Slack Bus


The single slack bus is identified by setting the Node [Is Slack Bus] attribute to true. If no Node
is identified PLEXOS chooses the first Node in the network. The shift-factors are computed by
eliminating from Y-bus the row and column corresponding to the slack bus, then solving the
system of equations A𝑥 = b for each injection point.

4.3 Distributed Load Slack


For an incremental injection at a bus, the slack is distributed across all load buses in the system
in proportion to their loading in a given reference case. The reference nodal load is equal to
Node [Load Participation Factor] multiplied by the Region [Reference Load]. Note that Region
[Reference Load] is a static property and thus only one pattern of loads can be used to set the
load slacks. If Region [Reference Load] is not defined, the Region [Load] defined in the first
period of the planning horizon is used instead.

The solution method here is similar to the single slack bus case, but instead of forming A𝑥 = b
with A as Y-bus, no rows or columns are eliminated i.e. A is N×N in size. The matrix A is singular,
thus we set one of the phase angles (x) to zero. The choice for this node is made by first solving
the system ‘freely’ and then setting the node with lowest angles to zero. The system is then
resolved successively for each row of x that is an injection (generation or load) node. At each
projection i the b vector contains unity less the slack allocation in row i and the set of (negative
signed) normalized loads across the rows corresponding to the load nodes. Thus the sum of
elements in b is always zero.

4.4 Distributed Generation Slack


For an incremental injection at bus i the slack is distributed across all the generation nodes. The
proportion of slack assigned to each node is decided according to the Transmission [Slack Bus
Method] which for generation slack has two options:

1. Distribute in proportion to the generator capacity

Page 10
Optimal Power Flow

2. Distribute in proportion to input reference generation levels (using the Generator


[Reference Generation] input)

The solution method here is similar to the distributed load slack case.

4.5 Example
Consider the 7-Node network in Figure 7 (shown in Section 11). The system has three regions
with loads as in Table 12. The nodes have the load participation factors in Table 11. Note that in
the absence of any Node settings its [Is Slack Bus] attribute to “Yes” Node “1” will default to the
slack bus.

The transmission line impedance and thermal limits data are shown in Table 13. Note, in
linearised DC-OPF, Line [Reactance] only is considered in computing shift factors, though
[Resistance] is used to compute losses during the simulation. The Generator capacity data are
shown in Table 14.

Single Slack Bus


For the purposes of computing shift-factors all that is required to form the Y-bus matrix are the
line impedances shown in Table 13. The system of equations representing Y-bus is as follows:
minimize
OBJ:
subject to
B{2}: - 5.611111111111111e+003 x{2}
+ 5.555555555555555e+002 x{3}
+ 5.555555555555555e+002 x{4}
+ 8.333333333333334e+002 x{5}
+ 1.666666666666667e+003 x{6} = 1e+004
B{3}: + 5.555555555555555e+002 x{2}
- 4.305555555555556e+003 x{3}
+ 3.333333333333334e+003 x{4} = 0e+000
B{4}: + 5.555555555555555e+002 x{2}
+ 3.333333333333334e+003 x{3}
- 4.305555555555556e+003 x{4}
+ 4.166666666666667e+002 x{5} = 0e+000
B{5}: + 8.333333333333334e+002 x{2}
+ 4.166666666666667e+002 x{4}
- 2.916666666666667e+003 x{5}
+ 1.666666666666667e+003 x{7} = 0e+000
B{6}: + 1.666666666666667e+003 x{2}
- 2.5e+003 x{6}
+ 8.333333333333334e+002 x{7} = 0e+000
B{7}: + 1.666666666666667e+003 x{5}
+ 8.333333333333334e+002 x{6}
- 2.5e+003 x{7} = 0e+000
bounds
x{2} free
x{3} free
x{4} free
x{5} free
x{6} free
x{7} free
end

Note the use of the injection (10000 MW) at Node ‘”2”. This is the LP used to compute the shift
factors for all paths for injections into that node. The large injection is used (rather than unity)

Page 11
Optimal Power Flow

to improve numerical stability: an injection of unity would produce very small phase angles and
introduce rounding errors into the shift factors.

The process of solving this set of equations with injections at each point in sequence yields the
set of shift-factors in Table 17. The PLEXOS log file shows the following line once the shift factor
computation is complete:
Finished 7 Y-bus projections. Stored 60 shift factors out of 70. Time: 0:00:00.008.

There are seven “projections” done, one for each injection point (load or generation point).

Interpreting the first few rows of Table 17, an incremental injection at bus “2” and simultaneous
withdrawal at bus “1” (the slack bus) will decrease the flow on the path “1_2” by 0.865, the path
“1_3” by 0.135, the increase the flow on path “2_3” by 0.06027698, and so on.

Distributed Load Slack Case


Here PLEXOS forms the 7×7 matrix of network impedance but does not eliminate any equations:
thus the initial system of equations solved is:
minimize
OBJ:
subject to
B{1}: - 2.416666666666667e+003 x{1}
+ 2e+003 x{2}
+ 4.166666666666667e+002 x{3} = 1e+004
B{2}: + 2e+003 x{1}
- 5.611111111111111e+003 x{2}
+ 5.555555555555555e+002 x{3}
+ 5.555555555555555e+002 x{4}
+ 8.333333333333334e+002 x{5}
+ 1.666666666666667e+003 x{6} = -3.333333333333333e+002
B{3}: + 4.166666666666667e+002 x{1}
+ 5.555555555555555e+002 x{2}
- 4.305555555555556e+003 x{3}
+ 3.333333333333334e+003 x{4} = -1.25e+003
B{4}: + 5.555555555555555e+002 x{2}
+ 3.333333333333334e+003 x{3}
- 4.305555555555556e+003 x{4}
+ 4.166666666666667e+002 x{5} = -6.666666666666666e+002
B{5}: + 8.333333333333334e+002 x{2}
+ 4.166666666666667e+002 x{4}
- 2.916666666666667e+003 x{5}
+ 1.666666666666667e+003 x{7} = -1.083333333333333e+003
B{6}: + 1.666666666666667e+003 x{2}
- 2.5e+003 x{6}
+ 8.333333333333334e+002 x{7} = -3.333333333333333e+003
B{7}: + 1.666666666666667e+003 x{5}
+ 8.333333333333334e+002 x{6}
- 2.5e+003 x{7} = -3.333333333333333e+003
bounds
0e+000 <= x{1} <= 0e+000
x{2} free
x{3} free
x{4} free
x{5} free
x{6} free
x{7} free
end

Page 12
Optimal Power Flow

The right-hand side values equal the (negative of the) normalized slack, equal to the proportion
of total system load that occurs at the bus in the reference load case.

Solving this set of equations for injections at each generation bus yields the set of shift-factors in
Table 18.

5 Economic Dispatch
With the flows in the network being calculated based on the precomputed shift factors, we can
now compute an economic dispatch and optimal power flow i.e. the output levels of all plant
that minimises total production cost and respects thermal limits of the transmission lines in the
network.

The economic dispatch and optimal power flow for the 7-Node system is shown in Figure 1.

PLEXOS reports the data on the lines in the system as in Table 1. Lines “2_5” and “4_5” are
flowing at their thermal limits. There is a shadow price associated with the “2_5” limit. Table 2
shows the solution data for nodes. Note how the prices at each node are different: this is an
example of nodal pricing (or locational marginal pricing) and is caused by the congestion on
Line “2_5”.

Table 1: Line Solution Data

Line Max Min Flow Loss Marginal Marginal Is Congested Shadow


Rating Rating (MW) (MW) Loss (%) Loss Factor 2 Price
(Yes/No)
(MW) (MW) ($/MW)
1_2 120.00 -120.00 4.62 0.00 0.00 1.00 0.00 0.00
1_3 120.00 -120.00 15.38 0.00 0.00 1.00 0.00 0.00
2_3 100.00 -100.00 19.23 0.00 0.00 1.00 0.00 0.00
2_4 100.00 -100.00 0.00 0.00 0.00 1.00 0.00 0.00
2_5 120.00 -120.00 120.00 0.00 0.00 1.00 -1.00 10.53
2_6 200.00 -200.00 130.00 0.00 0.00 1.00 0.00 0.00
3_4 222.00 -222.00 -115.38 0.00 0.00 1.00 0.00 0.00
4_5 60.00 -60.00 60.00 0.00 0.00 1.00 -1.00 0.00
5_7 200.00 -200.00 50.00 0.00 0.00 1.00 0.00 0.00
6_7_1 200.00 -200.00 40.00 0.00 0.00 1.00 0.00 0.00
6_7_2 200.00 -200.00 40.00 0.00 0.00 1.00 0.00 0.00

Table 2: Node Solution Data

Child Name Phase Angle (degrees) Load (MW) Generation (MW) Price ($/MWh)
1 0.00 0.00 20.00 14.95
2 0.13 40.00 304.62 15.00
3 2.12 150.00 0.00 14.69
4 0.13 80.00 255.38 14.60
5 8.38 130.00 0.00 22.42
6 4.60 200.00 150.00 16.86
7 10.10 200.00 70.00 20.57

2 Note that as a convention PLEXOS uses 0 for “No” and -1 for “Yes” in reporting Boolean type values.

Page 13
Optimal Power Flow

Figure 1: 7-Node Economic Dispatch

6 Locational Marginal Prices


Kirchhoff’s Laws require that power imports and exports are balanced at each node of the
network and that power flows with respect to KVL. These two rules are in fact implied by the
network shift factors. Thus the DC-OPF balances supply and demand only at the system level

Page 14
Optimal Power Flow

and not specifically at the node level. The dual solution to the production cost problem above
gives no information about the nodal prices. In this section we describe how the nodal prices
are calculated from the optimal solution to the production cost problem with DC-OPF.

6.1 Energy Charge


A nodal price represents the cost to the system as a whole of a unit change in load at the bus. In
the absence of either constraints or losses all nodal prices will be equal. This uniform price is
referred to as the system lambda or network energy charge. No matter where we perturb load in
the network, the marginal impact on total system cost would be the same.

As we introduce constraints on the transmission flows (either on individual branches or


combinations of flows), the nodal prices diverge. Losses also cause separation of prices across
the network. In this case there is no easily recognisable system lambda. But we could compute a
system lambda by choosing a combination of load/generation buses to increment/decrement,
and compute the change in total system cost:

𝛿𝐶
𝜆=
𝛿𝐷

where:
λ is the system lambda
𝛿𝐶 is the change in total system cost
𝛿𝐷 is the change in load

The choice of load/generation buses is rather arbitrary. However, in the DC-OPF there is a
natural choice of buses being the slack bus(es). And further, the formulation of this model
naturally provides the corresponding system lambda: it is the shadow price (dual variable) on
the supply/demand balance constraint:

𝑔𝑘 = D + L
𝑘

where:
𝑔𝑘 is the generation from generator k
D is the total system-wide power demand (sum of individual bus loads)
L is the total transmission losses in the AC network

Starting with this system lambda, each nodal price can be thought of as being made up of these
three components:

𝜆𝑖 = 𝜆 + 𝛼𝑖 + 𝛽𝑖

where:
𝜆𝑖 is the nodal price
𝛼𝑖 is the node’s congestion charge
𝛽𝑖 is the node’s marginal loss charge

In our 7-Node example the system lambda is the price at the slack bus (Node “1”) and is equal to
$14.95. In the following section we will show how the prices at the other nodes in the network
are calculated from the shift factors and this network energy charge.

Page 15
Optimal Power Flow

6.2 Congestion Charge


The congestion charge is computed by considering all active transmission constraints and
propagating their shadow prices to the nodes using the shift-factors:

𝛼𝑖 = PTDF𝑖,𝑗 × 𝜔𝑗
𝑗

where:
𝛼𝑖 is the congestion charge at node i
𝜔𝑗 is the shadow price on the thermal limit constraints for path j

For binding Interface or user-defined constraints, the shadow price on the limit is multiplied by
the coefficient of the line’s flow in the interface definition.

Note that the congestion charge does not need to be positive. For example if the slack bus(es)
are located on the high price side of a transmission constraint, the nodes on the low priced side
have negative congestion charges.

In our 7-Node example, there is only one transmission limit with a non-zero shadow price in our
economic dispatch and that is for Line “2_5” which has shadow price $10.53. Note that the Line
[Shadow Price] is actually the negative of the shadow price from our LP solution, hence
𝜔2_5 = −10.53.

The congestion charge at Node “1” is zero because this is the slack bus. To compute the
congestion charges in the rest of the network we apply the above formula and shift factors
shown in Table 17. For example, for Node “5”:

𝛼5 = −0.5150942 × −10.53 = 5.42

Hence the price at Node “5” is:

𝜆5 = 𝜆 + 𝛼5 = 14.95 + 5.42 = 22.42

6.3 Marginal Loss Charge


The marginal loss charge reflects the impact that an increment in nodal injection would have on
overall system losses, assuming those losses are absorbed at the slack bus(es). From the optimal
solution this is relatively simple to compute:

𝛽𝑖 = PTDF𝑖,𝑗 × 𝜔𝑗 × 2 × r𝑗 × 𝑓𝑗′
𝑗

where:
𝛽𝑖 is the marginal loss charge at node i
r𝑗 is the resistance on line j
𝑓𝑗′ is the flow on the line j at the optimal solution

Note that 2 × r𝑗 × 𝑓𝑗′ is the marginal loss on line j and is reported as Line [Marginal Loss].

Page 16
Optimal Power Flow

Although it seems intuitive that these charges should always be positive, they can be positive or
negative. For example, if injection at a bus reduces loop flow in the AC network, or provides
generation closer to the loads than the optimal solution, then the MLF will be negative.

See below for examples in the 7-Node network.

6.4 Marginal Loss Factor


The nodal Marginal Loss Factor (MLF), also called a Transmission Loss Factor (TLF), describes
what proportion of a one megawatt increment in injection at the node is actually delivered to
the slack bus(es) after accounting for incremental transmission losses in the AC network. Unlike
shift factors, which are static, the MLF are different for any given set of network injections.
PLEXOS reports Node [Marginal Loss Factor] based on the equation:

𝜆 + 𝛽𝑖
𝑀𝐿𝐹𝑖 =
𝜆

where:
𝜆 is the system energy charge
𝛽𝑖 is the marginal loss charge at node i

Note that this equation relies on the nodal energy charge being a non-zero. In the rare case that
the system energy charge is zero, a zero MLF is reported.

7 Variable Shift Factor OPF

7.1 Introduction
The VS-OPF linear programming formulation for optimal power flow is identical to the
formulation used in the New Zealand and Singapore electricity markets. It is a variation of the
‘textbook’ linearised DC-OPF that models congestion and losses via explicit nodal energy
balancing constraints rather than with a fixed set of shift factors.

As in the FS-OPF nodal prices reflect transmission marginal loss factors as well as congestion.
The primary difference however is that, by modelling a node-by-node energy balance, it
produces a more accurate representation of AC network losses because the losses are ‘sunk’ at
the ends of the transmission lines, not at the nominated slack bus(es).

(Broad, 1996) presents the formulation of a power flow model with quadratic objective and
linear constraints consistent with (F.C. Schweppe, 1998). This quadratic programming (QP)
problem can be adapted to a linear programming (LP) form if directed arcs are used with simple
upper bounds representing the power flow limits. This approach is the basis for the linearised
DC load flow in the PLEXOS VS- OPF: see Loss Modelling later.

7.2 Formulation
The following is the production cost optimisation problem including optimal power flow using
the VS-OPF (lossless case):

Minimize

Page 17
Optimal Power Flow

𝑐𝑘 × 𝑔𝑘
𝑘
subject to

Node Net Injection (net injection = generation – load):


𝑛𝑖 = 𝑔𝑘 − LPF𝑖 × D ∀𝑖
𝑘
Node Power Balance (net injection = exports – imports):
𝑛𝑖 = −𝑞𝑖 × 𝑏𝑗 + 𝑏𝑥 × 𝑞𝑘 − 𝑏𝑦 × 𝑞𝑙 ∀𝑖
𝑗 ∈𝑖 𝑥 𝑖→𝑘 𝑦 𝑙→𝑖
Flow Limits:
𝑓𝑗 ≤ 𝑏𝑗 × 𝑞𝑙 − 𝑞𝑘 ≤ 𝑓𝑗 ∀𝑗
Generation Limits:
𝑔𝑘 ≤ 𝑔𝑘 ≤ 𝑔𝑘

In this formulation:
𝑐𝑘 is the unit cost of production from generator k
𝑔𝑘 is the generation by unit k, which must be between minimum 𝑔𝑘 and maximum 𝑔𝑘
D is the total system demand (load)
𝑏𝑗 is the susceptance for line j
𝑛𝑖 is the net injection at node i
𝑞𝑖 is the phase angle at node i
LPF𝑖 is the load participation factor for node i
𝑥 𝑖 → 𝑘 denotes lines that export out of node i and 𝑦 𝑙 → 𝑖 for those that import

This lossless version of the VS-OPF is mathematically identical to the lossless FS-OPF, but since
the VS-OPF models nodal power balance (and phase angles) explicitly, additional constraints
can be modelled. In particular, the node phase angles should not move outside reasonable
bounds, and the model should adjust the dispatch of generation and transmission to avoid large
phase angle differences across the network, hence the node phase angles are bounded according
to the equation:

−2 ≤ 𝑞𝑖 ≤ 2

Note that the internal load flow calculations are on a p.u. basis, the phase angles calculated
internally are in radians. Radians are converted to degrees for reporting purposes using the
formula:

180𝑞𝑖
𝜃𝑖 =
𝜋

Thus, the reported Node [Phase Angle] property is in degrees.

It is in the modelling of losses that the OPF formulations diverge. The VS-OPF, by virtue of its
use of node phase angle decision variables implicitly accounts for losses when modelling node
power balance, and thus the ‘shift factors’ for the system change according to system losses:
hence the name variable shift factor OPF.

Page 18
Optimal Power Flow

8 Loss Modelling
This section describes the formulation and solution algorithms available in PLEXOS for
modelling power system losses.

8.1 Definitions
We use the following definitions:

Loss
Line thermal losses are a quadratic function of flow. For flow on path m we have:

𝐿𝑗 = 𝑟𝑗 𝑓𝑗2

where 𝑟𝑗 is the resistance (p.u.) on the path, and 𝑓𝑗 is the power flow on the path.

Thus the total system losses are the sum of these path flows:

𝐿= 𝑟𝑗 𝑓𝑗2
𝑗

Note that in the VS-OPF, line flows and losses are modelled directly in the formulation, but in the
FS-OPF the line flows are implied by the vector of bus injections and the shift factors. In the FS-
OPF we use another matrix of factors called the B-matrix to determine the total system losses
for any given set of node injections.

B-matrix
The B-matrix defines the system losses thus:
𝐿 = P𝑇 BP

where:
L is the total losses in the AC system
P is the vector of power injections at the nodes in the network

The elements of B are calculated from the shift-factor matrix (D) and the vector of path
resistances R thus:
𝐽

𝐵𝑖𝑗 = 𝑟𝑗 𝐷𝑗𝑘 𝐷𝑗𝑙


𝑗 =1

where:
path j flows from bus k to bus l.

Marginal Loss
The associated marginal loss is the first-order derivative of the loss function w.r.t. the real
power flow:
𝑗 = 2𝑟𝑗 𝑓𝑗

Page 19
Optimal Power Flow

Marginal Loss Factor


In the context of modelling a power system:
 Losses are loads in the power system i.e. the total generation in the system is equal to
the customer load plus transmission losses.
 Marginal losses generate differentials in nodal prices i.e. when power is flowing
(unconstrained) from bus k to bus l along path j: 𝑙 = 1 + 𝑗 𝑘 and likewise when
𝑙
power is flowing from l to k: 𝑘 = 1+𝑗
.

 The ratio of prices 𝜆𝑙 𝜆𝑘 implied by marginal losses is called the marginal loss factor
between node l and node k

8.2 Loss Data


In PLEXOS, losses can be associated with lines and transformers. For lines there are a number of
ways to define the loss function, but for transformers you must use the [Resistance] property.
Lines provide more options because they can be used to represent collections of lines in a
notional interconnector, or DC lines, either of which could have more complex loss functions
than just quadratic.

For details on loss functions defined other than with resistance see the Section 8.7.

Line or transformer resistance are entered per unit (p.u.) with the MVA base set using the
Transmission [MVA Base] setting. Resistance can be defined on both AC and DC lines.

8.3 Loss Models


Adding modelling of losses to the simulation of a power system is a challenging exercise. The
lossless DC-OPF is a linear model and is thus solved very efficiently using standard linear
programming (LP) codes. Further, it is highly adaptable to the mixed-integer programming
(MIP) environment which can take into account generator unit commitment constraints as well
as other on/off decisions.

However, when we model losses, we are introducing non-linear (quadratic) equations to the
mathematical problem. There are essentially three ways to adapt the existing solution method
to handle this:
1. Formulate the quadratic elements of the problem using non-linear programming. For
the FS-OPF a quadratic representation of the B-matrix is formulated, and for the VS-OPF
the line-by-line quadratic loss functions are formulated. This is the most accurate model.
2. Approximate the quadratic function(s) with piecewise linear function(s) so the problem
remains entirely linear and can be solved in an integrated manner using LP or MIP.
3. Apply Successive Linear Programming (SLP) to the loss function(s), iterating on the
Taylor Expansion of the loss functions until convergence is reached.
4. Like (3) but iterate on the Marginal Loss Factor at each injection point until convergence
is reached.

PLEXOS provides options for modelling losses using all four approaches. The loss model is
selected via the Transmission [Loss Method] setting. Combined with the two OPF algorithms
(FS-OPF and VS-OPF) there are the set of combinations as follows:

Page 20
Optimal Power Flow

Table 3: OPF and Loss Methods

OPF Method FS-OPF VS-OPF


Loss Method
Quadratic Yes Yes
Piecewise Linear Yes(default) Yes (default)
SLP (Loss Functions) Yes Yes
SLP (Marginal Loss Factors) Yes No

See Figure 6 for the Transmission settings that control these options. The loss method is set by
the Transmission [Loss Method] attribute.

Both OPF methods default to loss method “Piecewise Linear”. This is chosen because it is the
loss method most commonly associated with market-clearing engines that use DC-OPF e.g. New
Zealand, Australia, Singapore, Ireland.

Note that for the FS-OPF the SLP on Marginal Loss Factors is the fastest-executing method for
large systems.

This document describes these loss modelling algorithms in detail, and in under what
circumstances you would chose each model.

NOTE: The selection of loss model affects loss modelling for AC lines only. Losses on DC lines are
always modelled using the piecewise linear loss model.

8.4 Loss Models in FS-OPF

Quadratic
PLEXOS formulates the loss functions using conic optimisation. Conic problems are a special
class of general quadratically-constrained (Qc) problems and have the desirable trait that they
can be solved using the interior point method in the same way that linear (LP) and quadratic
(Qo) problem can. Thus both a primal and a dual solution are available and algorithm solution
time is predictable. The commercial solvers used by PLEXOS all provide support for either conic
or Qc problems.

Thus the idea of the conic loss model is to take the direct approach of formulating the loss
equation(s) as quadratic constraints. This has the advantage that the solutions are highly
accurate w.r.t. both primal (losses) and dual (marginal loss factors and bus LMP). Not all solvers
however support integer optimization combined with conic or Qo, therefore integer optimal
unit commitment might not be available3.

In the PLEXOS implementation the FS-OPF solves the B-matrix loss formula (which defines total
system losses) directly. This approach can lead to a large optimisation problem that is difficult
to solve, thus either of SLP approaches usually solves faster and produces an equally accurate
result with the tolerances defined.

3At the time of writing only the MOSEK and Xpress-MP solvers supported solving integer problems with
quadratic constraints.

Page 21
Optimal Power Flow

Piecewise Linear
The Piecewise Linear method (which is the default method for FS-OPF) is essentially a
replacement for the Quadratic method in the case where:
 integer programming is required e.g. for unit commitment; and
 the solver being used does not support integer optimisation combined with quadratic
constraints (QcQp).

This method solves the B-matrix via Separable Programming to approximate the losses in the
AC network. The number of segments used in the approximation is controlled by the
Transmission [Loss Tranches] setting. This should generally be set to high number e.g. 20 or
more to ensure accuracy.

SLP on Loss Functions


The idea of the successive linear programming (SLP) model is to use a sequence of linear
problems to approximate the quadratic problem. In the FS-OPF it is the B-matrix formula of
losses that is modelled using a Taylor Expansion with the terms of that expansion iterated on
until convergence is reached. The convergence measure is controlled with the Transmission
[Loss Tolerance] setting.

SLP on Marginal Loss Factors


In this method rather than iterating on the terms of a Taylor Expansion of the B-matrix, PLEXOS
iterates on the set of marginal loss factors for each injection node combined with a constant loss
term. Thus the system energy-balance equation becomes:

𝑀𝐿𝐹𝑘 × 𝑔𝑘 = D − 𝑐
𝑘
where:
𝑀𝐿𝐹𝑘 is the marginal loss factor at node k
c is the constant term of the loss approximation associated with the current MLF set

This formulation here is linear and is solved using SLP.

For the 7-Node example, the lossless solution is shown in Figure 1. Turning on losses with this
loss method produces these messages in the log file:
--------------------------------------------------------------------------------------------------------------------------------
Iter Real Loss (MWh) Modeled Loss (MWh) Absolute Gap (MWh) Relative Gap (%)
--------------------------------------------------------------------------------------------------------------------------------
0 4.206716e+000 -3.552714e-013 4.206716e+000 1.000000e+002
1 4.207822e+000 4.207737e+000 8.488731e-005 2.017370e-003
2 4.207822e+000 4.207822e+000 0.000000e+000 0.000000e+000
Loss method completed. Exit status: TOLERANCE. Iterations: 2. Relative Gap: 0.000000e+000. Time: 0:00:00.033
--------------------------------------------------------------------------------------------------------------------------------

In this case the loss convergence occurs in two iterations and the gap between the modelled and
real losses is zero.

The tolerance for convergence is controlled by the Transmission [Loss Tolerance] setting. An
iteration limit can be set via the Transmission [Max Loss Iterations] setting. In general this
method converges quickly and is relatively fast and efficient compared to the other approaches.

The solution including losses for the 7-Node case is shown in Figure 2.

Page 22
Optimal Power Flow

Figure 2: Dispatch Including Losses

Note that when integer optimisation is required e.g. for unit commitment when Production
[Unit Commitment Optimality] is set to “Integer Optimal” or “Rounded Relaxation”, PLEXOS
must iterate between the convergence of losses and the unit commitment to find a reasonable
solution.

Page 23
Optimal Power Flow

8.5 Loss Models in VS-OPF

Piecewise Linear
When used with the VS-OPF, the Piecewise Linear (PL) approach is the same as that used in LP
markets such as New Zealand, Australia, Singapore, and Ireland.

The method modifies the lossless power flow formulation by segmenting the power flow
variables 𝑓𝑗 firstly into directed arcs (forward and back) and then, each direction, into a number
of loss ‘tranches’.

Each loss tranche has an associated (constant) marginal loss equal to the derivative w.r.t. flow of
the original quadratic loss function at the mid-point of the tranche. The above figures illustrate
for example Line “2_5”, the fit to the loss function and the resulting stepwise marginal loss
function.

These marginal loss terms appear in the formulation thus:

Node Net Injection:


𝑛𝑖 = 𝑔𝑘 − 𝑑𝑖 − 1 − 𝑎𝑥 × 𝑥,𝑡 × 𝑓𝑥,𝑡 − 𝑎𝑦 × 𝑦,𝑏 × 𝑓𝑦,𝑡
𝑘 𝑥 𝑏 𝑦 𝑏

Node Power Balance:


𝑛𝑖 = 𝑓𝑥,𝑏 − 𝑓𝑦,𝑏
𝑥 𝑏 𝑦 𝑏

Line Flow Limits:


𝑓𝑗 ≤ 𝑓𝑗 ,𝑏 − 𝑓𝑗 ,𝑏 ≤ 𝑓𝑗
𝑏∈𝐹 𝑏∈𝐵

Line Loss Tranche Bounds:


0 ≤ 𝑓𝑗 ,𝑏 ≤ 𝑓𝑗 ,𝑏

where:
𝑘 𝑔𝑘 − 𝑑𝑖 is the net generation at node i

Page 24
Optimal Power Flow

𝑛𝑖 is the net injection at bus i (also called the net export)


x indexes the directed loss tranches exporting from bus i, and
y indexes the directed loss tranches importing to bus i
𝑎𝑗 is the loss allocation factor for line j
𝑗 ,𝑡 is the marginal loss in loss tranche b for line j
𝑓𝑥,𝑡 is the flow in loss tranche b for line j with sets F and B indicating the forward and
back directed flows respectively

The optimisation solves these two node balance equations simultaneously. The losses have the
effect of being loads at the nodes either end of the line. The nodal price is taken from the dual on
the first equation and will naturally include the effect of marginal losses.

We note the following advantages/disadvantages/features of the PL model:


 The resulting formulation is linear and thus can be solved in a single LP problem i.e. no
additional iteration is required to ‘converge’ the loss model;
 and integer programming (MIP) can be added on top with no loss of accuracy.

However:
 the approach will tend to produce flows at corner points of the loss tranches; and
 the marginal loss function is a stepwise linear approximation of the real linear marginal
loss function, thus the pricing impact of this approximation is much greater than the
absolute error in the loss.

To maximize the accuracy of the marginal loss approximation we can increase the number of
loss tranches used. This is controlled with the Transmission [Max Loss Tranches]. Note that this
setting defines the number of loss tranches used in each of the forward and back directions, so a
value of five will result in a total of 10 tranches being used across the range of line flows.

Non-physical Losses
A potential problem with the piecewise linear model is its assumption that the problem is
entirely separable i.e. each loss tranche is a separate decision variable and there is no in-built
logic to force them to be taken up in flow order.

In normal circumstances the optimization will want to minimize losses and so it will flow on low
loss tranches first before using higher loss ones. But it can occur that there is over-generation
(dump energy condition) due to constraints such as generator must-run constraints, system
security constraints, or other constraints that force flows or generation against economic
dispatch.

When dump energy occurs the nodal prices will be at or below the price of dump energy (set by
Region [Price of Dump Energy].

The optimization then prefers to maximize losses near the node and will choose the highest loss
tranches first. Thus the modelled loss will exceed the losses defined by the original quadratic
loss function. These additional losses are what are referred to as non-physical losses (NPL).

Solutions with NPL exhibit one or both of the following symptoms:


 Directional flow variables are chosen for both forward and backward flow directions
simultaneously.

Page 25
Optimal Power Flow

 Loss tranches are chosen in ‘reverse order’ i.e. tranches with higher loss are chosen
before those with lower loss.

These solutions clearly have no physical representation, hence the term non-physical losses. In
a PLEXOS solution, non-physical losses show up as periods where one or more lines reports
very high losses relative to flow.

This problem occurs in all linear programming (LP) based market clearing engines that use
piecewise linear loss functions e.g. New Zealand, Australia, Singapore, and Ireland.

PLEXOS includes a procedure for correcting non-physical losses as they occur, using integer
programming, and this is described in the property Transmission [Detect Non-physical Losses].

SLP of Loss Functions


In the SLP method for VS-OPF the line-by-line loss function is modelled not as a piecewise linear
function but using a Taylor Expansion: a marginal loss combined with a constant, equal to the
line losses at the current iteration. At each iteration a Taylor Expansion of the real loss function
is developed. The expansion is performed successively until the modelled losses converge on
the real losses.

This algorithm in PLEXOS is controlled by two parameters. Firstly, you can set an iteration limit
using Transmission [Max Loss Iterations], and secondly, the convergence tolerance can be
controlled with the parameter Transmission [Loss Tolerance].

The following screen output shows the iterations of this model on the IEEE 30-bus model.
------------------------------------------------------------------------------------------------
Iter Real Loss (MWh) Modeled Loss (MWh) Absolute Gap (MWh) Relative Gap (%)
------------------------------------------------------------------------------------------------
0 1.107324e+001 0.000000e+000 1.107324e+001 1.000000e+002
1 9.844399e+000 9.785132e+000 5.926729e-002 6.020407e-001
2 9.944655e+000 9.944191e+000 4.642499e-004 4.668336e-003
Losses converged to the 0.01 % tolerance in 2 iterations. Time: 0:00:00.148

The SLP model produces the same solution as the direct solution using non-linear programming,
but can be faster because it solves using SLP. It has the disadvantage that its iterative procedure
cannot be integrated into the unit commitment algorithm (either “Rounded Relaxation” or
“Integer Optimal”) because that would require re-convergence for every candidate solution,
which is not always practical. Therefore, as mentioned above, PLEXOS solves the unit
commitment and loss convergence in sequence, which will produce a good solution, but not
necessarily an optimal solution.

The next section describes direct solution of the loss model using conic optimization, which is a
non-linear optimizer.

Quadratic
A quadratic constraint is formulated for each line that represents the line’s losses. The
formulation is made so that the line loss constraints are conic in nature, which allows the
solvers to use interior point methods to solve the problem.

In addition, so solvers that support it, can model integer decisions at the same time as these
quadratic constraints (called quadratically-constrained integer programming). This loss model,

Page 26
Optimal Power Flow

with its variable shift factors and quadratic losses is the most accurate OPF model available in
PLEXOS, but it is also the most computationally difficult.

8.6 Losses Embedded in the Load


The OPF has fundamental equations that balance supply and demand. For the FS-OPF there is a
single system-wide balance equation, and for the VS-OPF there exists the same equations for
every node in the network. For convenience, we will discuss the FS-OPF here, but the same
applies to the VS-OPF.

Losses are included in the system-wide energy balance constraint thus:

𝑔𝑖 = 𝐷 + 𝐿
𝑖

where:
i indexes nodes
D is the system demand
𝑔𝑖 is the generation at node i
L is the system wide losses

This means that the input demand must agree with:

𝐷= 𝑔𝑖 − 𝐿
𝑖

i.e. the input demand must not include transmission losses.

However, in most systems load forecasts are based on generation (which is more convenient to
meter than customer load). Therefore the demand input to PLEXOS must be adjusted
downwards to account for transmission losses. Alternatively, you can ask PLEXOS to do this
automatically during the simulation. The property Transmission [Load Includes Losses]
(yes/no) activates an algorithm that iterates on an adjustment to the demand, converging such
that:

𝐷+𝐿 = 𝑔𝑖
𝑖

and therefore:

𝑔𝑖 = 𝐷
𝑖

You can control the number of iterations used to gain convergence with the Transmission [Max
Embedded Loss Iterations]. If you plan to use this automatic method be sure to check the
computational overhead of running it (which is usually light but can vary depending on the loss
model) versus the accuracy gained compared to simply scaling the input load down by an
estimate of losses in the input data. Note that you can use the load scaling property Region
[Load Scalar] to scale loads automatically, which is often more convenient than modifying the
raw input load files.

Page 27
Optimal Power Flow

8.7 Special Loss Functions


PLEXOS supports defining a completely custom line loss functions in three ways:
1. By using multiple tranches of flow and incremental loss i.e. a custom piecewise linear
loss function; or
2. By specifying the terms of a quadratic equation, which can include constant, linear and
quadratic terms; or
3. By defining a marginal loss factor equation.

Custom Piecewise Linear Functions


Custom piecewise linear loss functions are used in LP-based markets like New Zealand. The line
properties Max Flow and Loss Incr and Min Flow and Loss Incr Back can be used in multiple
bands (tranches) as shown in Table 4.

Table 4: Custom piecewise linear loss function

Line Property Value Units Band


1_2 Max Flow 100 MW 1
1_2 Max Flow 100 MW 2
1_2 Min Flow -100 MW 1
1_2 Min Flow -100 MW 2
1_2 Loss Incr 0.02 MW/MW 1
1_2 Loss Incr 0.025 MW/MW 2
1_2 Loss Incr Back 0.02 MW/MW 1
1_2 Loss Incr Back 0.025 MW/MW 2

These data define a piecewise linear loss model with two tranches in each flow direction. The
marginal loss for the first tranche is 0.02 = 2%, and for the second tranche 2.5%. Each tranche is
100 MW is size i.e. the [Max Flow] values in each band (tranche) are treated as incremental.

Custom Quadratic Loss Equations


Custom quadratic loss equations can be defined individually for flows in the reference and
counter-reference direction as in Table 5 and Figure 3.

Table 5: Custom quadratic loss function

Line Property Value Units Band


1_2 Max Flow 1000 MW 1
1_2 Min Flow -800 MW 1
1_2 Loss Base -5 MW 1
1_2 Loss Incr 0.01234 MW/MW 1
2
1_2 Loss Incr2 0.0001234 MW/MW 2
1_2 Loss Base Back -5 MW 1
1_2 Loss Incr Back 0.02345 MW/MW 2
2
1_2 Loss Incr2 Back 0.0002345 MW/MW 2

Page 28
Optimal Power Flow

Figure 3: Custom quadratic loss function

Marginal Loss Factor Equations


Marginal loss factor equations describe losses as a function of line flow as well as system
demand. They are used in the Australian NEM. PLEXOS supports MLF equations directly
through the MLF class.

8.8 Approximating Losses Using a Penalty Function


In the lossless model the optimal solution may show some transmission lines (particularly DC
lines) operating at the extremes of their flow limits. In reality the higher the flow level the
higher losses are incurred. One way to moderate the behaviour of the lossless optimization
without the overhead of full loss modelling is to impose a quadratic increasing penalty to flows
to mimic losses.

This type of penalty function can be synthesized by creating a Constraint with multiple penalty
tranches as in Table 6.

Page 29
Optimal Power Flow

Table 6: Penalty function

Membership Property Value Units Band


DC LOSS Sense ≥ - 1
DC LOSS RHS 0 - 1
DC LOSS Penalty Quantity 192 MW 1
DC LOSS Penalty Quantity 192 MW 2
DC LOSS Penalty Quantity 192 MW 3
DC LOSS Penalty Quantity 192 MW 4
DC LOSS Penalty Quantity 192 MW/MW 5
DC LOSS Penalty Quantity 192 MW/MW 6
DC LOSS Penalty Quantity 192 MW/MW 7
DC LOSS Penalty Quantity 192 MW/MW 8
DC LOSS Penalty Quantity 192 MW/MW 9
DC LOSS Penalty Quantity 192 MW/MW 10
DC LOSS Penalty Price 0.07 MW 1
DC LOSS Penalty Price 0.29 MW 2
DC LOSS Penalty Price 0.66 MW 3
DC LOSS Penalty Price 1.18 MW 4
DC LOSS Penalty Price 1.84 MW/MW 5
DC LOSS Penalty Price 2.65 MW/MW 6
DC LOSS Penalty Price 3.61 MW/MW 7
DC LOSS Penalty Price 4.72 MW/MW 8
DC LOSS Penalty Price 5.97 MW/MW 9
DC LOSS Penalty Price 7.37 MW/MW 10
Constraint ( DC LOSS ).Lines (DC) Flow Coefficient 1 - 1

The constraint sense is equality (value=0) and right-hand side is zero. The line's flow coefficient
is set to one. The penalty function is entered multiple bands with increasing penalty. This in fact
creates a piecewise linear penalty function which is suitable for the linear optimization used in
PLEXOS. Thus the constraint is formulated as:

Minimise

𝑐𝑏 × 𝑣𝑏 + 𝑣𝑏
𝑏

subject to

𝑓𝑗 − 𝑣𝑏 − 𝑣𝑏 = 0
𝑏

where:
𝑓𝑗 is the flow on line j in the reference direction (free variable)
𝑣𝑏 is the violation above zero flow in penalty tranche b
𝑣𝑏 is the violation below zero flow in penalty tranche b
𝑐𝑏 is the penalty for flow in penalty tranche b

The penalty function has the desired effect of mitigating extreme flow levels that would in
reality incur high losses.

Page 30
Optimal Power Flow

9 Security-Constrained Unit Commitment


Security constrained unit commitment (SCUC) finds the optimal unit commitment and dispatch
solution subject to the transmission being feasible if any defined contingency (such as the loss of
a line) should occur. The SCUC algorithm in PLEXOS computes contingency shift factors (also
called generation-shift sensitivity factors) which define how much of the flow lost during a
contingency will appear on other lines in the network: these factors are used to monitor and
enforce the contingency constraints. The resulting dispatch is more conservative and at higher
cost, but reflects more accurately the actual system operation.

The following discussion is adapted from (A.J. Wood, 1996).

9.1 Calculation of Contingency Shift Factors


First we show how to derive the generation-shift sensitivity factors. We start with the standard
power flow equation for the linearised DC-OPF presented above:

θ= XP

Since the DC-OPF is a linear model, we may calculate perturbations about any given set of
system conditions by using the same model. Thus, if we are interested in the changes in bus
phase angels, ∆θ for a given set of changes in the bus power injections, ΔP, we can use the
following calculation.

∆θ = X ∆P

It is assumed that the power on the slack bus(es) is equal to the sum of the injections of all the
other buses. Similarly, the net perturbation of the slack bus(es) (in the equation above) is the
sum of the perturbations on all the other buses.

Suppose that we are interested in calculating the generation shift sensitivity factors for the
generator on bus i. To do this, we will set the perturbation on bus i to +1 and the perturbation
on all other buses to zero. We can then solve for the change in bus phase angles using the matrix
calculation in the following equation.

+1 −𝑟𝑜𝑤 𝑖
𝛥 = X
−1 −𝑟𝑒𝑓 𝑟𝑜𝑤

The vector of bus power injection perturbations in the above equation represents the situation
when a 1 p.u. power increase is made at bus i and is compensated by a 1 p.u. decrease in power
at the slack bus. The ∆θ values are thus equal to the derivative of the bus angles with respect to
a change in power injection at bus i. Then, the required sensitivity factors are:

𝑑𝑓𝑙 𝑑 1
𝑎𝑙,𝑖 = =  − 𝑚
𝑑𝑃𝑖 𝑑𝑃𝑖 𝑥𝑙 𝑛

1 𝑑𝑛 𝑑𝑚 1
= − = 𝑋 − 𝑋𝑚𝑖
𝑥𝑙 𝑑𝑃𝑗 𝑑𝑃𝑖 𝑥𝑙 𝑛𝑖
where:
𝑑
𝑋𝑛𝑖 = 𝑑𝑃𝑛 = 𝑛𝑡𝑕 element from the Δθ vector
i

Page 31
Optimal Power Flow

𝑑𝑚
𝑋𝑚𝑖 = = 𝑚𝑡𝑕 element from the Δθ vector
𝑑𝑃𝑗
𝑥𝑙 is the reactance for line l

A line outage may be modelled by adding two power injections to a system, one at each end of
the line to be dropped. The line is actually left in the system and the effects of it being dropped
are modelled by injections. Suppose line k from bus n to bus m were opened by circuit breakers.
Note that when the circuit breakers are opened, no current flows through them and the line is
completely isolated for the remainder of the network. To model this situation the breakers can
remain closed but injections 𝑃𝑛 and 𝑃𝑚 can been added to bus n and bus m, respectively
counteracting the original flow on the line.

If 𝑃𝑛 = 𝑃𝑛𝑚 , where 𝑃𝑛𝑚 is equal to the power flowing over the line, and 𝑃𝑛 = −𝑃𝑛𝑚 we
will still have no current flowing through the circuit breakers even though they are closed. As
far as the remainder of the network is concerned, the line is disconnected.

Using the equation relating to Δθ and ΔP, we have:

Δθ = 𝑋 ΔP

where:

𝑃𝑛
ΔP =

𝑃𝑚

so that:
𝑛 = 𝑋𝑛𝑚 𝑃𝑛 + 𝑋𝑛𝑚 𝑃𝑚

𝑚 = 𝑋𝑚𝑛 𝑃𝑛 + 𝑋𝑚𝑛 𝑃𝑚

define:
𝑛 , 𝑚 , 𝑃𝑛𝑚 to exist before the outage, where 𝑃𝑛𝑚 is the flow on line k from bus n to bus
m

𝑛 , 𝑚 , 𝑃𝑛𝑚 to be incremental changes resulting from the outage

𝑛 , 𝑚 , 𝑃𝑛𝑚 to exist after the outage

The outage modelling criteria requires that the incremental injections 𝑃𝑛 and 𝑃𝑚 equal the
power flowing over the outaged line after the injections are imposed. Then if we let the line
reactance be 𝑥𝑘 :

𝑃𝑛𝑚 = 𝑃𝑛 = −𝑃𝑚

where:
1
𝑃𝑛𝑚 =  − 𝑚
𝑥𝑘 𝑛

then:
𝑛 = 𝑋𝑛𝑛 + 𝑋𝑛𝑚 𝑃𝑛

Page 32
Optimal Power Flow

𝑚 = 𝑋𝑚𝑚 + 𝑋𝑚𝑛 𝑃𝑚

and:
𝑛 = 𝑛 + 𝑛

𝑚 = 𝑚 + 𝑚

giving:
1 1 1
𝑃𝑛𝑚 = 𝑛 − 𝑚 = 𝑛 −  𝑚 + 𝑛 − 𝑚
𝑥𝑘 𝑥𝑘 𝑥𝑘

or:
1
𝑃𝑛𝑚 = 𝑃𝑛𝑚 + 𝑋 + 𝑋𝑚𝑚 − 2𝑋𝑛𝑚 𝑃𝑛
𝑥𝑘 𝑛𝑚

Then (using the fact that 𝑃𝑛𝑚 is set to 𝑃𝑛 ):

1
𝑃𝑛 = 𝑃𝑛𝑚
1
1 − 𝑥 𝑋𝑛𝑛 + 𝑋𝑚𝑚 − 2𝑋𝑛𝑚
𝑘

Define a sensitivity factor δ as the ratio of the change in phase angle θ, anywhere in the system,
to the original power 𝑃𝑛𝑚 flowing over the line nm before it was dropped. This is:

𝑖
𝑖,𝑛𝑚 =
𝑃𝑛𝑚

If neither n nor m is the system references bus, two injections, 𝑃𝑛 and 𝑃𝑚 , are imposed at
buses n and m respectively. This gives a change in phase angle at bus i equal to:

𝑖 = 𝑋𝑖𝑛 𝑃𝑛 + 𝑋𝑖𝑚 𝑃𝑚

Then using the relationship between 𝑃𝑛 and 𝑃𝑚 , the resulting δ factor is:

𝑋𝑖𝑛 − 𝑋𝑖𝑚 𝑥𝑘
𝑖,𝑛𝑚 =
𝑥𝑘 − 𝑋𝑛𝑛 + 𝑋𝑚𝑚 − 2𝑋𝑛𝑚

If either n or m is the reference bus, only one injection is made. The resulting factors are:

𝑋𝑖𝑛 𝑥𝑘
𝑖,𝑛𝑚 = 𝑓𝑜𝑟 𝑚 = 𝑟𝑒𝑓
𝑥𝑘 − 𝑋𝑛𝑛

−𝑋𝑖𝑚 𝑥𝑘
𝑖,𝑛𝑚 = 𝑓𝑜𝑟 𝑛 = 𝑟𝑒𝑓
𝑥𝑘 − 𝑋𝑚𝑚

If bus i itself is the reference bus, then 𝑖,𝑛𝑚 = 0 since the reference bus angle is constant.

The expression for 𝑑ℓ,𝑘 is:


1
𝑓ℓ 𝑥ℓ
𝑖 − 𝑗
𝑑ℓ,𝑘 = 0 =
𝑓𝑘 𝑓𝑘0

Page 33
Optimal Power Flow

1 𝑖 𝑗
= −
𝑥ℓ 𝑃𝑛𝑚 𝑃𝑛𝑚

1
=  − 𝑗 ,𝑛𝑚
𝑥ℓ 𝑖,𝑛𝑚

If neither i nor j is the reference bus:

1 𝑋𝑖𝑛 − 𝑋𝑖𝑚 𝑥𝑘 − 𝑋𝑗𝑛 − 𝑋𝑗𝑚 𝑥𝑘


𝑑ℓ,𝑘 =
𝑥ℓ 𝑥𝑘 − 𝑋𝑛𝑛 + 𝑋𝑚𝑚 − 2𝑋𝑛𝑚

𝑥𝑘
𝑥ℓ 𝑋𝑖𝑛 − 𝑋𝑗𝑛 − 𝑋𝑖𝑚 + 𝑋𝑗𝑚
=
𝑥𝑘 − 𝑋𝑛𝑛 + 𝑋𝑚𝑚 − 2𝑋𝑛𝑚

9.2 Generator Contingencies

Generation Shift Factor Calculation for the Single Slack


The PTDF is calculated as follows:
Δθ = 𝑋 ΔP

1
𝑓ℓ = 𝑛 − 𝑚
𝑥𝑛𝑚

where line ℓ connects from bus n to bus m. Let the power injection change at bus i be one MW,
𝑃𝑖 , and the slack bus will absorb same amount of power, 𝑃𝑠𝑙𝑎𝑐𝑘 = −𝑃𝑖 .

0 0
𝑃𝑖 𝑃𝑖
𝛥𝑃 = =
⋮ ⋮
𝑃𝑠𝑙𝑎𝑐𝑘 −𝑃𝑖

The power angle changes at bus n and bus m are

𝑛 = 𝑋𝑛,𝑖 𝑃𝑖

𝑚 = 𝑋𝑚 ,𝑖 𝑃𝑖

Then, the flow change at line ℓ is


1
𝑓ℓ = 𝑛 − 𝑚
𝑥𝑛𝑚

1
= 𝑋𝑛,𝑖 − 𝑋𝑚 ,𝑖 𝑃𝑖
𝑥𝑛𝑚

= 𝑃𝑇𝐷𝐹ℓ,𝑖 𝑃𝑖

Then the generator shift factor from bus i to line ℓ is


𝑓ℓ
𝑎ℓ,𝑖 =
𝑃𝑖

Page 34
Optimal Power Flow

𝑃𝑇𝐷𝐹ℓ,𝑖 𝑃𝑖
=
𝑃𝑖

= 𝑃𝑇𝐷𝐹ℓ,𝑖

Generation Shift Factor Calculation for the Distributed Slack


In the distributed slack case, one MW injection at bus i will be absorbed by multiple slack buses.

𝑃𝑠𝑗 = −𝑃𝑖
𝑠𝑗  𝑠𝑙𝑎𝑐𝑘

where bus sj is one of the slack buses.

In the form of vector, the bus injection at bus i and the slack buses is:

0 𝑃𝑖 0
𝑃𝑖 𝑃𝑖 = 𝑃𝑖
𝛥𝑃 = +
⋮ ⋮ ⋮
−𝑃𝑖

Then power angle changes at bus n and bus m are

𝑛 = 𝑋𝑛,𝑖 𝑃𝑖 + 𝑋𝑛,𝑠𝑗 𝑃𝑠𝑗


𝑠𝑗

𝑚 = 𝑋𝑚 ,𝑖 𝑃𝑖 + 𝑋𝑚 ,𝑠𝑗 𝑃𝑠𝑗


𝑠𝑗

The flow change at line ℓ is:

1
𝑓ℓ = 𝑛 − 𝑚
𝑥𝑛𝑚

1
= 𝑋𝑛,𝑖 𝑃𝑖 − 𝑋𝑛,𝑠𝑗 𝑃𝑠𝑗 − 𝑋𝑚 ,𝑖 𝑃𝑖 − 𝑋𝑚 ,𝑠𝑗 𝑃𝑠𝑗
𝑥𝑛𝑚
𝑠𝑗 𝑠𝑗

1 1
= 𝑋𝑛,𝑖 − 𝑋𝑚 ,𝑖 𝑃𝑖 + 𝑋𝑛,𝑠𝑗 𝑃𝑠𝑗 − 𝑋𝑚 ,𝑠𝑗 𝑃𝑠𝑗
𝑥𝑛𝑚 𝑥𝑛𝑚
𝑠𝑗 𝑠𝑗

1 1
= 𝑋𝑛,𝑖 − 𝑋𝑚 ,𝑖 𝑃𝑖 + 𝑋𝑛,𝑠𝑗 − 𝑋𝑚 ,𝑠𝑗 𝑃𝑠𝑗
𝑥𝑛𝑚 𝑥𝑛𝑚
𝑠𝑗

= 𝑃𝑇𝐷𝐹ℓ,𝑖 𝑃𝑖 + 𝑃𝑇𝐷𝐹ℓ,𝑠𝑗 𝑃𝑠𝑗


𝑠𝑗

Then the generator shift factor from bus i to line ℓ is

Page 35
Optimal Power Flow

𝑓𝑙
𝑎ℓ,𝑖 =
𝑃𝑖

𝑃𝑇𝐷𝐹ℓ,𝑖 𝑃𝑖 + 𝑠𝑗 𝑃𝑇𝐷𝐹ℓ,𝑠𝑗 𝑃𝑠𝑗


=
𝑃𝑖

𝑃𝑖
= 𝑃𝑇𝐷𝐹ℓ,𝑖 + 𝑃𝑇𝐷𝐹ℓ,𝑠𝑗
𝑃𝑠𝑗
𝑠𝑗

𝑃𝑖
From this equation, we notice that there is an extra term, 𝑠𝑗 𝑃𝑇𝐷𝐹ℓ,𝑠𝑗 𝑃𝑠𝑗
, in the generator
shift factor for the distributed slack as opposed to the single slack bus.

In the single slack bus case, 𝑃𝑠𝑗 = 0 and 𝑃𝑠𝑛 = −𝑃𝑖 , and also 𝑠𝑛 = 0 which results in
𝑃𝑖
𝑃𝑇𝐷𝐹𝑠𝑛 = 0 . 𝑠𝑗 𝑃𝑇𝐷𝐹ℓ,𝑠𝑗 𝑃𝑠𝑗
= 0 and 𝑎ℓ,𝑖 is reduced to 𝑃𝑇𝐷𝐹ℓ,𝑖 as shown above.

Flow constraint changes due to the generator outage


In both cases of single or distributed slack, the flow constraint for the generator outage at bus i
is:

𝑓ℓ𝑚𝑖𝑛 ≤ 𝑓ℓ0 − 𝑎ℓ,𝑖 𝑃𝑖 = 𝑓ℓ0 − 𝑎ℓ,𝑖 𝑃𝑖0 ≤ 𝑓𝑖𝑚𝑎𝑥

Where 𝑃𝑖0 is the pre-contingency generation from the generator at bus i.

9.3 Example
We illustrate the use of SCUC in PLEXOS using the 7-Node network described in Section 9.3. We
solve three cases:
1. Economic dispatch and optimal power flow ignoring contingencies and losses which is
shown in Figure 1.
2. Case 1 with a contingency defined on a single line
3. Case 1 but with all lines as contingencies

In all cases PLEXOS will compute the shift factors for the network based on single slack bus,
however distributed slack would work similarly. The shift factors are shown in Table 17.

Contingency on single line


In this case we define a contingency on Line “2_5”. This is done in PLEXOS by creating a
Contingency object and placing the Line “2_5” in the Contingency [Lines] collection for that
Contingency. The Contingency [Is Enabled] property is then set to “Yes”. Finally the SCUC must
be enabled in Transmission settings (see the “Security Constrained Unit Commitment (SCUC)”
switch in Figure 6).

When this case is run in PLEXOS the contingency shift factors are computed for the case of Line
“2_5” going out of service. These factors are shown in Table 7. For example, for the loss of one
megawatt of flow from Node “2” to Node “5” the flow between Node “2” to Node “3” will
increase by 0.1485.

Page 36
Optimal Power Flow

Table 7: Contingency shift factors

Contingency
2
Node From Node To 5
1 2 -0.09217
1 3 0.09217
2 3 0.1485
2 4 0.18861
2 5 0
2 6 0.57073
3 4 0.24067
4 5 0.42927
5 7 -0.57073
6 7 0.57073

The results for this case are illustrated in Figure 4. Compared to Figure 1 the total system cost
has increased from 15113.45 to 15603.43. The generation pattern changes so that when if the
flow on Line “2_5” is lost the post-contingency flows on the other lines will not exceed their
thermal ratings. In the solution file PLEXOS reports the Contingency [Shadow Price] of 21.02.
Thus, although no line is congested ‘pre-contingency’ there are still separations in nodal prices
as in Table 8.

Table 8: Nodal pricing with single contingency

Node Price ($/MWh) Energy Charge ($/MWh) Congestion Charge ($/MWh)


1 14.60 14.60 0.00
2 15.00 14.60 -0.40
3 12.66 14.60 1.94
4 12.03 14.60 2.57
5 24.02 14.60 -9.43
6 17.26 14.60 -2.66
7 21.77 14.60 -7.17

Page 37
Optimal Power Flow

Figure 4: 7-Node with single line contingency

Contingencies on all lines


We define contingencies on all lines by creating one Contingency object for each Line and
adding that line to the contingency. The solution for this case is illustrated in Figure 5. The
contingency shadow prices are shown in Table 9 and nodal prices in Table 10.

Page 38
Optimal Power Flow

Figure 5: 7-Node with contingencies on all lines

Page 39
Optimal Power Flow

Table 9: Contingency shadow prices

Contingency Is Binding (Yes/No) Shadow Price ($/MW)


1_2 0.00 0.00
1_3 0.00 0.00
2_3 0.00 0.00
2_4 0.00 0.00
2_5 -1.00 9.95
2_6 -1.00 1.57
3_4 0.00 0.00
4_5 0.00 0.00
5_7 0.00 0.00
6_7_1 -1.00 5.03
6_7_2 0.00 0.00

Table 10: Nodal pricing with all lines as contingencies

Node Price ($/MWh) Energy Charge ($/MWh) Congestion Charge ($/MWh)


1 14.95 14.95 0.00
2 15.00 14.95 -0.05
3 14.69 14.95 0.26
4 14.60 14.95 0.35
5 23.34 14.95 -8.39
6 17.71 14.95 -2.76
7 21.77 14.95 -6.82

Page 40
Optimal Power Flow

10 Transmission Settings

Figure 6: Transmission Settings

Page 41
Optimal Power Flow

11 Data for 7-Node System


This section lists the complete data for the 7-Node case referred to throughout this paper. The
dataset is available for download from Energy Exemplar along with the network diagram in
Excel format.

11.1 Network Diagram


Figure 7 illustrates the 7-Node network and its optimal power flow for the dispatch given in
Table 15. Note that this is not the economic dispatch, simply an example dispatch for the
purposes of validating the optimal power flow. A ‘hardwired’ dispatch like this can be entered
into PLEXOS using the Generator [Fixed Load] property.

Page 42
Optimal Power Flow

Figure 7: 7-Node Network

Page 43
Optimal Power Flow

11.2 Input Data


The following tables list the data for the 7-Node system.

Table 11: Node Data

Node Region Load Participation Factor


1 Top Area 0
2 Top Area 0.1
3 Top Area 0.375
4 Top Area 0.2
5 Top Area 0.325
6 Left Area 1
7 Right Area 1

Table 12: Region Data

Region Load
Left Area 200
Right Area 200
Top Area 400

Table 13: Line Data

Line Node From Node To Max Flow Min Flow Resistance Reactance
1-2 1 2 120 -120 0.0050 0.0500
1-3 1 3 120 -120 0.0200 0.2400
2-3 2 3 100 -100 0.0150 0.1800
2-4 2 4 100 -100 0.0150 0.1800
2-5 2 5 120 -120 0.0100 0.1200
2-6 2 6 200 -200 0.0050 0.0600
3-4 3 4 222 -222 0.0025 0.0300
4-5 4 5 60 -60 0.0200 0.2400
5-7 5 7 200 -200 0.0050 0.0600
6-7.1 6 7 200 -200 0.0200 0.2400
6-7.2 6 7 200 -200 0.0200 0.2400

Table 14: Generator Capacity Data

Generator Units Max Capacity Fuel Price Min Stable Level Commit
1 1 400 1 0 1
2 1 500 1 150 1
4 1 300 2.09 50 1
6 1 500 2.14 150 1
7 1 600 2.57 0 1

Page 44
Optimal Power Flow

Table 15: Generator Dispatch

Generator Fixed Load


1 150
2 150
4 50
6 250
7 200

Table 16: Generator Heat Rate Data

Generator Load Point Heat Rate Base Band Heat Rate Incr
1 10 373.5 1 12
1 20 2 12.5
1 30 3 13
2 403.6 1 15
4 253.2 1 6.698564593
6 20 388.9 1 7.593457944
6 40 2 7.64953271
6 60 3 7.700934579
6 80 4 7.752336449
6 100 5 7.803738318
6 120 6 7.855140187
6 140 7 7.911214953
6 160 8 7.962616822
6 180 9 8.014018692
6 200 10 8.065420561
6 220 11 8.11682243
6 240 12 8.172897196
6 260 13 8.224299065
6 280 14 8.275700935
6 300 15 8.327102804
6 320 16 8.378504673
6 340 17 8.434579439
6 360 18 8.485981308
6 380 19 8.537383178
6 400 20 8.588785047
7 120 194.28 1 8.003108003
7 240 2 8.469308469
7 360 3 8.935508936
7 480 4 9.401709402
7 600 5 9.867909868

11.3 Shift Factors


Table 17 shows the shift factors computed for the 7-Node case assuming Node “1” is the slack
bus. Table 18 shows the shift factors for the distributed load slack case.

Page 45
Optimal Power Flow

Table 17: Shift Factors for 7-Node System (single slack bus)

Injection Point 0 1 2 3 4 5 6
Bus From Bus To 1 2 3 4 5 6 7
1 2 0 -0.865 -0.648 -0.69284 -0.82196 -0.85424 -0.83272
1 3 0 -0.135 -0.352 -0.30716 -0.17804 -0.14576 -0.16728
2 3 0 0.060277 -0.28933 -0.2171 -0.00907 0.042941 0.008269
2 4 0 0.047823 -0.22955 -0.30447 -0.04025 0.025805 -0.01823
2 5 0 0.017934 -0.08608 -0.11418 -0.51509 -0.11532 -0.38184
2 6 0 0.008967 -0.04304 -0.05709 -0.25755 -0.80766 -0.44092
3 4 0 -0.07472 0.358673 -0.52426 -0.18711 -0.10282 -0.15901
4 5 0 -0.0269 0.129122 0.171266 -0.22736 -0.07702 -0.17724
5 7 0 -0.00897 0.043041 0.057089 0.257547 -0.19234 -0.55908
6 7 0 0.008967 -0.04304 -0.05709 -0.25755 0.192338 -0.44092

Table 18: Shift Factors for 7-Node System (distributed load slack)

Inj. Pnt 0 1 2 3 4 5 6
Bus From Bus To 1 2 3 4 5 6 7
1 2 0.8073877 -0.05761184 0.1593853 0.1145512 -0.01457109 -0.04685165 -0.02533127
1 3 0.1926123 0.05761184 -0.1593853 -0.1145512 0.01457109 0.04685165 0.02533127
2 3 0.03254209 0.09281907 -0.2567874 -0.1845546 0.02347564 0.07548321 0.0408115
2 4 0.0492345 0.09705755 -0.1803162 -0.2552389 0.008983428 0.07503902 0.03100196
2 5 0.2392963 0.2572299 0.1532148 0.1251187 -0.2757979 0.123973 -0.1425409
2 6 0.4529815 0.4619483 0.4099407 0.3958927 0.1954344 -0.3546802 0.01206287
3 4 0.1001544 0.02543091 0.4588273 -0.4241058 -0.08695327 -0.00266514 -0.05885723
4 5 0.08272226 0.05582179 0.2118445 0.2539886 -0.1446365 0.005707217 -0.09452194
5 7 0.2136852 0.2047184 0.2567259 0.270774 0.4712323 0.02134685 -0.3453962
6 7 0.1196481 0.128615 0.07660739 0.06255936 -0.1378989 0.3119865 -0.3212705

12 Bibliography
A.J. Wood, B. W. (1996). Power Generation, Operation, and Control. John Wiley & Sons.

Broad, K. (1996). Power Generation Planning using Scenario Aggregation. Master of Engineering
Thesis. Auckland, New Zealand: School of Engineering, University of Auckland.

F.C. Schweppe, M. C. (1998). Spot Pricing of Electricity. Norwell, MA, USA: Kluwer Academic
Publishers.

Page 46

You might also like