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

LOAD FLOW

A. J. Conejo

Univ. Castilla – La Mancha


2011

22 July 2011 1
The load flow problem

0. References
1. Introduction
2. Problem formulation
Two-bus case
Matrix YBUS
General equations
Bus classification
Variable types and
limits

22 July 2011 2
The load flow problem

3. The Gauss-Seidel solution technique


Introduction
Algorithm initialization
PQ Buses
PV Buses
Stopping criterion

22 July 2011 3
The load flow problem

4. The Newton-Raphson solution technique


Introduction
General fomulation
Load flow case
Jacobian matrix
Solution outline

22 July 2011 4
The load flow problem

5. Fast decoupled AC load flow


6. Adjustment of bounds
7. DC load flow
8. Comparison of load flow solution methods

22 July 2011 5
The load flow problem
References

1. A. Gómez Expósito, A. J. Conejo, C.


Cañizares. “Electric Energy Systems.
Analysis and Operation”. CRC Press, Boca
Raton, Florida, 2008.

2. A. R. Bergen, V. Vittal. “Power Systems


Analysis”. Second Edition. Prentice Hall,
Upper Saddle River, New Jersey, 1999.

22 July 2011 6
1. Introduction

22 July 2011 7
Introduction
• A snapshot of the system

• Most used tool in steady state power system


analysis

• Knowning the demand and/or generation of


power in each bus, find out:
– buses voltages
– load flow in lines and transformers
22 July 2011 8
Introduction

• The problem is described throught a non-


lineal system of equations

• Need of iterative solution techniques

• Solution technique: accuracy vs. computing


time

22 July 2011 9
Introduction

• Applications:
1. On-line analyses
• State estimation
• Security
• Economic analyses

22 July 2011 10
Introduction

2. Off-line analyses
• Operation analyses
• Plannig analyses
Network expansion planning
Power exchange planning
Security and adecuacy analyses
- Faults
- Stability

22 July 2011 11
2. Problem formulation

22 July 2011 12
Problem formulation
Two-bus case

We want to find out the relationship between


j
Si  Pi  jQi and Vi  Vie i in all buses of the power
system
I1 YS I2

V1 YG V2
YG

22 July 2011 13
Transmission line π model
Problem formulation
Two-bus case

Using Kirchhoff laws:


I1  V1 YG  ( V1  V2 ) Y S
I2  V2 YG  ( V2  V1) Y S

Matrix notation:
 I1   Y G  Y S  Y S   V1   Y11 Y12   V1 
I      V      V 
 2    YS Y G  Y S   2   Y 21 Y 22   2 
IBUS   YBUS  VBUS 
22 July 2011 14
Problem formulation
Two-bus case

• Complex power injected in each bus:


S1  SG1  SD1  P1  jQ1  V1  I1*
S2  SG2  SD2  P2  jQ2  V2  I2*

S1  V1  I1*  V1  ( Y11
*
V1*  Y12
*
V2* )
S2  V2  I2*  V2  ( Y21
*
V1*  Y22
*
V2* )

22 July 2011 15
Problem formulation
Two-bus case continuation
Notation:
Yik  Yik e j ik
Vi  Vi e j i

Replacing:
2
P1  jQ1  V1  Y1k Vk e j( 1 k 1k )
k 1
2
P2  jQ2  V2  Y2k Vk e j( 2 k 2k )
k 1
22 July 2011 16
Problem formulation
Two-bus case continuation

Therefore, the no lineal equations for the 2


buses network are:
2
Pi  Vi   Yik Vk cos (i  k  ik )
k 1
2
Qi  Vi   Yik Vk sin (i  k  ik )
k 1

i  1, 2

22 July 2011 17
Problem formulation
Matrix Ybus

• Two bus case

 Y11 Y12   YG  YS  YS 
YBUS  

 Y21 Y22    YS YG  YS 

22 July 2011 18
General building rules
Matrix Ybus
1. Self admittance of node i, Yii ,equals the
algebraic sum of all the admittances
connected to node i

2. Mutual admittance between nodes i and


k, Yik ,equals the negative of the sum of
all admittances connecting nodes i and k

3. Yik  Yki

22 July 2011 19
Problem formulation
Matrix Ybus

• Caracteristics of YBUS

1. YBUS is symmetric

is very sparse
2. YBUS

(>90% for more than 100 buses)

22 July 2011 20
Ybus example

Shunt element YG  j 0.01 (two per line)


Series element ZS  j 0.1

 j19.98 j10 j10 


YBUS   j10  j19.98 j10 
 
 j10 j10  j19.98 

22 July 2011 21
Problem formulation
General equations

• 2n equations (static load flow equations)


n
Pi  PGi  PDi  Vi   Yik Vk cos (i  k  ik ) 1
k 1
n
Qi  QGi  QDi  Vi   Yik Vk sin (i  k  ik ) 2
k 1

i  1,..., n
n  bus system

22 July 2011 22
Problem formulation
General equations
Polar representation for voltages and rectangular
for admittances
n
Pi  Vi   Vk (Gik cos ik  Bik senik ) [1]
k 1
n
Qi  Vi   Vk (Gik senik  Bik cos ik ) [2]
k 1
where
Y ik  Gik  j Bik
ik  i  k

22 July 2011 23
Problem formulation
General equations
• 4n variables

Vi, i,Pi, Qi ; i  1,...,n

• If 2n variables are specified, the other 2n are


determined by equations [1] and [2]

22 July 2011 24
Problem formulation
BUS Classification

1. PQ buses

Pi known ( PDi known, PGi zero)


Qi known (QDi known, QGi zero)

Vi unknown
i unknown

22 July 2011 25
Problem formulation
BUS Classification
2. PV buses
Pi known
Qi unknown

Pi known ( PGi specified, PDi known)


Vi known (specified)

Qi unknown ( QGi unknown, QDi known)


i unknown

22 July 2011 26
Problem formulation
BUS Classification

3. Slack bus, generator with large capacity.


V1 known (specified)
1 known (specified, typically 1  0 
reference)
P1 unknown ( PD1 known, PG1 unknown)
Q1 unknown ( QD1 known, QG1 unknown)

22 July 2011 27
Problem formulation
Variable types and limits

• Power balance

n n
 PGi   PDi  PLOSS
i1 i1

n n
 QGi   QDi  QLOSS
i1 i1

22 July 2011 28
Problem formulation
Variable types and limits
• Variable types

 Control variables
PGi (excepting slack bus)
QGi or V i

 Non-control variables
PDi QDi

 State variables
Vi i
22 July 2011 29
Problem formulation
Variable types and limits
• Variable limits

 Voltage magnitude Vi min  Vi  Vi max

 Power angle i  k  i  k max (every existing line)

 Power limits

PGi,min  PGi  PGi,max


QGi,min  QGi  QGi,max

22 July 2011 30
3.The Gauss-Seidel solution
technique

22 July 2011 31
Gauss-Seidel solution technique

No lineal system:
f (x)  0  x  F( x )

Iteration
x (r 1)  F( x (r ) )

Stoping rule
x (r 1)  x (r )  

22 July 2011 32
Gauss-Seidel solution technique
 Example f ( x)  x 2  5x  4  0
x  0 . 2 x 2  0 .8
x (r 1)  0.2( x (r ) )2  0.8 ; x ( 0 )  2
r  0, x (1)  0.2  22  0.8  1.6
r  1, x ( 2 )  0.2  1.6 2  0.8  1.312
r  2, x ( 3 )  0.2  1.312 2  0.8  1.1442
...
r  5, x ( 6 )  1.0103
r  6, x ( 7 )  1.0042
...
r  10, x (11)  1.0001
r  11, x (12 )
 1.0000
Many iterations!
r  12, x (13 )  1.0000
22 July 2011 33
Gauss-Seidel solution technique
Algorithm beginning
1) Known
Pi i  2,...,n (PV & PQ Buses)
Qi i  m  1,...,n (PQ Buses)
Vi i  2,...,m (PV Buses)
V1 slack bus
V i min , V i max i  m  1,...,n (PQ Buses)
QGi,min , QGi,max i  2,...,m (PV Buses)

22 July 2011 34
Gauss-Seidel solution technique
Algorithm beginning

2) Build YBUS

3) Initialize voltages
0
Vi  Vi i  m  1,...,n
0
i  i i  2,...,n

22 July 2011 35
Gauss-Seidel solution technique
PQ buses
4) PQ buses
* * * * n
Si  Pi  jQi  V i Ii  Vi Y ii V i  
V i Y ik Vk
k 1
k i

 
1 Pi  jQi n

Vi 
Y ii  V i*
  Y ik V k

k 1
 k i 
P  jQi
Ai  i i  m  1,...,n
Y ii
Y ik
Bik  i  m  1,...,n ; k  1,...,n ; k  i
Y ii
22 July 2011 36
Gauss-Seidel solution technique
PQ buses

At iteration (r+1) and bus i, the available values of


voltages at previous buses are used:

