A. J. Conejo
Univ. Castilla La Mancha
2011
22 July 2011
22 July 2011
22 July 2011
22 July 2011
22 July 2011
1. Introduction
22 July 2011
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
Introduction
The problem is described throught a nonlineal system of equations
Need of iterative solution techniques
Solution technique: accuracy vs. computing
time
22 July 2011
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
V1
22 July 2011
I2
YS
YG
YG
V2
13
Problem formulation
Two-bus case
Using Kirchhoff laws:
I1 V1 YG ( V1 V2 ) Y S
I2 V2 YG ( V2 V1) Y S
Matrix notation:
Y S V1 Y11 Y12 V1
I1 Y G Y S
V
V
I
Y G Y S 2 Y 21 Y 22 2
2 YS
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
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
YBUS
22 July 2011
Y11 Y12 YG YS
Y21 Y22 YS
YS
YG YS
18
3. Yik Yki
22 July 2011
19
Problem formulation
Matrix Ybus
Caracteristics of YBUS
1. YBUS
is symmetric
is very sparse
(>90% for more than 100 buses)
2. YBUS
22 July 2011
20
Ybus example
YBUS
22 July 2011
j10
j10
j19.98
j10
j19.98
j10
j10
j19.98
j10
21
Problem formulation
General equations
2n equations (static load flow equations)
n
k 1
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
[1]
[2]
k 1
n
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
22 July 2011
24
Problem formulation
BUS Classification
1. PQ buses
Pi known ( PDi known, PGi zero)
22 July 2011
25
Problem formulation
BUS Classification
2. PV buses
Pi known
Qi unknown
Pi known ( PGi specified, PDi known)
Vi known (specified)
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
i1
i1
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
Voltage magnitude Vi min
Power angle i k
Vi
Vi max
Power limits
22 July 2011
30
22 July 2011
31
x F( x )
Iteration
x (r 1) F( x (r ) )
Stoping rule
22 July 2011
x (r 1) x (r )
32
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,
r 1,
r 2,
...
r 5,
x ( 6 ) 1.0103
r 6,
x ( 7 ) 1.0042
...
r 10,
22 July 2011
x (11) 1.0001
r 11,
r 12,
x (13 ) 1.0000
(12 )
1.0000
Many iterations!
33
i 2,...,n
Qi
i m 1,...,n
Vi
i 2,...,m
V1
slack bus
(PV Buses)
22 July 2011
34
22 July 2011
i m 1,...,n
i 2,...,n
35
PQ buses
Pi jQi
*
V i Ii
*
Vi
Y ii V i
n
1 Pi jQi
Vi
Y
V
ik
k
Y ii V i*
k 1
k i
P jQi
Ai i
Y ii
Y ik
Bik
Y ii
22 July 2011
* n
V i Y ik
k 1
k i
Vk
i m 1,...,n
i m 1,...,n ; k 1,...,n ; k i
36
Vi
(r 1)
22 July 2011
Ai
(r ) *
(Vi )
i1
Bik V k
k 1
(r 1)
Bik V k
(r )
k i1
37
Pi jQi
*
V i Ii
* n
V i Y ik V k
k 1
* n
Qi V i Y ik V k
k 1
22 July 2011
38
(r ) * i1
(r 1)
(r ) * n
(r )
( V i ) Y ik V k ( V i ) Y ik V k
k 1
k i
i angleV i
(ir 1)
22 July 2011
(r 1)
Ai
Pi jQ(ir 1)
Y ii
n
A (r 1) i1
(r 1)
(r )
i
angle (r ) Bik V k Bik V k
k i1
( V i )* k 1
39
Beware of limits!
Q(ir 1) Qi,min
Q(ir 1) Qi,min
Q(ir 1) Qi,max
Q(ir 1) Qi,max
&
&
i becomes PQ
i becomes PQ
22 July 2011
40
22 July 2011
* n
V1 Y1k V k
k 1
41
Iik 0 V i Y ik 0
ILki ( V k V i ) YLik ;
Iki0 V k Y ki 0
Vi
Vk
ILik
YLik
ILki
Sik Iik 0
Iki0 Sik
Y ik 0
22 July 2011
Y ki0
42
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
ILik
YLik
ILki
Sik Iik 0
Iki0 Sik
Y ik 0
22 July 2011
Y ki0
43
Sloss , ik
k,i
7)
If no convergence, go to step 4.
22 July 2011
44
~
(r )
(r 1)
(r )
Vi(r 1) V i V i
Vi
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
22 July 2011
for l=2:m
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
end
Gauss-Seidel
Matlab code 3
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:
plot(1:nite,errorplot,'o');grid on;xlabel('iteracion');ylabel('error por iteracion');title('evolucion error tesion');
%------------------------------------------------------------%
%
%
% 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
1.02
(slack)
1-2
0.02+0.04j
1.02
PG=50 MW
1-3
0.02+0.06j
PC=100 MW
QC=60 MVAr
2-3
0.02+0.04j
(each)
22 July 2011
Impedance (p.u.)
52
Solution procedure
1.
Bus
Type
Data
Unknown
Slack
V1=1.02 1=0.0
P1 Q1
PV
V2=1.02 P2=0.5
2 Q2
PQ
P3=-1.0 Q2=-0.6
3 V3
22 July 2011
53
Solution procedure
YBUS
ONE
TWO
YBUS
15 35 j 10 20 j 5 15 j
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):
V3 V30 1
2 02 0
PQ bus
3 03 0
Vector form:
1.02
V 0 1.02
1
22 July 2011
0
0 0
0
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:
2 angle [ V2 ]
22 July 2011
A (2r 1)
P2 jQ(2r 1)
Y22
57
Solution procedure
(2r 1)
A (2r 1)
( r 1)
(r )
angle (r 1) * B21V1 B23 V3
( V2 )
where
Bik
22 July 2011
Yik
is a constant
Yii
58
Solution procedure
5. Buses PQ iteration (r+1):
bus 3:
V3(r 1)
A3
(r ) * B31V1(r 1) B32 V2(r 1)
( V3 )
where
P3 jQ3
A3
Y33
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 )
*
Sik Vi ( Vi - V *k )YLik
*
22 July 2011
61
Solution procedure
6.3) Line losses:
k, i 1,2,3
7.
22 July 2011
62
Implementation
MATLAB:
22 July 2011
63
Solution
11 iterations needed to attain the solution
Iteration (pu)
...
10
11
P1 ,Q1(slack)
...
0.5083
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
...
10
11
V1
1 ( )
1.02
1.02
1.02
...
1.02
1.02
...
V2
2 ( )
1.02
1.02
1.02
...
1.02
1.02
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
...
10
11
Max. Error V
0.0041
9.6810-5
5.0510-5
...
1.1510-6
6.7410-7
Max. Error Q
0.8160
0.4076
0.0612
...
0.0014
8.1110-4
22 July 2011
66
Final Solution
Bus
P (MW)
Q (MVAr )
V (pu)
1.02 0
50.83
7.16
50.00
55.01
-100
-60.00
22 July 2011
1.02
-0.4685
1.0043 -0.9593
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.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
0%
0.53 %
0.29%
0.84 %
22 July 2011
70
technique
22 July 2011
71
Introduction
One variable
f ( x ) 0,
f ( x ( 0 ) ) 0,
f ( x (0 ) x ( 0 ) ) 0
(0)
(0)
(0)
( 0 ) df
f ( x x ) 0 f ( x ) x
dx
x ( 0 )
f ( x(0) )
df
dx
x (r 1) x (r )
22 July 2011
(0)
...
x (1) x ( 0 ) x ( 0 )
;
(0)
f ( x (r ) )
df
dx
(r )
72
Introduction
Example
f ( x ) x 2 5 x 4 0;
x
( r 1)
(r )
df ( x )
2x 5
dx
( x ( r ) )2 5 x ( r ) 4 ( 0 )
; x 0 .5
(r )
2x 5
(1)
0 .5 2 5 0 . 5 4
0 .5
0.9375
2 0 .5 5
( 2)
0.9375 2 5 0.9375 4
0.9375
0.9988
2 0.9375 5
(3)
0.9988 2 5 0.9988 4
0.9988
1.0000
2 0.9988 5
Fast!
22 July 2011
73
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)
( 0 ) 1
f ( x(0) )
x (1) x ( 0 ) x ( 0 )
x
(r 1)
22 July 2011
(r )
(r ) 1
f ( x (r ) )
74
General formulation
x1
x
x 2
x
n
22 July 2011
f1
f
f 2
f
n
f1
x
1
f2
J x1
fn
x1
f1
x 2
f2
x 2
fn
x 2
f1
x n
f2
x n
fn
x n
75
x
(r )
(2r )
( r )
3
n
(r ) fiP () Vi Vk (Gik cos ik Bik sinik )
n
k 1
(r )
n
Vm1
22 July 2011
76
(r )
(r )
(r )
(r )
(r )
(r )
(r )
Pi,sp
f
f
f
f
fiP(r ) iP (2r ) ... iP (nr ) iP Vm(r)1 ... iP Vn(r )
2
n
Vm1
Vn
Qi,sp
f
f
f
f
fiQ(r ) iQ (2r ) ... iQ (nr ) iQ Vm(r)1 ... iQ Vn(r )
2
n
Vm1
Vn
2P
2
P2(r ) ...
(r )
Qm1 ... (r )
fnQ
(r )
Qn 2
22 July 2011
(r )
2
f2P
Vn
(r )
...
n
(r )
... Vm1
(r )
fnQ
(r )
n Vn
(r )
... ...
... ...
... ...
... ...
78
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
Jacobian elements
Jacobian dimension
2 NPQ NPV
22 July 2011
NPQ
Number of PQ buses
NPV
Number of PV buses
80
Jacobian elements
Jacobian dimension
P(r ) H(r ) N(r ) (r 1)
V (r 1)
(r ) (r )
(r )
L
Q J
V (r )
V (r 1)
(r 1)
instead
of
V
V (r )
for improving computational efficiency
22 July 2011
81
Jacobian elements
m k
Hkm
Pk
Nkm
Pk
Vm
Vk Vm (Gkm cos km Bkm sinkm )
Vm
Jkm
Qk
Lkm
Qk
Vm
Vk Vm (Gkm sinkm Bkm cos km )
Vm
22 July 2011
82
Jacobian elements
k m
Hkk
Pk
Qk Bkk Vk2
k
Nkk Vk
Pk
Pk Gkk Vk2
Vk
Jkk
Qk
Pk Gkk Vk2
k
Lkk
Qk
Vk
Qk Bkk Vk2
Vk
22 July 2011
Note :
km k m
Y km Gkm jBkm
83
Solution outline
1. Build YBUS
2. Specify 1 0
Pi
i 2,...,n
Qi
i m 1,...,n
Vi
i 2,...,m
V1
3.
i , i 2,...,n
Initialize
V i , i m 1,...,n
22 July 2011
84
Solution outline
4. Compute Pi(r ) (for PV & PQ Buses), Q(ir ) (for PQ Buses)
5. If Pi(r ) P & Q(ir ) Q
then compute
1) P1 jQ1
2) line flows
3) Stop
else go on
85
Solution outline
7. Solve
V (r ) J
8. Update
(r 1) (r ) (r 1)
V (r 1) V (r ) V (r 1)
PV & PQ Buses
PV Buses
9. Go to step 4
22 July 2011
86
% 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
22 July 2011
88
N_iter = N_iter + 1;
disp('Pulse una tecla para continuar')
pause
end
P=real(S);
Q=imag(S);
V_fase=V_fase*180/pi;
T_calculo=toc;
%
%
%
%
%
%
%
22 July 2011
89
22 July 2011
90
22 July 2011
91
Newton-Raphson Example
Checking with Matlab and PowerWorld
22 July 2011
92
Newton-Raphson Example
ONE
Bus
Voltage p.u
Power
1.02
TWO
THREE
1.02
PG=50 MW
PC= 100 MW
QC=60 MVAr
22 July 2011
93
Newton-Raphson Example
Data:
22 July 2011
Line
Impedance p.u.
1-2
0.02+0.04j
1-3
0.02+0.06j
2-3
0.02+0.04j each
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
Y - 10.0000 + 20.0000j
- 5.0000 + 15.0000j
- 10.0000 + 20.0000j
30.0000 - 60.0000j
- 20.0000 + 40.0000j
- 5.0000 + 15.0000j
- 20.0000 + 40.0000j
25.0000 - 55.0000j
Intitialization:
2 3 0
V3 1.02
22 July 2011
96
Newton-Raphson Example
Residuals:
3
22 July 2011
97
Newton-Raphson Example
Checking:
cal
P2cal 0.36241014
P2 0.5 P2 0.5
cal
1
cal
P
3
3
cal
15
cal
Q3 7.247510
Q3 0.6 Q3 0.6
22 July 2011
98
Newton-Raphson Example
Jacobian:
H22 H23 N23
M
L
33
33
32
22 July 2011
62.4240
J 41.6160
20.8080
41.6160
57.2220
26.0100
20.4000
25.5000
56.1000
99
Newton-Raphson Example
First iteration:
2 - 0.4557
3 - 0.9406
V
3 - 0.0154
V3
22 July 2011
1.0200
V 1.0200 ;
1.0046
- 0.4557
- 0.9406
100
0
.
9835
3
cal
Q3 0.5874
Q3 0.6 ( 0.5874) 0.0126
No convergence.
22 July 2011
101
Newton-Raphson Example
Jacobian for iteration 2:
61.8860
J 40.8145
20.8409
22 July 2011
41.1614 20.0540
56.0994
24.1371
26.2162 54.6707
102
Newton-Raphson Example
State variables at iteration 2
2 - 0.0154
3 - 0.0206
V
-4
3 - 3.002410
V3
22 July 2011
1.0200
V 1.0200 ;
1.0043
- 0.4710
- 0.9612
103
Newton-Raphson Example
Residuals:
5
P2cal 0.5000
P2 0.5 0.5000 0.066410
cal
5
P3 1.0000 P3 1 ( 1.0000) 0.545410
6
Qcal
0.6000
0
.
6
0
.
6000
)
4
.
9698
10
3
3
Tolerance OK.
22 July 2011
104
Newton-Raphson Example
Jacobian iteration 3:
61.8860
J 40.8145
20.8409
41.1614 20.0540
56.0994
24.1371
26.2162 54.6707
-5
0.645810
2
3 - 0.753410-5
V
-7
3
1.110610
V
3
22 July 2011
1.0200
V 1.0200 ;
1.0043
- 0.4710
- 0.96810
105
Newton-Raphson Example
Final power values:
P1 0.5098
P 0.5000
2
P3 1.0000
22 July 2011
Q1 0.0710
Q 0.5513
2
Q3 0.6000
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
7 ,0 9 5 M var
5 0 ,0 0 0 M W
5 5 ,1 2 6 M var
UNO
C ERO
1 ,0 2 0 pu
0 ,0 0 0 Deg
1 ,0 2 0 pu
-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)
0 (PW)
1.02
50.9763
7.0955
1.02
50.9755
7.0954
1 (PW)
1.02
-0.4710
50
55.1256
1.02
-0.4710
50.0006
55.1228
2 (PW)
1.0043
-0.9612
-100
-60
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
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
i
Ycc
Ycc
t 1
22 July 2011
1 t
Ycc 2
t
t 1
Ycc
t
116
Admitance matrix
22 July 2011
117
Tap-changing
Example
22 July 2011
118
Tap-changing
Example
1
Yshunt 13
Z13
Z 23
Yshunt 13 Yshunt 23
Yshunt 23
Ycc
The tap-changing
transformer
controls voltage
of bus 4
22 July 2011
1 t
Ycc 2
t
4
t 1
Ycc
t
119
Tap-changing
Example
1
Y11
Yshunt 13 ; Y12 0 ;...
Z13
... Y33
1
1
1 t Ycc
Yshunt 13
Yshunt 23 Ycc 2
t
Z13
Z 23
t
Y34
Y44
Ycc
Ycc
22 July 2011
t 1
Ycc
Ycc
t
t
Tap-changing
Example
Y11 Y12
Y
Y22
21
Y
Y31 Y32
Y
41 Y42
22 July 2011
Y14
Y23
Y24
Y33 ( t ) Y34 ( t )
Y43 ( t ) Y44
Y13
121
Tap-changing transformer
Load flow equations:
n
22 July 2011
122
Tap-changing transformer
Taylor Expansion:
(r )
Pi
dato
(r )
iP
(r )
(r )
(r )
(r )
fiP
fiP
fiP
(r )
(r )
(r )
...
V
2
n
m 1 ...
2
n
Vm1
(r )
fiP
fiP
(r )
(r )
...
t
n
n
(r )
(r )
f
f
f
Qidato fiQ(r ) iQ (2r ) ... iQ (nr ) iQ Vm(r)1 ...
2
n
Vm1
(r )
(r )
fiQ
fiQ
(r )
(r )
...
t
n
n
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 )
L
D
M
22 July 2011
126
Tap-changing transformer
Derivatives with respect to t:
n
fiP
Bik
Gik
Ci t
t Vi Vk
cos ik
sinik
t
t
t
k 1
n
fiQ
Gik
Di t
t Vi Vk
sinik
t
t
k 1
Bik
cos ik
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.00
Slack
1.00
Pg=150MW
--
Pc=50MW, Qc=10MVAr
--
Pc=0MW,
1.00
22 July 2011
Qc=0MVAr
Pc=100MW,Qc=50MVAr
131
Tap-changing
Example
1
Ylnea
Yshunt
Yshunt
Ylnea
Yshunt
Ylnea
Yshunt
Yshunt
Yshunt
Ycc
1 t
Ycc 2
t
22 July 2011
t 1
Ycc
t
132
Tap-changing
Example
Admitance matrix:
YBUS
Yl Ys
Y
l
22 July 2011
Yl
2Yl 2Ys
Yl
Yl Ys
Yl
Yl
Yl
Ycc
(1 t )
2Yl 2Ys
Ycc 2
t
t
Ycc
t
0
0
0
Ycc
t
Ycc
133
Tap-changing
Example
0
0
0
0.3998 j19.942 0.3998 j19.992
0.3998 j19.992 0.7997 j39.884
0
.
3998
j
19
.
992
0
Ybus
0
0
0.3998 j19.942 0.3998 j19.992 0
0
.
3998
j
19
.
992
0
.
3998
j
19
.
992
0
.
7997
j
49
.
884
j
10
0
0
0
j10
j10
134
Tap-changing
Example
Increment calculations:
P2 1.5 P2cal 1.5
P
0 .5
cal
0
.
5
P
3
3
P4 P4cal 0
cal
P
5 1 P5 1
Q3 0.1 Qcal 0.1
3
cal
0
Q 4 Q 4
Q 0.5 Qcal 0.5
5
5
22 July 2011
135
Tap-changing
Example
Jacobian
0
39.984
0
19.992
19.992 19.992
J
0
0
0
0.3998
0.3998
0.3998
0
0
22 July 2011
19.992
0.3998
19.992
0.3998
0.3998
49.984
10 0.3998
0.7997
10
10
0.3998
19.892
19.992
0.7997
19.992
49.754
10
0
0
0
0
0
10
10
136
Tap-changing
Example
First iteration:
2
0
3
1
0
4 0.0993
0
.
0744
0
V3
0.968
0.0744
0
.
0377
V
1
0.1744
0.032
V4
t 0.082
t
22 July 2011
137
Tap-changing
Example
Admitance matrix:
Ybus
0
0
0
0.3998 j19.942 0.3998 j19.99
0
0.3998 j19.992
0
0
0
0.3998 j19.94 0.3998 j19.992
0
0
.
3998
j
19
.
992
0
.
399
j
19
.
99
0
.
7997
j
51
.
750
j
10
.
8933
0
0
0
j10.893
j10
22 July 2011
138
Tap-changing
Example
Power computation:
0
P1
P 1.4521
2
P3 0.4657
P
0
.
069
4
P5 1.0527
22 July 2011
Q1 0.05
Q 0.5647
2
Q3 0.1407
Q
0
.
1027
4
Q5 0.492
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
1
.
0527
5
Q 4 0.1027 0.1027
Q5 0.5 0.492 0.008
22 July 2011
140
Tap-changing
Example
Jacobian matrix:
39.9193
19.2698
J
0
1.8242
22 July 2011
19.3273
1.0523
18.6075
18.6075
0.0954
0.8359
18.6261
48.3879
10.492
0.0912
0.8183
10.492
10.492
1.0527
0.8359
0.8359
18.3261
18.6075
0.0912
0.6803
1.0527
18.6261
48.5934
1.0527
1.0527
10.492
1.0527
1.0527
11.746
10.492
0
141
Tap-changing
Example
Second iteration
2
0.0002
3
0
4 0.005
1
1
0.0002
0
.
003
V
3 0.0021 V 0.9607 ; 0.1043 ; t 0.9144
V3
0.9644
0.0744
0
.
0016
V
1
0.1723
0.0037
V4
t 0.0039
t
22 July 2011
142
Tap-changing
Example
Admitance matrix:
Ybus
0
0
0
0.3998 j19.942 0.3998 j19.992
0
.
3998
j
19
.
992
0
0
0
0.3998 j19.942 0.3998 j19.992
0
0
.
3998
j
19
.
992
0
.
3998
j
19
.
992
0
.
7997
j
51
.
8447
j
10
.
9365
0
0
0
j10.9365
j10
22 July 2011
143
Tap-changing
Example
Power calculations:
P1 0.0031
P 1.4998
2
P3 0.4998
P
0
.
000
4
P5 1.0000
22 July 2011
Q1 0.0501
Q 0.6391
2
Q3 0.1000
Q
0
.
0006
4
Q5 0.4999
144
Tap-changing
Example
Power increments:
P2 1.5 1.4998 0.2065
P 0.5 0.4998 0.1969
3
0.000
P4
0.0057
P
0.0258 10 3
1
.
0000
5
0
.
0006
0
.
6375
4
145
Tap-changing
Example
Tap to the closest feasible value:
t 0.9144 t 0.915
Admitance matrix:
Ybus
0
0
0.3998 j19.942 0.3998 j19.992
0.3998 j19.992 0.7997 j 39.884
0
0.3998 j19.992
0
0
0.3998 j19.942 0.3998 j19.992
0
0.3998 j19.992 0.3998 j19.992 0.7997 j51.8282
0
0
0
j10.929
22 July 2011
0
0
j10.929
j10
0
146
Tap-changing
Example
Power calculation:
P1 0.0031
P 1.4998
2
P3 0.4998
P
0
.
0007
4
P5 0.9993
22 July 2011
Q1 0.0501
Q 0.6391
2
Q3 0.1000
Q
0
.
0075
4
Q5 0.4926
147
Tap-changing
Example
Power increment calculations:
2
0
.
9993
5
V
Q3 0.1 0.1000 0.0000 3
V4
0.0075
Q 4
0.0075 V4
Q5 0.5 0.4926 0.0074 V
5
V
5
22 July 2011
148
Tap-changing
Example
Jacobian:
39.2449
19.1935
J
0
1.872
22 July 2011
19.253
1.103
18.5072
18.5072
0.1307
0.8689
18.5271
48.2132
10.4926
0.1282
0.7431
10.4926
10.4926
0.9993
0.8689
0.8689
18.3071
18.5072
0.1282
0.7445
0.9993
18.5271
48.1983
0.9993
0.9993
10.4926
0.9993
0.9993
10.4926
9.5074
0
149
Tap-changing
Example
Final values
2
3 0.0007
4 0.0289
0
1
1
0.0002
0
.
0152
V
3 0.1699 10 V 0.9607 ; 0.1043
V3
0.9644
0.0744
0
.
0552
V
0.9991
0.1725
0.0558
V
4
V5 0.8522
V
5
22 July 2011
150
Tap-changing
Example
Final power values:
P1 0.0031
P 1.5000
2
P3 0.5000
P
0
.
0000
4
P5 1.0000
22 July 2011
Q1 0.0501
Q 0.6402
2
Q3 0.1000
Q
0
.
000
4
Q5 0.5000
151
Power World
22 July 2011
152
22 July 2011
153
22 July 2011
154
(r ) (r )
( r ) V
L
Q J
V (r )
Assume:
i)
V i 1 .0
i
i, k
155
H B~1
L B~2 , N 0 , J 0
B
ik Bik
~ ~
B1 , B2 ~
Bii Bii
22 July 2011
Elements of YBUS
156
1
(r )
~ (r 1)
Q 0 B 2 V
~
P(r ) B1 (r 1)
~
Q(r ) B 2 V (r 1)
(1)
( 2)
V
( r 1)
( r 1)
~ 1
B1 P(r )
~ 1
B 2 Q(r )
157
Calculate Delta P
Real
power
coverged
?
YES
NO
Reactive
power
coverged
?
YES
NO
Calculate Delta Q
NO
Reactive
power
coverged
?
NO
YES
Real
power
coverged
?
YES
NO
22 July 2011
OUTPUT RESULTS
158
22 July 2011
159
j=sqrt(-1);
tic;
while (Error_p > Tol)
if (N_iter >50)
error('Demasiadas iteraciones');
break
end
V = V_modulo.*exp(j*V_fase);
S = V.*conj(Y*V);
DP = P(2:n)-real(S(2:n));
DQ = Q(m+1:n)-imag(S(m+1:n));
Dfase = H\DP;
Dmodulo = L\DQ;
PQ = [DP ; DQ];
Error_p = norm(PQ,2);
22 July 2011
160
N_iter = N_iter + 1;
%
%
%
%
%
%
%
22 July 2011
161
22 July 2011
162
ONE
TWO
THREE
22 July 2011
163
22 July 2011
Bus
Voltage p.u.
Power
1.02
1.02
PG=50 MW
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)
164
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
Type
Data
Unknown
Slack and
reference
V1 = 1.02
1=0.0
P1, Q1
PV
P2 =0.5
V2 = 1.02
2, Q2
PQ
P3 = -1.0
Q3 = -0.6
3, V3
Inicialization:
2 = 3 = 0.0 ;
22 July 2011
V3 = 1.02 p.u.
166
Compute: Delta P
Yes
Convergence Q?
Yes
NO
Solve subproblem 1 and update angles
NO
Compute: Delta Q
Convergence Q?
Yes
Convergence P?
Yes
NO
Solve subproblem 2 and update voltages
NO
Final results
22 July 2011
167
60 40
H
; L 55
40 55
Calculate P and Q:
cal
P2cal 0.36241014
P2 0.5 P2 0.5
cal
1
cal
P
3
3
cal
15
cal
Q3 7.247510
Q3 0.6 Q3 0.6
No convergence
22 July 2011
168
2 - 0.4213
3 - 1.3481
V
3 - 0.0109
V3
22 July 2011
1.0200
V 1.0200 ;
1.0091
- 0.4213
- 1.3481
169
1
.
3003
3
3
cal
Qcal
0.4583
0
.
1417
0
.
6
Q
3
3
3
22 July 2011
170
2 - 0.0372
3 0.2857
V
3 - 0.0083
V3
22 July 2011
1.0200
V 1.0200 ;
1.0008
- 0.4585
- 1.0264
171
1
.
1936
3
3
cal
cal
Q3 0.7444
Q3 0.6 Q3 0.1444
22 July 2011
172
2 - 0.0315
3 0.1788
V
3 0.0026
V3
1.0200
V 1.0200 ;
1.0034
- 0.4900
- 0.8836
22 July 2011
173
1
.
0007
3
3
3
cal
3
Qcal
0
.
5992
0
.
6
8
.
3346
10
3
3
3
22 July 2011
174
-3
0.159210
2
3 0.614110-3
V
-5
3
1.515410
V
3
22 July 2011
1.0200
V 1.0200 ;
1.0043
- 0.4710
- 0.9614
175
cal
3
P3 1.0004 P3 1 P3 0.351610
cal
4
Qcal
0
.
6003
0
.
6
Q
3
.
3349
10
3
3
3
176
-3
0.056710
2
3 0.325110-3
V
-6
3
6.063410
V
3
0.5098
P 0.5003
1.0004
22 July 2011
1.0200
V 1.0200 ;
1.0043
- 0.4711
- 0.9611
0.0711
Q 0.5515
0.6003
177
22 July 2011
178
22 July 2011
179
22 July 2011
180
22 July 2011
181
6. Variable limits
22 July 2011
182
Variable limits
Physical considerations
1.
v
i
i
i
Action: Warning!
2.
voltage problem
Action: Warning!
22 July 2011
Variable limits
Physical Considerations
3.
Qi
min
Qi
Qi
max
22 July 2011
184
Variable limits
Computational Considerations
Changing PV to PQ
no
no
Q hits
limit?
QG>Qmax?
Q=Qmax ?
Yes
>Vdato?
No
<Vdato?
No
22 July 2011
Change to P-V
V=Vdato
Change to
P-Q
Q=Qmax
Yes
Change to
P-Q
Q=Qmin
QG<Qmin?
No
Stay as
P-Q
Yes
Yes
No
yes
yes
Stay as
P-V
Change to P-V
V=Vdato
Stay as
P-Q
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
ij
X
ij
2
V V
V
i j
i
Q
cos
ij
ij
X
X
ij
ij
Assume
i)
Vi 1.0 i
ii) sinij ij
iii) cos ij 1.0
22 July 2011
188
DC load flow
Approximate analytical solution
Pij
ij
Xij
n
n
j i
j i
ji
P B
n
where
22 July 2011
Bii'
Bij
j1
ji
Bij' Bij
189
DC load flow
Continuation
Qij
Vi V j
Xij
ji
ji
ji
n
Q B' V
22 July 2011
190
DC load flow
Continuation
Solution
P B'
Q B' V
1
;
n
PQ & PV
PQ
Buses
Buses
V1
V ;
Vn
P2
P ;
Pn
Qm1
Q
Qn
n
'
B
ii ij
1
'
j1
B
;
B
ij
ji
Xij
'
Bij Bij
22 July 2011
191
22 July 2011
192
ONE
TWO
THREE
22 July 2011
193
Voltage p.u.
Power
1.02
1.02
PG=50MW
PC=100MW, QC=60MVAr
22 July 2011
Line
Impedance p.u.
0-1
0.02+0.04j
0-2
0.02+0.06j
1-2
0.02+0.04j (both)
194
16.67
P0 41.67
0.5 25
1.0 16.67
Q0 41.67
Q 25
1
0.6 16.67
22 July 2011
25 16.67
75
50
50 66.67
25 16.67 0
75
50 1
50 66.67 2
25 16.67 1.02
75
50 1.02
50 66.67 V2
195
P0 41.67 25 16.67
75
50
0.5 25
1.0 16.67 50 66.67
22 July 2011
0
1
2
196
22 July 2011
197
22 July 2011
P0
0.5p.u.=50MW
Q0
0.15p.u.=15MVAr
Q1
0.45p.u.=45MVAr
-1.1459
-0.3819
V2
1.011p.u.
198
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.
-0.3819
-0.3820
-0.47
-1.1459
-1.1459
-0.96
V2
1.0056p.u.
1.0000p.u.
1.0043p.u.
22 July 2011
199
50,00 MW
0,00 Mvar
CERO
UNO
DOS
TRES
22 July 2011
100,00 MW
60,00 Mvar
200
Voltage p.u.
Power
1.02
1.02
PG=50MW
PC=0MW, QC=0MVAr
PC=100MW, QC=60MVAr
22 July 2011
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
201
B
16.67 50 76.67 10
0
10
10
P0 41.67
0.5 25
0.0 16.67
1 .0 0
Q0 41.67
Q 25
1
0.0 16.67
0 .6 0
22 July 2011
25 16.67
0 0
75
50
0 1
50 76.67 10 2
0
10
10 3
25 16.67
0 1.02
75
50
0 1.02
50 76.67 10 V2
0
10
10 V3
202
P0 = -251 -16.672-0*3
0.5 = 751 - 502-0*3
0.0 = -501 + 76.672-103
-1.0 = -0*1 - 102+103
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
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.
-0.3819
-0.48
-0.382
-1.1459
-0.91
-1.1459
-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
22 July 2011
205
206
22 July 2011
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
207
22 July 2011
208
22 July 2011
209