Power flow equations
Net power entering the network at bus ‘I’
n
Pi Yki Vi Vk cos( i k ik )
k 1
n
Qi Y3 i V3 Vi sin( i k ik )
k 1
Calculated from V, Ѳ, Y
Nonlinear Systems May Have
Multiple Solutions or No Solution
•Example 1:x2 ‐ 2 = 0 has solutions x = 1.414…
•Example 2: x2 + 2 = 0 has no real solution
two solutions where f(x) = 0 no solution f(x) = 0
Multiple Solution Example 3
• The dc system shown below has two solutions:
where the 18 watt
load is a resistive
load
The equation we're solving is
2
9 volts
I RLoad
2
RLoad 18 watts
1 +R Load
One solution is R Load 2
Other solution is R Load 0.5
Gauss Iteration
There are a number of different iterative methods
we can use. We'll consider two: Gauss and Newton.
S*i n n
Vi*
YikVk YiiVi YikVk
k 1 k 1,k i
1 S*i n
Vi * YikVk
Yii V k 1,k i
i
Gauss Two Bus Power Flow Example
•A 100 MW, 50 Mvar load is connected to a generator through a line
with z = 0.02 + j0.06 p.u. and line charging of 5 Mvar on each end
(100 MVA base). Also, there is a 25 Mvar capacitor at bus 2. If the
generator voltage is 1.0 p.u., what is V2?
1 S*i n
Vi( v 1) ( v )* YikVk( v )
Yii V
i k 1, k i
hi (V1( v ) ,V2( v ) ,...,Vn(v ) )
But after we've determined Vi(v 1) we have a better
estimate of its voltage , so it makes sense to use this
new value. This approach is known as the
Gauss-Seidel iteration.
Gauss‐Seidel Iteration
Immediately use the new voltage estimates:
V2( v 1) h2 (V1 ,V2( v ) ,V3( v ) ,,Vn( v ) )
V3( v 1) h2 (V1 ,V2( v 1) ,V3( v ) ,,Vn(v ) )
V4( v 1) h2 (V1 ,V2( v 1) ,V3( v 1) ,V4( v ) ,Vn( v ) )
Vn( v 1) h2 (V1 ,V2( v 1) ,V3( v 1) ,V4( v 1) ,Vn( v ) )
The Gauss-Seidel works better than the Gauss, and
is actually easier to implement. It is used instead
of Gauss.
Gauss Two Bus Example, cont’d
V2 0.9622 j 0.0556 0.9638 3.3
Once the voltages are known all other values can
be determined, such as the generator powers and the
line flows
S1* V1* (Y11V1 Y12V2 ) 1.023 j 0.239
In actual units P1 102.3 MW, Q1 23.9 Mvar
2
The capacitor is supplying V2 25 23.2 Mvar
Slack Bus
In previous example we specified S2 and V1 and
then solved for S1 and V2.
We can not arbitrarily specify S at all buses
because total generation must equal total load +
total losses
We also need an angle reference bus.
To solve these problems we define one bus as the
"slack" bus. This bus has a fixed voltage
magnitude and angle, and a varying real/reactive
power injection.
Gauss with Many Bus Systems
With multiple bus systems we could calculate
new Vi ' s as follows:
1 S*i n
Vi( v 1) ( v )* YikVk( v )
Yii V
i k 1, k i
hi (V1( v ) ,V2( v ) ,...,Vn(v ) )
But after we've determined Vi(v 1) we have a better
estimate of its voltage , so it makes sense to use this
new value. This approach is known as the
Gauss-Seidel iteration.
Gauss‐Seidel Iteration
Immediately use the new voltage estimates:
V2( v 1) h2 (V1 ,V2( v ) ,V3( v ) ,,Vn( v ) )
V3( v 1) h2 (V1 ,V2( v 1) ,V3( v ) ,,Vn(v ) )
V4( v 1) h2 (V1 ,V2( v 1) ,V3( v 1) ,V4( v ) ,Vn( v ) )
Vn( v 1) h2 (V1 ,V2( v 1) ,V3( v 1) ,V4( v 1) ,Vn( v ) )
The Gauss-Seidel works better than the Gauss, and
is actually easier to implement. It is used instead
of Gauss.
Three Types of Power Flow Buses
There are three main types of power flow
buses
– Load (PQ) at which P/Q are fixed; iteration solves
for voltage magnitude and angle.
– Slack at which the voltage magnitude and angle
are fixed; iteration solves for P/Q injections
– Generator (PV) at which P and |V| are fixed;
iteration solves for voltage angle and Q injection
special coding is needed to include PV buses in the
Gauss‐Seidel iteration
Inclusion of PV Buses in G‐S
To solve for Vi at a PV bus we must first make a
guess of Qi :
n
Si* Vi* YikVk Pi jQi
k 1
( v )* n (v)
Hence Qi( v ) Im Vi YikV
k 1
k
In the iteration we use Si( v ) Pi jQi( v )
Inclusion of PV Buses, cont'd
Tentatively solve for Vi( v 1)
1 Si( v )* n
Vi( v 1) (v )* YikVk( v )
Yii V
i k 1, k i
But since Vi is specified, replace Vi( v 1) by Vi
Two Bus PV Example
Consider the same two bus system from the previous
example, except the load is replaced by a generator
z = 0.02 + j 0.06
Bus 1 Bus 2
V1 = 1.0 V2 = 1.05
(slack bus)
P2 = 0 MW
Two Bus PV Example, cont'd
1 S2*
V2 * Y21V1
Y22 V2
Q2 Im[Y21V1V2* Y22V2V2* ]
Guess V2 1.050
v S2( v ) V2( v 1) V2( v 1)
0 0 j 0.457 1.045 0.83 1.050 0.83
1 0 j 0.535 1.049 0.93 1.050 0.93
2 0 j 0.545 1.050 0.96 1.050 0.96
Generator Reactive Power Limits
The reactive power output of generators varies
to maintain the terminal voltage; on a real
generator this is done by the exciter
To maintain higher voltages requires more
reactive power
Generators have reactive power limits, which
are dependent upon the generator's MW
output
These limits must be considered during the
power flow solution.
Generator Reactive Limits, cont'd
During power flow once a solution is obtained
check to make generator reactive power output is
within its limits
If the reactive power is outside of the limits, fix Q
at the max or min value, and resolve treating the
generator as a PQ bus
– this is know as "type‐switching"
– also need to check if a PQ generator can again
regulate
Rule of thumb: to raise system voltage we need
to supply more vars
Accelerated G‐S Convergence
x ( v 1)
x (v) 1 (v) 2
( v ) (( x ) - 2)
2x
Newton‐Raphson Example, cont’d
x ( v 1)
x (v ) 1 (v) 2
( v ) (( x ) - 2)
2x
Guess x (0) 1. Iteratively solving we get
v x(v ) f ( x(v) ) x ( v )
0 1 1 0.5
1 1.5 0.25 0.08333
2 1.41667 6.953 103 2.454 103
3 1.41422 6.024 106
Sequential Linear Approximations
At each
iteration the
N-R method
uses a linear
approximation
to determine
Function is f(x) = x2 - 2 = 0. the next value
Solutions are points where for x
f(x) intersects f(x) = 0 axis
Newton‐Raphson Comments
When close to the solution the error
decreases quite quickly ‐‐ method has
quadratic convergence
f(x(v)) is known as the mismatch, which we
would like to drive to zero
Stopping criteria is when f(x(v)) <
Results are dependent upon the initial guess.
What if we had guessed x(0) = 0, or x (0) = ‐1?
A solution’s region of attraction (ROA) is the
set of initial guesses that converge to the
Multi‐Variable Newton‐Raphson
Next we generalize to the case where x is an n-
dimension vector, and f (x) is an n-dimension function
x1 f1 (x)
x f ( x)
x 2
f ( x) 2
x f ( x)
n n
Again define the solution xˆ so f ( xˆ ) 0 and
x xˆ x
Multi‐Variable Case, cont’d
The Taylor series expansion is written for each f i ( x)
f1 (x) f1 (x)
f1 (xˆ ) f1 (x) x1 x2
x1 x2
f1 (x)
xn higher order terms
xn
f n (x) f n (x)
f n (xˆ ) f n (x) x1 x2
x1 x2
f n (x)
xn higher order terms
xn
Multi‐Variable Case, cont’d
This can be written more compactly in matrix form
f1 (x)
f1 (x)
f1 (x)
xx2 xn
1
f ( x ) 1
x1
f (x) f 2 (x)
f 2 (x)
f 2 (x)
x
f (xˆ ) 2 x1x2 xn 2
f ( x)
n f (x) f n ( x) n
x
f n (x)
n
x1
x2 xn
higher order terms
Jacobian Matrix
The n by n matrix of partial derivatives is known
as the Jacobian matrix, J (x)
f1 (x) f1 (x)
f1 (x)
x x2 xn
1
f 2 (x) f 2 (x)
f 2 (x)
J (x) x1 x2 xn
f (x) f n (x) f n (x)
n
x1 x2 xn
Multi‐Variable N‐R Procedure
Derivation of N-R method is similar to the scalar case
f (xˆ ) f (x) J (x)x higher order terms
f (xˆ ) 0 f (x) J (x)x
1
x J ( x) f ( x)
x( v 1) x( v ) x( v )
x( v 1) x( v ) J (x( v ) ) 1 f (x( v ) )
Iterate until f (x( v ) )
Multi‐Variable Example
x1
Solve for x = such that f (x) 0 where
x2
f1 (x) 2 x12 x22 8 0
f 2 (x) x12 x22 x1 x2 4 0
First symbolically determine the Jacobian
f1 (x) f1 (x)
x x2
J (x) =
1
f 2 (x) f 2 (x)
x1 x2
Multi‐variable Example, cont’d
4 x1 2 x2
J (x) =
2 x1 x2 x1 2 x2
Then
1
x1 4 x1 2 x2 f1 (x)
x 2 x x x1 2 x2 f 2 (x)
2 1 2
1
Arbitrarily guess x (0)
1
1
1 4 2 5 2.1
x (1)
1 3 1 3 1.3
Multi‐variable Example, cont’d
1
2.1 8.40 2.60 2.51 1.8284
x (2)
1.3 5.50 0.50 1.45 1.2122
Each iteration we check f (x) to see if it is below our
specified tolerance
0.1556
f (x )
(2)
0.0900
If = 0.2 then we would be done. Otherwise we'd
continue iterating.
NR Application to Power Flow
We first need to rewrite complex power equations
as equations with real coefficients
*
n n
Si Vi YikVk Vi YikVk
*
Vi I i * *
k 1 k 1
These can be derived by defining
Yik Gik jBik
Vi Vi e ji Vi i
ik i k
Recall e j cos j sin
Real Power Balance Equations
n n
Si Pi jQi Vi Yik*Vk* Vi Vk e jik (Gik jBik )
k 1 k 1
n
Vi Vk (cos ik j sin ik )(Gik jBik )
k 1
Resolving into the real and imaginary parts
n
Pi Vi Vk (Gik cos ik Bik sin ik ) PGi PDi
k 1
n
Qi Vi Vk (Gik sin ik Bik cos ik ) QGi QDi
k 1
Newton‐Raphson Power Flow
In the Newton-Raphson power flow we use Newton's
method to determine the voltage magnitude and angle
at each bus in the power system.
We need to solve the power balance equations
n
Pi Vi Vk (Gik cos ik Bik sin ik ) PGi PDi
k 1
n
Qi Vi Vk (Gik sin ik Bik cos ik ) QGi QDi
k 1
Power Flow Variables
Assume the slack bus is the first bus (with a fixed
voltage angle/magnitude). We then need to determine
the voltage angle/magnitude at the other buses.
2 P2 (x) PG 2 PD 2
n Pn (x) PGn PDn
x f ( x)
V2 Q (x) QG 2 QD 2
2
n
V Qn (x) QGn QDn
N‐R Power Flow Solution
The power flow is solved using the same procedure
discussed last time:
Set v 0; make an initial guess of x, x( v )
While f (x( v ) ) Do
( v 1) ( v ) 1
x x J (x ) f (x
(v ) (v)
)
v v 1
End While
Power Flow Jacobian Matrix
The most difficult part of the algorithm is determining
and inverting the n by n Jacobian matrix, J (x)
f1 (x) f1 (x)
f1 (x)
x x2 xn
1
f 2 (x) f 2 (x)
f 2 (x)
J (x) x1 x2 xn
f (x) f n (x) f n (x)
n
x1 x2 xn
Power Flow Jacobian Matrix, cont’d
Jacobian elements are calculated by differentiating
each function, fi (x), with respect to each variable.
For example, if fi (x) is the bus i real power equation
n
fi ( x) Vi Vk (Gik cos ik Bik sin ik ) PGi PDi
k 1
fi ( x) n
i
Vi Vk (Gik sin ik Bik cos ik )
k 1
k i
fi ( x)
Vi V j (Gik sin ik Bik cos ik ) ( j i )
j
Two Bus Newton‐Raphson Example
For the two bus power system shown below, use th
Newton-Raphson power flow to determine the
voltage magnitude and angle at bus two. Assume
that bus one is the slack and SBase = 100 MVA.
Line Z = 0.1j
0 MW 200 MW
0 MVR 100 MVR
200.0 MW 200 MW
168.3 MVR 100 MVR
Two Bus Case Low Voltage Solution
This case actually has two solutions! The second
"low voltage" is found by using a low initial guess.
0
Set v 0, guess x (0)
0.25
Calculate
V2 (10sin 2 ) 2.0 2
f(x )
(0)
0.875
V2 (10 cos 2 ) V2 (10) 1.0
2
10 V2 cos 2 10sin 2 2.5 0
J (x )
(0)
0 5
10 V2 sin 2 10 cos 2 20 V2
Low Voltage Solution, cont'd
1
0 2.5 0 2 0.8
Solve x
(1)
0.25 0 5 0.875 0.075
1.462 (2) 1.42 0.921
f (x )
(2)
x x
(3)
0.534 0.2336 0.220
Low voltage solution
200.0 MW -200.0 MW
831.7 MVR Line Z = 0.1j -100.0 MVR
200.0 MW 200 MW
831.7 MVR 100 MVR
PV Buses
Since the voltage magnitude at PV buses is
fixed there is no need to explicitly include
these voltages in x or write the reactive
power balance equations
– the reactive power output of the generator
varies to maintain the fixed terminal voltage
(within limits)
– optionally these variations/equations can be
included by just writing the explicit voltage
constraint for the generator bus
|V | V 0
Three Bus PV Case Example
For this three bus case we have
2 P2 (x) PG 2 PD 2
x 3 f (x) P3 (x) PG 3 PD 3 0
V2 Q2 (x) QD 2
Line Z = 0.1j
0.941 pu
One 1.000 pu Two -7.469 Deg
170.0 MW 200 MW
68.2 MVR 100 MVR
Line Z = 0.1j Line Z = 0.1j
Three 1.000 pu
30 MW
63 MVR
Modeling Voltage Dependent Load
So far we've assumed that the load is independent of
the bus voltage (i.e., constant power). However, the
power flow can be easily extended to include voltage
depedence with both the real and reactive load. This
is done by making PDi and Q Di a function of Vi :
n
Vi Vk (Gik cos ik Bik sin ik ) PGi PDi ( Vi ) 0
k 1
n
Vi Vk (Gik sin ik Bik cos ik ) QGi QDi ( Vi ) 0
k 1
Voltage Dependent Load Example
In previous two bus example now assume the load is
constant impedance, so
P2 (x) V2 (10sin 2 ) 2.0 V2
2
0
Q2 (x) V2 (10 cos 2 ) V2 (10) 1.0 V2 0
2 2
0.894 pu
One 1.000 pu Two -10.304 Deg
160.0 MW 160 MW
120.0 MVR 80 MVR
Solving Large Power Systems
The most difficult computational task is
inverting the Jacobian matrix
– inverting a full matrix is an order n3 operation,
meaning the amount of computation increases
with the cube of the size size
– this amount of computation can be decreased
substantially by recognizing that since the Ybus is a
sparse matrix, the Jacobian is also a sparse matrix
– using sparse matrix methods results in a
computational order of about n1.5.
– this is a substantial savings when solving systems
ith t f th d fb
Newton‐Raphson Power Flow
Advantages
– fast convergence as long as initial guess is close to
solution
– large region of convergence
Disadvantages
– each iteration takes much longer than a Gauss‐
Seidel iteration
– more complicated to code, particularly when
implementing sparse matrix algorithms
Newton‐Raphson algorithm is very common in
power flow analysis