Ai i1 n
(r 1) (r 1)
  Bik V k  Bik V k
(r )
Vi  (r ) *

(Vi ) k 1 k i1

22 July 2011 37
Gauss-Seidel solution technique
PV buses

5) PV buses

* * * n
Si  Pi  jQi  V i Ii  
V i Y ik V k
k 1

 * n 
Qi   V i  Y ik V k 
 k 1 

22 July 2011 38
Gauss-Seidel solution technique
PV buses
At iteration (r+1):
 (r ) * i1 (r 1) (r ) * n (r ) 
Q(ir 1)  ( V i )  Y ik V k  ( V i )  Y ik V k 
 k 1 k i 

Pi  jQ(ir 1)
i  angleV i 
(r 1)
Ai 
Y ii

 A (r 1) i1 (r 1) n (r ) 



(ir 1)  angle (r )   Bik V k   Bik V k 
i
( V i )* k 1 k i1 
22 July 2011 39
Gauss-Seidel solution technique
PV buses

Beware of limits!
Q(ir 1)  Qi,min  Q(ir 1)  Qi,min & i becomes PQ
Q(ir 1)  Qi,max  Q(ir 1)  Qi,max & i becomes PQ

(more on this below)

22 July 2011 40
Gauss-Seidel solution technique
PV buses

6) Stop criterion

Vi(r 1)  Vi(r )   ; i  2,...,n

6.1) Slack bus power (after convergence)


* n
P1  jQ1  
V1 Y1k V k
k 1

22 July 2011 41
Gauss-Seidel solution technique
Algorith final calculations

6.2) Compute line currents (after convergence)


ILik  ( V i  V k ) YLik ; Iik 0  V i Y ik 0
ILki  ( V k  V i ) YLik ; Iki0  V k Y ki 0

Vi Vk
i ILik YLik ILki k

Sik Iik 0 Iki0 Sik

Y ik 0 Y ki0

22 July 2011 42
Gauss-Seidel solution technique
Algorith final calculations
6.2) Compute line complex power (after convergence)
* * * * *
Ski  V k ( V k  V i )YLik  V k V k Y ki 0 ;
* * * * *
Sik  V i ( V i  V k )YLik  V i V i Y ik 0 ;

Vi Vk
i ILik YLik ILki k

Sik Iik 0 Iki0 Sik

Y ik 0 Y ki0

22 July 2011 43
Gauss-Seidel solution technique
Algorith final calculations

6.3) Compute losses (after convergence)


Sloss , ik  Sik  Ski ;  k, i
Sloss   Sloss , ik
 k,i

7) If no convergence, go to step 4.

22 July 2011 44
Gauss-Seidel solution technique
Algorithm improvement

• Acceleration factor (in order to decrease


the number of iterations):
~
(r 1)
Vi(r 1)  V i   V i
(r ) (r )
 Vi 
  1.6 (generally recommended)

22 July 2011 45
Gauss-Seidel
Matlab code
function [Vfinal,angfinal,nite,P,Q,errorplot,tiempo]=Gaussgen(m,n,Ybus,Vmodini,Angini,P,Q,tol,Vmax,Vmin,Qmax,Qmin)
%--------------------------------------------------------------------------------------------------------------------------------------------------
%-function [Vmod,ang,nite,P,Qerrorplot,tiempo]=Gaussgen(m,n,Ybus,Vmodini,Angini,P,Q,tol,Vmax,Vmin,Qmax,Qmin)
%-Resuelve de forma general problema de carga por el m´etodo de Gauss-Seidel
%-donde:
%-2...m nudos PV; (m=1 cuando no hay nudos PV)
%-n nudos totales
%-Ybus matriz de admitancias
%-Vmodini tensiones iniciales modulo
%-Angini angulos iniciales RADIANES
%-P potencia activa inicial
%-Q potencia reactiva inicial
%-tol tolerancia para error en tension y potencia reactiva
%-Vmax Vmin valores limites aceptables para las tensiones
%-Qmax Qmin valores limites aceptables para las potencias reactivas
%-nite n´umero de iteraciones
%-Vfinal vector con todas las potencias para cada iteraci´on
%-angfinal igual pero con los ´angulos
%-tiempo, tiempo invertido en hacer las operaciones
%---------------------------------------------------------------------------------------------------------------------------------------------------
%calculo de la matriz B
B=zeros(n,n);
for t=1:n
for k=1:n
B(t,k)=Ybus(t,k)/Ybus(t,t);
end
end

