Professional Documents
Culture Documents
A. J. Conejo
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
22 July 2011 3
The load flow problem
22 July 2011 4
The load flow problem
22 July 2011 5
The load flow problem
References
22 July 2011 6
1. Introduction
22 July 2011 7
Introduction
A snapshot of the system
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
V1 YG V2
YG
22 July 2011 13
Transmission line model
Problem formulation
Two-bus case
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
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
i 1, 2
22 July 2011 17
Problem formulation
Matrix Ybus
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
3. Yik Yki
22 July 2011 19
Problem formulation
Matrix Ybus
Caracteristics of YBUS
1. YBUS is symmetric
is very sparse
2. YBUS
22 July 2011 20
Ybus example
22 July 2011 21
Problem formulation
General equations
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 senik ) [1]
k 1
n
Qi Vi Vk (Gik senik 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
22 July 2011 24
Problem formulation
BUS Classification
1. PQ buses
Vi unknown
i unknown
22 July 2011 25
Problem formulation
BUS Classification
2. PV buses
Pi known
Qi unknown
22 July 2011 26
Problem formulation
BUS Classification
22 July 2011 27
Problem formulation
Variable types and limits
Power balance
n n
PGi PDi PLOSS
i1 i1
n n
QGi QDi QLOSS
i1 i1
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
Power limits
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
Ai i1 n
(r 1) (r 1)
Bik V k Bik V k
(r )
Vi (r ) *
(Vi ) k 1 k i1
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 ) * i1 (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 angleV i
(r 1)
Ai
Y ii
A (r 1) i1 (r 1) n (r )
(ir 1) angle (r ) Bik V k Bik V k
i
( V i )* k 1 k i1
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
22 July 2011 40
Gauss-Seidel solution technique
PV buses
6) Stop criterion
22 July 2011 41
Gauss-Seidel solution technique
Algorith final calculations
Vi Vk
i ILik YLik ILki k
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
Y ik 0 Y ki0
22 July 2011 43
Gauss-Seidel solution technique
Algorith final calculations
7) If no convergence, go to step 4.
22 July 2011 44
Gauss-Seidel solution technique
Algorithm improvement
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 metodo 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 numero de iteraciones
%-Vfinal vector con todas las potencias para cada iteracion
%-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 iteracion:
%------------------------------------------------------------%
% %
% 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
(slack)
1 1.02 1-2 0.02+0.04j
22 July 2011 52
Solution procedure
1. Data and unknown:
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
PQ bus
V3 V30 1
Vector form:
1.02 0
V 0 1.02 0 0
1 0
22 July 2011 55
Solution procedure
Per iteration:
- Stopping criterios:
a) convergence Sslack and power flows;
b) no converge new iteration
22 July 2011 56
Solution procedure
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:
*
Sslack P1 jQ1 V1* ( Y11V1 Y12 V2 Y13 V3 )
Sik Vi ( Vi - V *k )YLik
* *
22 July 2011 61
Solution procedure
6.3) Line losses:
22 July 2011 62
Implementation
MATLAB:
22 July 2011 63
Solution
11 iterations needed to attain the solution
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
22 July 2011 65
Solution
Iteration 1 2 3 ... 10 11
22 July 2011 66
Final Solution
22 July 2011 67
Checking
ONE TWO
THREE
22 July 2011 68
Checking
22 July 2011 69
Checking
Variable V P Q
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 sinik )
x (r )
(r )
n
Vm1
k 1
n
Vn(r )1
(r )
Vn
Pi () fiP, Pi Pi,sp
Qi () fiQ, Qi Qi,sp
2 ,..., n ; Vm1,..., 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 Vm1 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 Vm1 Vn
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
Qm1 ... (r ) ... ... ... Vm1
fnQ fnQ
(r )
... ... (r )
Qn 2
(r ) n Vn
22 July 2011 78
The Newton-Raphson solution technique
Jacobian matrix
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
22 July 2011 81
The Newton-Raphson solution technique
Jacobian elements
m k
Pk
Hkm Vk Vm (Gkm sinkm Bkm cos km )
m
Pk
Nkm Vm Vk Vm (Gkm cos km Bkm sinkm )
Vm
Qk
Jkm Vk Vm (Gkm cos km Bkm sinkm )
m
Qk
Lkm Vm Vk Vm (Gkm sinkm 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
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;
% 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
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)
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 mtodo
de Newton-Raphson
22 July 2011 91
Newton-Raphson Example
22 July 2011 92
Newton-Raphson Example
ONE TWO
2 1.02 PG=50 MW
3 - PC= 100 MW
QC=60 MVAr
22 July 2011 93
Newton-Raphson Example
Data:
22 July 2011 94
Newton-Raphson Example
3 buses:
Bus1: Slack
Bus 2: PV
Bus 3: PQ
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
j1
3
Qi Qiesp - Vi Vj (Gijsenij - Bij cos(ij )) i 3
j1
22 July 2011 97
Newton-Raphson Example
Checking:
cal cal 1
P
3 0 P
3 1 P3
Q3 7.247510
cal 15
Q3 0.6 Q3 0.6
cal
22 July 2011 98
Newton-Raphson Example
Jacobian:
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
Residuals:
No convergence.
1.0200 0
2 - 0.0154
3 - 0.0206 V 1.0200 ; - 0.4710
V 1.0043 - 0.9612
3 - 3.002410
-4
V3
Residuals:
cal 5
P3 1.0000 P3 1 ( 1.0000) 0.545410
Qcal 0.6000
Q
0.6 ( 0.6000)
4.969810 6
3 3
Tolerance OK.
2
- 0.645810-5
1.0200 0
3 - 0.753410-5 V 1.0200 ; - 0.4710
V
1.0043 - 0.96810
- 1.110610-7
3
V3
P1 0.5098 Q1 0.0710
P 0.5000 Q 0.5513
2 2
P3 1.0000 Q3 0.6000
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
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
Equivalent circuit:
t:1 Ycc
Ycc i t j
i j
1 t t 1
Ycc 2 Ycc
t t
t 1
Ycc
t 4
The tap-changing
transformer
controls voltage 1 t t 1
Ycc 2 Ycc
of bus 4 t t
n
Qi Vi Vk Gik sin ik Bik cos ik
k 1
2 n Vm1
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 Vm1
(r ) (r )
fiQ fiQ
... V (r )
t t (r )
n
n
V
22 July 2011 123
Tap-changing transformer
fiQ n
Gik Bik
Di t t Vi Vk sinik cos ik
t k 1 t t
C & D multiplied by t!
22 July 2011 127
Tap-changing transformer
1.- Slack
2.- PV
3.- PQ
4.- PQ
5.- PQV
Data:
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
1 t t 1
Ycc 2 Ycc
t t
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
Admitance matrix:
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
Jacobian matrix:
Admitance matrix:
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
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
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
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
Jacobian:
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
Two simplifications:
Do not build Jacobian at each iteration (small error
introduced, then, the procedure needs more
iterations to reach the solution)
(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
~
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 )
Calculate Delta P
NO NO
Solve (1) and update angles
Calculate Delta Q
NO
NO NO
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';
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
Dfase = H\DP;
Dmodulo = L\DQ;
PQ = [DP ; DQ];
Error_p = norm(PQ,2); % Error en esa iteracion
ONE TWO
THREE
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
Inicialization:
2 = 3 = 0.0 ; V3 = 1.02 p.u.
Flow diagram
Vi(0) , i(0), Piesp, Qiesp Compute: Delta P
Compute: Delta Q
Yes Yes
Convergence Q? Convergence P?
NO
NO
Solve subproblem 2 and update voltages
Final results
cal cal 1
P
3 0 P
3 1 P3
Q3 7.247510
cal 15
Q3 0.6 Q3 0.6
cal
No convergence
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
Residuals:
Residuals:
After 9 iterations:
2
- 0.159210-3
1.0200 0
3 0.614110-3
V V 1.0200 ; - 0.4710
- 1.515410-5
1.0043 - 0.9614
3
V3
Residuals:
cal cal 3
P3 1.0004 P3 1 P3 0.351610
Qcal cal 4
3 0. 6003 3
Q 0.6 Q 3 3.334910
2
- 0.056710-3
1.0200 0
3 0.325110-3
V 1.0200 ; - 0.4711
V
1.0043 - 0.9611
6.063410-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
v min
i v i v max
i
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
Approximate solution.
Two simplifications:
In network model: do not consider series
resistences and shunt admittances
Assume Vi=1 at all buses
Assume
i) Vi 1.0 i
ii) sinij ij
iii) cos ij 1.0
22 July 2011 188
DC load flow
Approximate analytical solution
ij
Pij Bijij Biji Bij j
Xij
n
n
n
Pi Pij Bij i Bij j
j1 j1 j1
j i
ji j i
P B
where n
Bii' Bij
j1
ji
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
j1
j1 j1
ji
ji ji
Q B' V
1 V1 P2 Qm1
; V ; P ; Q
n Vn Pn Qn
' n
ii ij
B B
B
' j1
ji ; B ij
1
Xij
'
Bij Bij
22 July 2011 191
DC Power flow: example
ONE TWO
THREE
Data
0 1.02 -
1 1.02 PG=50MW
2 - PC=100MW, QC=60MVAr
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
P0 41.67 25 16.67 0
0.5 25 75 50 1
1.0 16.67 50 66.67
2
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.
PowerWorld comparison:
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
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 = -251 -16.672-0*3
0.5 = 751 - 502-0*3
0.0 = -501 + 76.672-103
-1.0 = -0*1 - 102+103
PowerWorld comparison:
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
4. DC Decoupled