22 July 2011 46
Gauss-Seidel
Matlab code 2
%calculos los valores en coordenadas cuadrangulares de la tension
V=zeros(n,1);
for a=1:n
V(a)=Vmodini(a)*exp(i*Angini(a));
end
ang=Angini;
%empieza el bucle:
error=1; %valores iniciales para poder entrar en el bucle
errorQ=1;
nite=0;
tic;
while max(abs(error))>tol | max(abs(errorQ))>tol
nite=nite+1;
Vmod=abs(V);
Vini=V;
ang=angle(V);
Qini=Q;
%calculo las reactivas para los nudos PV
if m>1
for l=2:m
AQ=0;
for k=1:n
AQ=AQ+Ybus(l,k)*V(k);
end
Q(l)=-imag((V(l)')*AQ);
end
22 July 2011 47
%calculo las A para todos los nudos:
for a=1:n
A(a)=(P(a)-i*Q(a))/Ybus(a,a);
end Gauss-Seidel
%calculo los angulos nudos PV:

for l=2:m
Matlab code 3
Aang=0;
for k=1:n
Aang=Aang+B(l,k)*V(k);
end
ang(l)=angle(A(l)/((V(2))')-Aang+B(l,l)*V(l));
end
end
for a=1:n
A(a)=(P(a)-i*Q(a))/Ybus(a,a);
end
%ahora actualizo los voltajes otra vez:
for a=1:n
V(a)=Vmod(a)*exp(i*ang(a));
end
%ahora calculo los nudos PQ
AV=zeros(n,1);
for p=m+1:n
for k=1:n
AV(p)=AV(p)+B(p,k)*V(k);
end
V(p)=A(p)/((V(p))')-AV(p)+B(p,p)*V(p);
end
error=Vini-V;
errorQ=Qini-Q;
errorplot(1,nite)=norm(abs(error));
Vfinal(:,nite)=abs(V);
angfinal(:,nite)=ang*180/pi; %paso a grados
22 July 2011 end 48
Gauss-Seidel
Matlab code 4
%calculos los valores de potencia para el nudo slack:
S1=0;
for t=1:n
S1=S1+(V(1)')*(Ybus(1,t)*V(t));
end
P(1)=real(S1);
Q(1)=-imag(S1);
tiempo=toc;
%alerta por si se sobrepasan valores aceptables:
if max(Vmod)>Vmax | min(Vmod)<Vmin
disp('¡¡SE SOBREPASAN LIMITES TENSIONES!!')
end
if max(Q)>Qmax | min(Q)<Qmin
disp('¡¡SE SOBREPASAN LIMITES REACTIVA!!')
end
ang=(180/pi)*angle(V);
Vmo=abs(V);
%represento los errores por iteraci´on:

plot(1:nite,errorplot,'o');grid on;xlabel('iteraci´on');ylabel('error por iteraci´on');title('evoluci´on error tesi´on');

%------------------------------------------------------------%
% %
% Realizado por Carlos Ruiz Mora octubre 2006 %
% %
%------------------------------------------------------------%

22 July 2011 49
Gauss-Seidel example

22 July 2011 50
G-S Example
Solution tolerance is set to 0.1 MVA.

ONE TWO

THREE

22 July 2011 51
G-S Example

Data below. Base power is SB=100 MVA:

Bus Voltage (p.u.) Power Lin Impedance (p.u.)

(slack)
1 1.02 1-2 0.02+0.04j

2 1.02 PG=50 MW 1-3 0.02+0.06j

3 - PC=100 MW 2-3 0.02+0.04j


QC=60 MVAr (each)

22 July 2011 52
Solution procedure
1. Data and unknown:

Bus Type Data Unknown

1 Slack V1=1.02 1=0.0 P1 Q1

2 PV V2=1.02 P2=0.5 δ 2 Q2

3 PQ P3=-1.0 Q2=-0.6 δ3 V3

22 July 2011 53
Solution procedure

YBUS

ONE TWO

 15  35 j  10  20 j  5  15 j 
YBUS   10  20 j 30  60 j  20  40 j
 
  5  15 j  20  40 j 25  55 j 
THREE

22 July 2011 54
Solution procedure

3. Voltage magnitude initialization (iteration 0):

PQ bus
V3  V30  1

2  02  0 All buses but the reference one


3  03  0

Vector form:

1.02 0
V 0  1.02 0  0
   
 1  0
22 July 2011 55
Solution procedure

Per iteration:

- PV buses (Q, δ) i=2,...,m (bus 2)

- PQ buses (V, δ) i=m+1,...,n (bus 3)

- Stopping criterios:
a) convergence  Sslack and power flows;
b) no converge  new iteration

22 July 2011 56
Solution procedure

4. PV buses: iteration (r+1) :


bus 2:


Q(2r 1)   ( V2(r ) )* Y21V1( r 1)  ( V2(r ) )* Y22 V2( r )  ( V2(r ) )* Y23 V3( r ) 

P2  jQ(2r 1)
2  angle [ V2 ] A (2r 1) 
Y22

22 July 2011 57
Solution procedure

 A (2r 1) (r ) 
(2r 1) ( r 1)
 angle (r 1) *  B21V1  B23 V3 
( V2 ) 

where

Yik
Bik  is a constant
Yii

22 July 2011 58
Solution procedure
5. Buses PQ iteration (r+1):
bus 3:
A3
V3(r 1)  (r ) *  B31V1(r 1)  B32 V2(r 1)
( V3 )
where
P3  jQ3
A3 
Y33
Are constants for PQ buses
Yik
Bik 
Yii

22 July 2011 59
Solution procedure

6. Stopping criterion:

  10 3

| Vi(r 1)  Vi(r ) |


&  i  2, 3; j  2
| Q(jr 1)  Q(jr ) |

22 July 2011 60
Solution procedure

If convergence:

6.1) Slack power

*
Sslack  P1  jQ1  V1* ( Y11V1  Y12 V2  Y13 V3 )

6.2) Power flows  S12 , S21, S13 , S23 , S31, S32

Sik  Vi ( Vi - V *k )YLik
* *

22 July 2011 61
Solution procedure
6.3) Line losses:

Slosss ,ik  Sik  Ski k, i  1,2,3

Sloss  Sloss ,12  Sloss ,13  Sloss ,23

7. If no coveergence, the procedure continues in Step 4.

22 July 2011 62
Implementation

MATLAB:

22 July 2011 63
Solution
11 iterations needed to attain the solution

Iteration (pu) 1 2 3 ... 10 11


0.5083
P1 ,Q1(slack) - - - ... -
0.0716
P2 0.5 0.5 0.5 ... 0.5 0.5

Q2 0.81 0.4084 0.4696 ... 0.5493 0.5501

P3 -1.0 -1.0 -1.0 ... -1.0 -1.0

Q3 -0.6 -0.6 -0.6 ... -0.6 -0.6

22 July 2011 64
Solution

Iteration 1 2 3 ... 10 11
V1 1.02 1.02 1.02 ... 1.02 1.02
1 (º ) 0 0 0 ... 0 0
V2 1.02 1.02 1.02 ... 1.02 1.02

2 (º ) 0.0675 -0.1596 -0.2885 ... -0.4667 -0.4685

V3 1.0041 1.0042 1.0043 ... 1.0043 1.0043

3 (º ) -0.5746 -0.7336 -0.8278 ... -0.9580 -0.9593

22 July 2011 65
Solution

Errors for |V| & |Q|:

Iteration 1 2 3 ... 10 11

Max. Error V 0.0041 9.68·10-5 5.05·10-5 ... 1.15·10-6 6.74·10-7

Max. Error Q 0.8160 0.4076 0.0612 ... 0.0014 8.11·10-4

22 July 2011 66
Final Solution

Bus P (MW) Q (MVAr ) V (pu)


1 50.83 7.16 1.02  0º
2 50.00 55.01 1.02 -0.4685º
3 -100 -60.00 1.0043  -0.9593º

22 July 2011 67
Checking

Checking using Power-World:

ONE TWO

THREE

22 July 2011 68
Checking

Bus 1 Bus 2 Bus 3


Solution G-S PW G-S PW G-S PW
V (pu) 1.02 1.02 1.02 1.02 1.0043 1.0043
δ(º) 0 0 -0.4685 -0.4710 -0.9593 -0.9612
P (MW) 50.83 50.98 50.00 50.00 -100 -100
Q (MVAr) 7.16 7.10 55.01 55.12 -60 -60

22 July 2011 69
Checking

Variable V δ P Q

Error Max. (%) 0% 0.53 % 0.29% 0.84 %

22 July 2011 70
4. The Newton-Raphson solution
technique

22 July 2011 71
The Newton-Raphson solution technique
Introduction

• One variable
f ( x )  0, f ( x ( 0 ) )  0, f ( x (0 )  x ( 0 ) )  0
(0)
( 0 )  df 
f ( x  x )  0  f ( x )  x  
(0) (0) (0)
 ...
 dx 
f ( x(0) )
x ( 0 )   (0)
; x (1)  x ( 0 )  x ( 0 )
 df 
 
 dx 
f ( x (r ) )
x (r 1)  x (r )  (r )
 df 
 
 dx 
22 July 2011 72
The Newton-Raphson solution technique
Introduction
• Example
df ( x )
f ( x )  x 2  5 x  4  0;  2x  5
dx
( r 1) ( x ( r ) )2  5 x ( r )  4 ( 0 )
x x (r )
 ; x  0 .5
2x  5
(r )

0 .5 2  5  0 . 5  4
x (1)
 0 .5   0.9375
2  0 .5  5
0.9375 2  5  0.9375  4
x ( 2)
 0.9375   0.9988
2  0.9375  5
0.9988 2  5  0.9988  4
x (3)
 0.9988   1.0000
2  0.9988  5

Fast!
22 July 2011 73
The Newton-Raphson solution technique
General formulation

• General case

f ( x )  0 : Rn  Rn f ( x ( 0 ) )  0, f ( x ( 0 )  x ( 0 ) )  0
f ( x ( 0 )  x )  f ( x ( 0 ) )  J( 0 )  x ( 0 )  0

x (0)
J  ( 0 ) 1
f ( x(0) )
x (1)  x ( 0 )  x ( 0 )

x (r 1)
x (r )
 
J(r ) 1
f ( x (r ) )

22 July 2011 74
The Newton-Raphson solution technique
General formulation

 f1 f1 f1 


 x 
 x1   f1  x 2 x n 
 1 
x  f   f2 f2 f2 

x   2 f   2 J   x1 x 2 x n 
   
x  f    
 n  n  fn fn fn 
  
 x1 x 2 x n 

22 July 2011 75
The Newton-Raphson solution technique
Load flow case
 (2r ) 
 ( r ) 
 3 
   n
(r )  fiP ()  Vi   Vk (Gik cos ik  Bik sinik )
x  (r )
  (r ) 
n

 Vm1 
k 1
n

  fiQ ()  Vi   Vk (Gik sinik  Bik cos ik )


   k 1

 Vn(r )1 
 (r ) 
 Vn 
Pi ()  fiP, Pi  Pi,sp
Qi ()  fiQ, Qi  Qi,sp
 2 ,..., n ; Vm1,..., Vn

22 July 2011 76
The Newton-Raphson solution technique
Load flow case

Using Taylor:
(r ) (r ) (r ) (r )
 f   f   f   f 
Pi,sp  fiP(r )   iP  (2r )  ...   iP  (nr )   iP  Vm(r)1  ...   iP  Vn(r )
  2   n   Vm1   Vn 
(r ) (r ) (r ) (r )
 f   f   f   f 
Qi,sp  fiQ(r )   iQ  (2r )  ...   iQ  (nr )   iQ  Vm(r)1  ...   iQ  Vn(r )
  2   n   Vm1   Vn 

The increments below should be 0:

Pi(r )  Pi,sp  fiP(r ) ; Q(ir )  Qi,sp  fiQ(r )

22 July 2011 77
The Newton-Raphson solution technique
Load flow case
Matrix notation:

 P2(r )    f  (r )  f2P 
(r )
   (r )
2

    2P  ... ...     
      2   Vn    
 P2(r )   ... ... ... ...    (r ) 

 (r )     (r ) 
n

Qm1   ... (r ) ... ... ...  Vm1 
     fnQ   fnQ     
(r )

    ... ...     (r ) 

 Qn    2 
(r )   n    Vn 

22 July 2011 78
The Newton-Raphson solution technique
Jacobian matrix

• PQ buses generate 2 Jacobian rows


corresponding to ΔP and ΔQ

• PV buses generate 1 Jacobian row


corresponding to ΔP

22 July 2011 79
The Newton-Raphson solution technique
Jacobian elements

• Jacobian dimension

2  NPQ  NPV
NPQ Number of PQ buses
NPV Number of PV buses

22 July 2011 80
The Newton-Raphson solution technique
Jacobian elements

• Jacobian dimension

P(r )  H(r ) N(r )   (r 1) 


 (r )    (r ) (r ) 
 V (r 1) 
Q   J L   V (r ) 
V (r 1) (r 1)
instead of V
V (r )
for improving computational efficiency

22 July 2011 81
The Newton-Raphson solution technique
Jacobian elements
 m  k
Pk
Hkm   Vk Vm (Gkm sinkm  Bkm cos km )
m
Pk
Nkm  Vm  Vk Vm (Gkm cos km  Bkm sinkm )
Vm
Qk
Jkm    Vk Vm (Gkm cos km  Bkm sinkm )
m
Qk
Lkm  Vm  Vk Vm (Gkm sinkm  Bkm cos km )
Vm

22 July 2011 82
The Newton-Raphson solution technique
Jacobian elements
k  m
Pk
Hkk   Qk  Bkk Vk2  Note :
k
Pk
Nkk  Vk  Pk  Gkk Vk2 km  k  m
Vk
Qk
Jkk   Pk  Gkk Vk2 Y km  Gkm  jBkm
k
Qk
Lkk  Vk  Qk  Bkk Vk2
Vk

22 July 2011 83
The Newton-Raphson solution technique
Solution outline

1. Build YBUS
2. Specify 1  0
Pi i  2,...,n
Qi i  m  1,...,n
Vi i  2,...,m
V1

i , i  2,...,n
3. Initialize 
 V i , i  m  1,...,n
22 July 2011 84
The Newton-Raphson solution technique
Solution outline

4. Compute Pi(r ) (for PV & PQ Buses), Q(ir ) (for PQ Buses)


5. If Pi(r )  P & Q(ir )  Q
1) P1  jQ1

then compute 2) line flows
3) Stop

else go on

6. Compute submatrices H(r ), N(r ), J(r ), L(r )


22 July 2011 85
The Newton-Raphson solution technique
Solution outline

7. Solve  (r 1)  H(r ) N(r )  1  P(r ) 


V (r 1)    (r ) (r )   (r ) 
 V (r )   J L  Q 

8. Update
(r 1)  (r )  (r 1) PV & PQ Buses
V (r 1)  V (r )  V (r 1) PV Buses

9. Go to step 4
22 July 2011 86
The Newton-Raphson, Matlab Code
function [V_modulo, V_fase, P, Q, N_iter, T_calculo, Error_p] = nraphson(V_modulo_ini, V_fase_ini, P_ini, Q_ini, Y, npv)

%
% [V_modulo, V_fase, P, Q, N_iter, T_calculo, Error_p] = nraphson(V_modulo_ini, V_fase_ini, P_ini, Q_ini, Y, npv)
%
% Obtencion de indices de nodos: 1 -> SLACK;
% 2,...,M -> PV;
% M+1,...,N -> PQ

n = length(V_modulo_ini);
m = npv + 1;

% Parametros del Metodo


Tol = 0.0001; % Tolerancia del metodo (Perdida de potencia).
Error_p = 1; % Error inicial (A un valor mayor que Tol).
N_iter = 0; % Numero de iteraciones.

% Valores iniciales
V_modulo= V_modulo_ini';
V_fase = V_fase_ini';
P = P_ini';
Q = Q_ini';
j=sqrt(-1);

22 July 2011 87
The Newton-Raphson, Matlab Code
tic;
while (Error_p > Tol) % Bucle principal (Se permiten 50 iteraciones como mucho).
if (N_iter >50)
error('Demasiadas iteraciones');
break
end
V = V_modulo.*exp(j*V_fase); % Expresion compleja de la tension
S = V.*conj(Y*V); % Expresion compleja de la potencia
DP = P(2:n)-real(S(2:n)); % Incremento de potencia activa (nudos PV y PQ)
DQ = Q(m+1:n)-imag(S(m+1:n)); % Incremento de potencia reactiva (nudos PQ)

PQ = [DP ; DQ];
Error_p = norm(PQ,2); % Error en esa iteracion

DS_DA = diag(V)*conj(Y*j*diag(V)) + diag(conj(Y*V))*j*diag(V);


DS_DV = diag(V)*conj(Y*diag(V./V_modulo)) + diag(conj(Y*V))*diag(V./V_modulo);

% Construccion del Jacobiano


J = [real(DS_DA(2:n , 2:n)) real(DS_DV(2:n , m+1:n))
imag(DS_DA(m+1:n , 2:n)) imag(DS_DV(m+1:n , m+1:n))]

dx=J\PQ; % indices: 1...n-1 = fases en PV y PQ; n...final = modulos en PQ

22 July 2011 88
The Newton-Raphson, Matlab Code
V_fase (2:n) = V_fase(2:n) + dx(1:n-1); % Actualizamos la fase de las tensiones (nudos PV y PQ)
V_modulo (m+1:n)= V_modulo(m+1:n) + dx(n:end); % Actualizamos el modulo de las tensiones (nudos PQ)

N_iter = N_iter + 1; % Incremento el numero de iteraciones

disp('Pulse una tecla para continuar')


pause
end
P=real(S); % Calculo de la potencia activa
Q=imag(S); % Calculo de la potencia reactiva
V_fase=V_fase*180/pi; % Paso de Radianes a grados
T_calculo=toc;

% **** ENTRADAS ****


%
% V_modulo_ini = Modulo de la tension para comenzar a iterar (conocidos en SLACK y PV).
% V_fase_ini = Fase de la tension para comenzar a iterar (conocido en SLACK).
% P_ini = Potencia activa en los nodos (conocido en PV y PQ).
% Q_ini = Potencia reactica en los nodos (conocido en PQ).
% Y = Matriz de admitancias nodales.

22 July 2011 89
The Newton-Raphson, Matlab Code
% **** SALIDAS ****
%
% V_modulo = Modulo de la tension en todos los nodos.
% V_fase = Fase de la tension en todos los nodos.
% P = Potencia activa en todos los nodos.
% Q = Potencia reactiva en todos los nodos.
% N_iter = Numero de iteraciones.
% T_calculo = Tiempo de calculo.
% Error_p = Error.
%
%
% **** OBSERVACIONES ****
%
% Los nodos deben estar ordenador asi:
%
% *1 : SLACK.
% * 2...m : PV.
% * m+1...n : PQ.
%
%
% **** FECHA Y AUTOR ****
%
% Laura Laguna - Octubre de 2005

22 July 2011 90
Ejemplo resuelto por el método
de Newton-Raphson

22 July 2011 91
Newton-Raphson Example

• Checking with Matlab and PowerWorld

22 July 2011 92
Newton-Raphson Example

ONE TWO

Bus Voltage p.u Power


1 1.02 -
THREE

2 1.02 PG=50 MW

3 - PC= 100 MW
QC=60 MVAr
22 July 2011 93
Newton-Raphson Example

Data:

Line Impedance p.u.


1-2 0.02+0.04j
1-3 0.02+0.06j
2-3 0.02+0.04j each

22 July 2011 94
Newton-Raphson Example
• 3 buses:
• Bus1: Slack
• Bus 2: PV
• Bus 3: PQ

• Voltage magnitude at bus 3 initialized at 1.02.

• Angles intitialized to zero.

22 July 2011 95
Newton-Raphson Example

Y bus:
 15.0000 - 35.0000j - 10.0000 + 20.0000j - 5.0000 + 15.0000j 
 
Y   - 10.0000 + 20.0000j 30.0000 - 60.0000j - 20.0000 + 40.0000j 
 - 5.0000 + 15.0000j 25.0000 - 55.0000j 
 - 20.0000 + 40.0000j

Intitialization:
 2  3  0
V3  1.02

22 July 2011 96
Newton-Raphson Example

Residuals:
3
Pi  Piesp - Vi ∑Vj (Gij cos ij  Bijsen(ij )) i  2,3
j1

3
Qi  Qiesp - Vi ∑Vj (Gijsenij - Bij cos(ij )) i  3
j1

22 July 2011 97
Newton-Raphson Example

Checking:

P2cal  0.3624·1014   P2   0.5  P2   0.5 


cal

 cal       cal   1 
P
 3    0   P
 3    1  P3 
  
Q3  7.2475·10 
cal 15
Q3   0.6  Q3   0.6
cal
   

No tolerance satisfied: the process continues.

22 July 2011 98
Newton-Raphson Example

Jacobian:

 H22 H23 N23   62.4240  41.6160  20.4000 


   
J   H32 H33 N33  J    41.6160 57.2220 25.5000 
M   20.8080
 32 M33 L 33 
  26.0100 56.1000 

22 July 2011 99
Newton-Raphson Example

First iteration:

 
  2  - 0.4557 1.0200  0 
 3   - 0.9406    
V  1.0200 ;    - 0.4557
V   
1.0046  - 0.9406
 3  - 0.0154    
 V3 

22 July 2011 100


Ejemplo por Newton-Raphson

Residuals:

P2cal   0.4958   P2   0.5  0.4958   0.0042 


 cal      P     1  ( 0.9835)    0.0165
P
 3     0.9835  3    
Q3   0.5874
cal
Q3   0.6  ( 0.5874)  0.0126
 

No convergence.

22 July 2011 101


Newton-Raphson Example

Jacobian for iteration 2:

 61.8860  41.1614  20.0540 


 
J    40.8145 56.0994 24.1371 
 20.8409  26.2162 54.6707 

22 July 2011 102


Newton-Raphson Example

State variables at iteration 2

  1.0200   0 
 2   - 0.0154     
 3    - 0.0206  V  1.0200 ;    - 0.4710 
V    1.0043   - 0.9612 
 3  - 3.0024·10     
-4

 V3 

22 July 2011 103


Newton-Raphson Example

Residuals:

P2cal   0.5000   P2   0.5  0.5000   0.0664·10 


5

 cal         5 
P3     1.0000   P3     1  ( 1.0000)     0.5454·10 
Qcal   0.6000 
 Q 
   0.6  ( 0.6000)
   4.9698·10 6 
 3  3 
Tolerance OK.

22 July 2011 104


Newton-Raphson Example
Jacobian iteration 3:

 61.8860  41.1614  20.0540 


 
J    40.8145 56.0994 24.1371 
 20.8409  26.2162 54.6707 

 
  2 
 - 0.6458·10-5
 1.0200   0 
   
 3   - 0.7534·10-5  V  1.0200 ;    - 0.4710 
V   
1.0043   - 0.96810 
   - 1.1106·10-7 
   
3

 V3

22 July 2011 105


Newton-Raphson Example

Final power values:

P1   0.5098   Q1   0.0710 


P    0.5000  Q    0.5513 
 2    2  
P3   1.0000 Q3   0.6000

22 July 2011 106


Newton-Raphson Example
convergence

22 July 2011 107


Newton-Raphson Example
convergence

22 July 2011 108


Newton-Raphson Example
convergence

22 July 2011 109


Newton-Raphson Example
convergence

22 July 2011 110


Power World
5 0 ,9 7 7 M W 5 0 ,0 0 0 M W
7 ,0 9 5 M var 5 5 ,1 2 6 M var

UNO
C ERO

1 ,0 2 0 pu
1 ,0 2 0 pu
0 ,0 0 0 Deg
-0 ,4 7 1 Deg

DO S

1 ,0 0 4 3 pu
-0 ,9 6 1 Deg

100 MW
6 0 M var

22 July 2011 111


Newton-Raphson Example

Bus V(p.u) δ P Q
0 (PW) 1.02 0 50.9763 7.0955
0 1.02 0 50.9755 7.0954
1 (PW) 1.02 -0.4710 50 55.1256
1 1.02 -0.4710 50.0006 55.1228
2 (PW) 1.0043 -0.9612 -100 -60
2 1.0043 -0.9612 -99.9989 -59.9970

22 July 2011 112


Newton-Raphson Example

• Largest error below 0.1 MVA.

• More effective technique than Gauss Seidel.

• Convergence is fast (if adequate initialization).

22 July 2011 113


Including tap-changing transformers

22 July 2011 114


Tap-Changing transformer

• A tap changing transformer makes the


admitance matrix dependent on the
transformer parameter t.

• The Jacobian matrix also depends on t.

22 July 2011 115


Admitance matrix

Equivalent circuit:

t:1 Ycc
Ycc i t j
i j

1 t t 1
Ycc 2 Ycc
t t
t 1

22 July 2011 116


Admitance matrix

• General building rules


1. Self admittance of node i, Yii , equals the
algebraic sum of all the admittances
connected to node i
2. Mutual admittance between nodes i and
k, Yii , equals the negative of the sum of
all admittances connecting nodes i and k
3. Yik  Yki

22 July 2011 117


Tap-changing
Example

22 July 2011 118


Tap-changing
Example
1 Z13 3 Z 23 2

Yshunt 13 Yshunt 13 Yshunt 23 Yshunt 23

Ycc
t 4
The tap-changing
transformer
controls voltage 1 t t 1
Ycc 2 Ycc
of bus 4 t t

22 July 2011 119


Tap-changing
Example
1
Y11   Yshunt 13 ; Y12  0 ;...
Z13
1 1 1  t Ycc
... Y33   Yshunt 13   Yshunt 23  Ycc 2 
Z13 Z 23 t t
Ycc
Y34  
t
Ycc t 1
Y44   Ycc  Ycc
t t

It does not depend


22 July 2011
on t! 120
Tap-changing
Example

 Y11 Y12 Y13 Y14 


Y Y22 Y23 Y24 
Y 21 
 Y31 Y32 Y33 ( t ) Y34 ( t )
Y 
 41 Y42 Y43 ( t ) Y44 

22 July 2011 121


Tap-changing transformer

Load flow equations:


n
Pi  Vi   Vk Gik cos ik  Bik sin ik 
k 1

n
Qi  Vi   Vk Gik sin ik  Bik cos ik 
k 1

22 July 2011 122


Tap-changing transformer
Taylor Expansion:
(r ) (r ) (r )
 fiP   fiP   fiP 
Pi dato
f (r )
   (r )
 ...     (r )
   Vm 1  ...
(r )

  2   n   Vm1 
iP 2 n

(r )
 fiP 
(r )
 fiP 
...    V (r )
  t  t (r )


n
 n
V  
(r ) (r ) (r )
 f   f   f 
Qidato  fiQ(r )   iQ  (2r )  ...   iQ  (nr )   iQ  Vm(r)1  ...
  2   n   Vm1 
(r ) (r )
 fiQ   fiQ 
...    V (r )
  t  t (r )


n
 n
V  
22 July 2011 123
Tap-changing transformer

• The admitance matrix depend on t.

• The Jacobian matrix has a new column.

• The new variable (t) replace the voltage value


at the corresponding PQ bus.

22 July 2011 124


Tap-changing transformer

• Increment Δt is divided by t to improve


computational efficiency.

• The Jacobian matrix maintains its # of column


& rows.

• The variable t is considered in the last place.

22 July 2011 125


Tap-changing transformer

The Jacobian matrix blocks are:


H(r ) N(r ) C(r ) 
J   (r ) (r ) (r ) 
M L D 

H, N, M & L are the standard blocks.


Submatrix C & D have as many columns as
the # of tap-changing transformers.

22 July 2011 126


Tap-changing transformer

Derivatives with respect to t:


fiP n
 Gik Bik 
Ci  t   t  Vi  ∑Vk  cos ik  sinik 
t k 1  t t 

fiQ n
 Gik Bik 
Di  t   t  Vi  ∑Vk  sinik cos ik 
t k 1  t t 

C & D multiplied by t!
22 July 2011 127
Tap-changing transformer

Iterative procedure analogous, but:

• If t hit any of its limit, it is fixed to the limit &


the corresponding bus becomes PQ.

• If the procedure converge, fix t at its closest


integer value & continues the iteration with
that t fixed.

22 July 2011 128


Tap-changing
Example

1.- Slack
2.- PV
3.- PQ
4.- PQ
5.- PQV

22 July 2011 129


Tap-changing
Example

Data:

Line impedances: 0.001+j0.05 p.u.


Shunt admitances: j0.05 p.u. (2 per line).
Transformer: 0.9<t<1.1, steps of 0.005; Zcc=j0.1.

22 July 2011 130


Tap-changing
Example
Bus Voltage (pu). Power

1 1.00 Slack

2 1.00 Pg=150MW

3 -- Pc=50MW, Qc=10MVAr

4 -- Pc=0MW, Qc=0MVAr

5 1.00 Pc=100MW,Qc=50MVAr

22 July 2011 131


Tap-changing
Example
Ylínea Ylínea Ylínea
1 2 4 3

Yshunt Yshunt Yshunt


Yshunt Yshunt
Yshunt
Ycc 5
t

1 t t 1
Ycc 2 Ycc
t t

22 July 2011 132


Tap-changing
Example

Admitance matrix:

 Yl  Ys Yl 0 0 0 
 Y 2Yl  2Ys 0 Yl 0 
 l 
 0 0 Yl  Ys Yl 0 
YBUS  Ycc (1 t ) Ycc 
 0 Yl Yl 2Yl  2Ys   Ycc 2 
 t t t 
 0 Ycc
0 0 Ycc 
 t 

22 July 2011 133


Tap-changing
Example
 0.3998  j19.942  0.3998  j19.992 0 0 0 
 0.3998  j19.992 0.7997  j39.884 0  0 .3998  j19 .992 0 
 
Ybus   0 0 0.3998  j19.942  0.3998  j19.992 0 
 
 0  0 .3998  j19.992  0 .3998  j19. 992 0 .7997  j49 . 884 j10 
 0 0 0 j10  j10

Variable initial values:


2  3   4  5  0;
V3  V4  1;
t  1;
22 July 2011 134
Tap-changing
Example
Increment calculations:
 P2   1.5  P2cal   1.5 
 P   cal    0 .5 
 3   0 . 5  P 3   
 P4    P4cal   0 
   cal   
 
 5    1  P5    1 
P 
 Q3    0.1  Qcal    0.1
   3
  
Q 4    Q 4   0 
cal

 Q   0.5  Qcal   0.5


 5  5   

22 July 2011 135


Tap-changing
Example
Jacobian

 39.984 0  19.992 0 0  0.3998 0 


 0 19.992  19.992 0 0.3998  0.3998 0 
 
 19.992  19.992 49.984  10  0.3998 0.7997 0 
J 0 0  10 10 0 0 0 

 0  0.3998 0.3998 0 19.892  19.992 0 
 
 0.3998 0.3998  0.7997 0  19.992 49.754  10 
 0 0 0 0 0  10 10 

22 July 2011 136


Tap-changing
Example
First iteration:
  2 
  
 3  
0
  4   0.0993   1   0 
    
  0 . 0744   1   0 
 5    
 
 V3    0.1744  V  0.9623 ;    0.0993 ; t  0.918
 V3   
 0.968   0.0744 
 V    0 . 0377 
     
 4
  0.032   1   0.1744 
 V4  
 t    0.082 
 t 
22 July 2011 137
Tap-changing
Example

Admitance matrix:

 0.3998  j19.942  0.3998  j19.99 0 0 0 


 0.3998  j19.992 0.7997  j39.884 0  0.3998  j19.992 0 
 
Ybus  0 0 0.3998  j19.94  0.3998  j19.992 0 
 0  0 . 3998  j19 . 992  0 . 399  j19 . 99 0 . 7997  j51 . 750 j10 . 8933 
 
 0 0 0 j10.893  j10 

22 July 2011 138


Tap-changing
Example
Power computation:

 P1   0   Q1    0.05 
P   1.4521  Q   0.5647 
 2    2  
P3    0.4657  Q3    0.1407 
P    Q   
 4  0 . 069   4  0 . 1027 
P5    1.0527  Q5    0.492 

22 July 2011 139


Tap-changing
Example
Power increments:
 P2   1.5  1.4521   0.0479 
 P   0.5  0.4657   0.0343 
 3    
 P4    0.069    0.069 
 P       0.0527 
 5   1  1 . 0527   
 Q3    0.1  0.1407   0.0407 
     
Q 4    0.1027   0.1027 
 Q5    0.5  0.492    0.008 

22 July 2011 140


Tap-changing
Example

Jacobian matrix:

 39.9193 0  19.3273 0 0 1.0523 0 


 0 18.6075  18.6075 0  0.0954  0.8359 0 
 
 19.2698  18.6261 48.3879  10.492 0.0912 0.8183  1.0527 
J 0 0  10.492 10.492 0  1.0527 1.0527 

 0  0.8359 0.8359 0 18.3261  18.6075 0 
 
 1.8242  0.0912  0.6803  1.0527  18.6261 48.5934  11.746 
 0 0 1.0527  1.0527 0  10.492 10.492 

22 July 2011 141


Tap-changing
Example
Second iteration
  2 
    0.0002 
 3 
  4    0.005   1   0 
    
  0 . 003   1    0.0002 
 5    
  
 3   0.0021  V  0.9607 ;    0.1043 ; t  0.9144
V
 V3   
0.9644   0.0744 
 V    0 . 0016 
     
 4
  0.0037   1   0.1723 
 V4  
 t   0.0039 
 t 
22 July 2011 142
Tap-changing
Example

Admitance matrix:

 0.3998  j19.942  0.3998  j19.992 0 0 0 


 0.3998  j19.992 0.7997  j39.884 0  0 .3998  j19 .992 0 
 
Ybus  0 0 0.3998  j19.942  0.3998  j19.992 0 
 
 0  0 .3998  j19.992  0.3998  j19.992 0 . 7997  j51 . 8447 j10.9365 
 0 0 0 j10.9365  j10 

22 July 2011 143


Tap-changing
Example

Power calculations:

 P1   0.0031   Q1    0.0501
P   1.4998  Q   0.6391 
 2    2  
P3    0.4998  Q3    0.1000 
P    Q   
 4  0 . 000   4  0 . 0006 
P5    1.0000  Q5   0.4999 

22 July 2011 144


Tap-changing
Example

Power increments:
 P2   1.5  1.4998   0.2065 
 P   0.5  0.4998   0.1969 
 3    
 P4   0.000   0.0057 
 P       0.0258   10 3
 5   1  1 . 0000   
 Q3    0.1  0.1000   0.0339 
     
Q
 4   0 . 0006    0 . 6375 
 Q5   0.5  0.4999   0.1218 

22 July 2011 145


Tap-changing
Example
Tap to the closest feasible value:
t  0.9144  t  0.915

Admitance matrix:
 0.3998  j19.942  0.3998  j19.992 0 0 0 
 0.3998  j19.992 0.7997  j 39.884 0  0.3998  j19.992 0 

Ybus  0 0 0.3998  j19.942  0.3998  j19.992 0 
 
 0  0.3998  j19.992  0.3998  j19.992 0.7997  j51.8282 j10.929
 0 0 0 j10.929  j10 

22 July 2011 146


Tap-changing
Example

Power calculation:

 P1   0.0031   Q1    0.0501
P   1.4998  Q   0.6391 
 2    2  
P3    0.4998  Q3    0.1000 
P    Q   
 4  0 . 0007   4   0 . 0075 
P5   0.9993  Q5   0.4926 

22 July 2011 147


Tap-changing
Example
Power increment calculations:
  2 
 
 P2   1.5  1.4998   0.0002   3 
 P   0.5  0.4998    0.0002    
 3      4
 P4    0.0007   0.0007   5 
 P       0.0007  ;  V3 
 5   1  0 . 9993    V 
 Q3    0.1  0.1000   0.0000   3 
       V4 
Q 4   0.0075   0.0075   V4 
 Q5   0.5  0.4926   0.0074   V 
5
V 
 5 
22 July 2011 148
Tap-changing
Example

Jacobian:

 39.2449 0  19.253 0 0 1.103 0 


 0 18.5072  18.5072 0  0.1307  0.8689 0 
 
 19.1935  18.5271 48.2132  10.4926 0.1282 0.7431 0.9993 
J 0 0  10.4926 10.4926 0  0.9993  0.9993 

 0  0.8689 0.8689 0 18.3071  18.5072 0 
 
 1.872  0.1282  0.7445  0.9993  18.5271 48.1983  10.4926 
 0 0 0.9993  0.9993 0  10.4926 9.5074 

22 July 2011 149


Tap-changing
Example
Final values
  2 
  
 3   0.0007 
  4   0.0289   1   0 
    
  0 . 0152   1    0.0002 
 5     
V   
 3    0.1699  10  V  0.9607 ;    0.1043 
3
 V3   
0.9644   0.0744 
 V    0 . 0552 
     
 4
  0.0558   0.9991  0.1725 
 4 
V 
 V5    0.8522 
V 
 5 
22 July 2011 150
Tap-changing
Example

Final power values:

 P1   0.0031   Q1    0.0501
P   1.5000  Q   0.6402 
 2    2  
P3    0.5000  Q3    0.1000 
P    Q   
 4  0 . 0000   4  0 . 000 
P5    1.0000  Q5   0.5000 

22 July 2011 151


Power World

22 July 2011 152


5. Fast decoupled AC load flow

22 July 2011 153


Fast decoupled AC load flow

Two simplifications:
– Do not build Jacobian at each iteration (small error
introduced, then, the procedure needs more
iterations to reach the solution)

– Decoupling between P-δ and Q-V (not


recommended in system highly loaded and/or with
low voltage levels)

22 July 2011 154


Fast decoupled AC load flow

 P(r )  H(r ) N(r )    


( r 1)

 (r )    (r )  (r 1)
( r )  V

Q   J L   V (r ) 
Assume:
i) V i  1 .0 i
ii) Gik  Bik i, k
iii) cos(i  k )  1.0
sin(i  k )  0.0
iv) Qk  Bkk
22 July 2011 155
Fast decoupled AC load flow

We have:

H  B~1 , L  B~2 , N  0 , J  0

 ~
 ik  Bik 
  
~ ~
B1 , B2  ~
B
  Elements of YBUS
Bii  Bii 

22 July 2011 156


Fast decoupled AC load flow
 P(r )  B~   ( r 1) 
0 
 (r )   
1
~   (r 1) 
Q   0 B 2  V 

~
 
P(r )  B1 (r 1)  (1)
~
 
Q(r )  B 2 V (r 1)  ( 2)

     
( r 1) ~ 1
 B1 P(r )
V     
( r 1) ~ 1
 B 2 Q(r )

Use Newton-Raphson Iteration


22 July 2011 157
Fast decoupled load flow. Flow diagram
DATA INPUT

Calculate Delta P

Real Reactive YES


power YES power
coverged coverged
? ?

NO NO
Solve (1) and update angles

Calculate Delta Q

NO

Reactive YES Real YES


power power
coverged coverged
? ?

NO NO

Solve (2) and update V

OUTPUT RESULTS
22 July 2011 158
Fast decoupled load flow. Matlab Code
function [V_modulo, V_fase, P, Q, N_iter, T_calculo, Error_p] = desacoplado(V_modulo_ini, V_fase_ini, P_ini, Q_ini, Y,
npv)

%
% [V_modulo, V_fase, P, Q, N_iter, T_calculo, Error_p] = desacoplado(V_modulo_ini, V_fase_ini, P_ini, Q_ini, Y, npv)
%
% Obtencion de indices de nodos: 1 -> SLACK;
% 2,...,M -> PV;
% M+1,...,N -> PQ

n = length(V_modulo_ini);
m = npv + 1;
% Parametros del Metodo
Tol = 0.0001; % Tolerancia del metodo (Perdida de potencia).
Error_p = 1; % Error inicial (A un valor mayor que Tol).
N_iter = 0; % Numero de iteraciones.
% Valores iniciales
V_modulo= V_modulo_ini';
V_fase = V_fase_ini';
V = V_modulo.*exp(j*V_fase); % Expresion compleja de la tension
P = P_ini';
Q = Q_ini';

DS_DA = diag(V)*conj(Y*j*diag(V)) + diag(conj(Y*V))*j*diag(V);


DS_DV = diag(V)*conj(Y*diag(V./V_modulo)) + diag(conj(Y*V))*diag(V./V_modulo);

22 July 2011 159


Fast decoupled load flow. Matlab Code
%J = [real(DS_DA(2:n , 2:n)) real(DS_DV(2:n , m+1:n)) % Construccion del Jacobiano
% imag(DS_DA(m+1:n , 2:n)) imag(DS_DV(m+1:n , m+1:n))];

H = imag(-Y(2:end , 2:end))
L = imag(-Y(m+1:end,m+1:end))

j=sqrt(-1);
tic;
while (Error_p > Tol) % Bucle principal (Se permiten 50 iteraciones como mucho).
if (N_iter >50)
error('Demasiadas iteraciones');
break
end

V = V_modulo.*exp(j*V_fase); % Expresion compleja de la tension


S = V.*conj(Y*V); % Expresion compleja de la potencia
DP = P(2:n)-real(S(2:n)); % Incremento de potencia activa (nudos PV y PQ)
DQ = Q(m+1:n)-imag(S(m+1:n)); % Incremento de potencia reactiva (nudos PQ)

Dfase = H\DP;
Dmodulo = L\DQ;

PQ = [DP ; DQ];
Error_p = norm(PQ,2); % Error en esa iteracion

22 July 2011 160


Fast decoupled load flow. Matlab Code
V_fase (2:n) = V_fase(2:n) + Dfase; % Actualizamos la fase de las tensiones (nudos PV y PQ)
V_modulo (m+1:n)= V_modulo(m+1:n) + Dmodulo; % Actualizamos el modulo de las tensiones (nudos PQ)

N_iter = N_iter + 1; % Incremento el numero de iteraciones

% disp('Pulse una tecla para continuar')


% pause
end

P=real(S); % Calculo de la potencia activa


Q=imag(S); % Calculo de la potencia reactiva
V_fase=V_fase*180/pi; % Paso de Radianes a grados
T_calculo=toc;

% **** ENTRADAS ****


%
% V_modulo_ini = Modulo de la tension para comenzar a iterar (conocidos en SLACK y PV).
% V_fase_ini = Fase de la tension para comenzar a iterar (conocido en SLACK).
% P_ini = Potencia activa en los nodos (conocido en PV y PQ).
% Q_ini = Potencia reactica en los nodos (conocido en PQ).
% Y = Matriz de admitancias nodales.

22 July 2011 161


Fast decoupled load flow. Matlab Code
% **** SALIDAS ****
%
% V_modulo = Modulo de la tension en todos los nodos.
% V_fase = Fase de la tension en todos los nodos.
% P = Potencia activa en todos los nodos.
% Q = Potencia reactiva en todos los nodos.
% N_iter = Numero de iteraciones.
% T_calculo = Tiempo de calculo.
% Error_p = Error.
%
%
% **** OBSERVACIONES ****
%
% Los nodos deben estar ordenador asi:
%
% *1 : SLACK.
% * 2...m : PV.
% * m+1...n : PQ.
%
%
% **** FECHA Y AUTOR ****
%
% Laura Laguna - Nobiembre de 2005

22 July 2011 162


Fast decoupled load flow: Exaple

• Tolerance 0.1 MVA.

ONE TWO

THREE

22 July 2011 163


Fast decoupled load flow: Exaple

• Power base SB = 100MVA


Bus Voltage p.u. Power
1 1.02 -
2 1.02 PG=50 MW
3 - PC=100 MW
QC=60 MVAr

Line Impedance p.u.


1-2 0.02+0.04j
1-3 0.02+0.06j
2-3 0.02+0.04j
(cada una)

22 July 2011 164


Fast decoupled load flow: Exaple

• Admitance matrix

 15  35 j  10  20 j  5  15 j 
Ybus   10  20 j 30  60 j  20  40 j
 
  5  15 j  20  40 j 25  55 j 

22 July 2011 165


Fast decoupled load flow: Exaple

• Data and unknown:


Bus Type Data Unknown
Slack and V1 = 1.02
1 P1, Q1
reference δ1=0.0
P2 =0.5
2 PV δ2, Q2
V2 = 1.02
P3 = -1.0
3 PQ δ3, V3
Q3 = -0.6

• Inicialization:
δ2 = δ3 = 0.0 ; V3 = 1.02 p.u.

22 July 2011 166


Fast decoupled load flow: Exaple

• Flow diagram
Vi(0) , δi(0), Piesp, Qiesp Compute: Delta P

Compute: Pical, Qical


Yes Yes
Convergence P? Convergence Q?
NO
Solve subproblem 1 and update angles NO

Compute: Delta Q

Yes Yes
Convergence Q? Convergence P?
NO
NO
Solve subproblem 2 and update voltages

Final results

22 July 2011 167


Fast decoupled load flow: Exaple
 60  40 
Compute H ; L  55 
  40 55 
Calculate P and Q:

P2cal  0.3624·1014   P2   0.5  P2   0.5 


cal

 cal       cal   1 
P
 3    0   P
 3    1  P3 
  
Q3  7.2475·10 
cal 15
Q3   0.6  Q3   0.6
cal
   
No convergence

22 July 2011 168


Fast decoupled load flow: Exaple

• First iteration:

 
  2  - 0.4213 1.0200   0 
 3    - 1.3481    
V  1.0200 ;    - 0.4213 
V   
 3  - 0.0109  1.0091   - 1.3481 
   
 V3 

22 July 2011 169


Fast decoupled load flow: Exaple

Residuals:

P2cal   0.7385   P2   0.5  P2   0.2385


cal

 cal      P     1  Pcal    0.3003 


P
 3     1. 3003  3  3   
Qcal           cal 
 0.4583
 3   0 .1417  3 
Q 0.6 Q 3 

Error = 0.5976 → no convergence

22 July 2011 170


Fast decoupled load flow: Exaple

• System state (second iteration)


 
  2  - 0.0372 1.0200   0 
 3    0.2857     
V    V  1.0200 ;    - 0.4585 
 3  - 0.0083 1.0008   - 1.0264 
 V3     

22 July 2011 171


Fast decoupled load flow: Exaple

•Residuals:

P2cal   0.6578   P2   0.5  P2   0.1578


cal

 cal      P     1  Pcal    0.1936 


P
 3     1.1936  3  3   
Q3   0.7444
cal
Q3   0.6  Q3   0.1444 
cal
 
•Error = 0.2885 → no convergence

22 July 2011 172


Fast decoupled load flow: Exaple

• System state (third iteration):


 
  2  - 0.0315 1.0200   0 
 3    0.1788     
V  1.0200 ;    - 0.4900 
V   
 3   0.0026  1.0034   - 0.8836 
 V3     

• The process continues.

22 July 2011 173


Fast decoupled load flow: Exaple

•After 9 iterations:

P2cal   0.5006   P2   0.5  P2   0.5954·10 


cal 3

 cal      P     1  Pcal    0.7006·103 


P
 3     1. 0007   3  3   
Qcal           cal    3 
 3   0 . 5992  3 
Q 0. 6 Q 3   8.3346·10 

•Error = 0.0012 → convergence attained

22 July 2011 174


Fast decoupled load flow: Exaple

• System state at iteration 10:

 
  2 
 - 0.1592·10-3
 1.0200   0 
 3    0.6141·10-3     
V    V  1.0200 ;    - 0.4710 
   - 1.5154·10-5 
1.0043   - 0.9614 
3
    
 V3

22 July 2011 175


Fast decoupled load flow: Exaple

•Residuals:

P2cal   0.5003   P2   0.5  P2   0.2863·10 


cal 3

 cal       cal   3 
P3     1.0004   P3     1  P3    0.3516·10 
Qcal           cal   4 
 3   0. 6003  3 
Q 0.6 Q 3   3.3349·10 

•Error = 5.6285·10-4 → convergence attained

22 July 2011 176


Fast decoupled load flow: Exaple

• State at iteration 11:

 
  2 
 - 0.0567·10-3
 1.0200   0 
 3    0.3251·10-3     
V  1.0200 ;    - 0.4711
V   
1.0043   - 0.9611
   6.0634·10-6 
   
3

 V3

 0.5098   0.0711 
   
P   0.5003  Q   0.5515 
  1.0004    0.6003 
   
22 July 2011 177
Fast decoupled load flow: Exaple
convergence

22 July 2011 178


Fast decoupled load flow: Exaple
convergence

22 July 2011 179


Fast decoupled load flow: Exaple
convergence

22 July 2011 180


Fast decoupled load flow: Exaple
convergence

22 July 2011 181


6. Variable limits

22 July 2011 182


Variable limits
Physical considerations

1. Voltage magnitudes out of limits


a PQ BUS does not meet

v min
i  v i  v max
i

Action: Warning! voltage problem

2. Flow magnitudes out of limits


A line does not meet
- S max ≤ S ≤ S max
ij ij ij

Action: Warning! overloading of lines problem

22 July 2011 183


Variable limits
Physical Considerations

3. Reactive Power out of limits


A PV BUS does not meet
min max
Qi  Qi  Qi

Action: Wrong Formulation!

Specified voltage cannot be attained

Formulate the problem properly

22 July 2011 184


Variable limits
Computational Considerations
Changing PV to PQ
no yes
Q hits
limit?

no Yes Change to
Q=Qmax ? QG>Qmax? P-Q
Q=Qmax
Yes No
yes
Change to P-V Yes Change to
V >Vdato? V=Vdato P-Q
QG<Qmin?
Q=Qmin
No No
Stay as
P-Q Stay as
P-V
Yes Change to P-V
V <Vdato? V=Vdato

No
Stay as
P-Q

22 July 2011 185


7. DC load flow

22 July 2011 186


DC load flow

• Approximate solution.

• Two simplifications:
– In network model: do not consider series
resistences and shunt admittances
– Assume Vi=1 at all buses

22 July 2011 187


DC load flow
Approximate analytical solution
V V
i j
P   sin
ij X ij
ij
2
V V V
i i j
Q  -  cos 
ij X X ij
ij ij

Assume
i) Vi ≈ 1.0 ∀i
ii) sinij ≈ ij
iii) cos ij ≈ 1.0
22 July 2011 188
DC load flow
Approximate analytical solution
ij
Pij   Bijij  Biji  Bij j
Xij
 
n
 n
 n
Pi   Pij   Bij  i   Bij j
j1 j1 j1
j i 
 ji  j i

P  B´

where n
Bii'   Bij
j1
ji

22 July 2011
Bij'   Bij 189
DC load flow
Continuation
Vi  V j
Qij   Bij ( V i  V j )  Bij V i  Bij V j
Xij

n
n  n
 
Qi   Qij   Bij V i   Bij V j
j1
 j1  j1
ji  
 ji  ji

Q  B' V 

22 July 2011 190


DC load flow
Continuation
Solution
P  B'  PQ & PV Buses
Q  B' V  PQ Buses

 1   V1  P2  Qm1 
 
     ; V      ; P     ; Q    
n   Vn  Pn   Qn 
 

 ' n

 ii  ij 
B  B
 
B 
' j1
ji  ; B ij 
1
Xij
 ' 
Bij  Bij 
22 July 2011 191
DC Power flow: example

22 July 2011 192


DC Power flow: example

ONE TWO

THREE

22 July 2011 193


DC Power flow: example

Data

Bus Voltage p.u. Power

0 1.02 -
1 1.02 PG=50MW
2 - PC=100MW, QC=60MVAr

Line Impedance p.u.


0-1 0.02+0.04j
0-2 0.02+0.06j
1-2 0.02+0.04j (both)

22 July 2011 194


DC Power flow: example

 41.67  25  16.67 
B    25 75  50 
 
 16.67  50 66.67 
 P0   41.67  25  16.67   0 
 0.5     25 75  50   1 
    
 1.0  16.67  50 66.67   2 
 Q0   41.67  25  16.67  1.02 
 Q     25 75  50  1.02 
 1    
 0.6  16.67  50 66.67   V2 

22 July 2011 195


DC Power flow: example

 P0   41.67  25  16.67  0


     
 0.5     25 75  50   1 
  1.0    16.67  50 66.67   
     2

22 July 2011 196


DC Power flow: example

Po= -25δ1 - 16.67δ2


0.5= +75δ1 - 50δ2
-1.0= -50δ1 + 66.67δ2

Q0= 41.67*1.02 - 25*1.02 - 16.67V2


Q1= -25*1.02 + 75*1.02 - 50V2
-0.6= -16.67*1.02 - 50*1.02 + 66.67V2

22 July 2011 197


DC Power flow: example

Solution:

P0 0.5p.u.=50MW
Q0 0.15p.u.=15MVAr
Q1 0.45p.u.=45MVAr
δ1 -1.1459º
δ2 -0.3819º
V2 1.011p.u.

22 July 2011 198


DC Power flow: example

PowerWorld comparison:

Var DC PowerWorld DC PowerWorld G-S


P0 0.50p.u. 0.50p.u. 0.509p.u.
Q0 0.15p.u. 0.00p.u. 0.07p.u.
Q1 0.45p.u. 0.00p.u. 0.55p.u.
δ1 -0.3819 -0.3820 -0.47
δ2 -1.1459 -1.1459 -0.96
V2 1.0056p.u. 1.0000p.u. 1.0043p.u.

22 July 2011 199


DC Power flow: example

0,00 MW 50,00 MW
0,00 Mvar 0,00 Mvar

CERO
UNO

DOS

TRES

100,00 MW
22 July 2011 60,00 Mvar 200
DC Power flow: example

Data.
Bus Voltage p.u. Power
0 1.02 -
1 1.02 PG=50MW
2 - PC=0MW, QC=0MVAr
3 - PC=100MW, QC=60MVAr

Line Impedance p.u.


0-1 0.02+0.04j
0-2 0.02+0.06j
1-2 0.02+0.04 (both)
2-3 0.1j

22 July 2011 201


DC Power flow: example

 41.67  25  16.67 0 
  25 75  50 0 
B 
 16.67  50 76.67  10 
 0  
 0 10 10 
 P0   41.67  25  16.67 0  0 
 0.5    25 75  50 0   1 
   
 0.0   16.67  50 76.67  10   2 
  1 .0   0  
   0  10 10  3 
 Q0   41.67  25  16.67 0  1.02
 Q    25 75  50 0  1.02
 1   
 0.0   16.67  50 76.67  10   V2 
  0 .6   0  
   0  10 10   V3 
22 July 2011 202
DC Power flow: example

P0 = -25δ1 -16.67δ2-0*δ3
0.5 = 75δ1 - 50δ2-0*δ3
0.0 = -50δ1 + 76.67δ2-10δ3
-1.0 = -0*δ1 - 10δ2+10δ3

Q0 = 41.67*1.02 - 25*1.02 - 16.67V2 + 0*V3


Q1 = -25*1.02 + 75*1.02 - 50V2 + 0*V3
0.0 = -16.67*1.02 - 50*1.02 + 76.67V2-10*V3
-0.6 = 0*1.02-0*1.02 - 10*V2 + 10*V3

22 July 2011 203


DC Power flow: example

PowerWorld comparison:

Var DC PowerWorld G-S PowerWorld DC


P0 0.50p.u. 0.51p.u. 0.50p.u.
Q0 0.00p.u. 0.11p.u. 0.00p.u.
Q1 0.00p.u. 0.67p.u. 0.00p.u.
δ1 -0.3819º -0.48º -0.382º
δ2 -1.1459º -0.91º -1.1459º
δ3 -6.8755º -7.05º -6.8755º
V2 1.011p.u. 1.002p.u. 1.000p.u.
V3 0.951p.u. 0.932p.u. 1.000p.u.
22 July 2011 204
8. Comparison of load flow
solution methods

22 July 2011 205


Comparison of load flow methods

1. Gauss-Seidel (G-S)
 Simple technique
 Iteration time increases linearly with the
number of buses. Lower iteration time than N-
R. Seven times faster in large systems
 Linear rate of convergence. Many iterations
required for getting close to the solution
 Number of iteration increases with the
number of buses

22 July 2011 206


Comparison of load flow methods
(Continuation)
2. Newton-Raphson (N-R)
 Widely used
 Iteration-time increases linearly with the number of
buses
 Quadratic rate of convergency. A few iterations for
getting close to the solution
 Number of iterations independent of the number of
buses of the system
 The Jacobian is a very sparse matrix
 Method non-sensitive to slack bus choice and the
presence of series capacitors
 Sensitive to initial solution
22 July 2011 207
Comparison of load flow methods
(Continuation)
3. AC decoupled

 B has to be computed and factorized only once


~

It requires more iterations than Newton-


Raphson method
Iteration time is 5 times lower than Newton-
Raphson´s iteration time
Useful for analyzing topology changes because B
~
can be easily modified
Used in planning and contigency analyses

22 July 2011 208


Comparison of load flow methods
(Continuation)

4. DC Decoupled

 Analytical, approximate and non-iterative method


 Good approximation for  , not that good
approximation for V 
 Used in reliability analyses
 Used in optimal pricing calculations
 Good for getting an initial point

22 July 2011 209

You might also like