The load flow problem
Transcripción
The load flow problem
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. 6. 7. 8. Fast decoupled AC load flow Adjustment of bounds DC load flow 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 nonlineal 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 V1 22 July 2011 I2 YS YG YG Transmission line π model 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 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 YBUS 22 July 2011 Y11 Y12 YG YS Y21 Y22 YS YS YG YS 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 (>90% for more than 100 buses) 2. YBUS 22 July 2011 20 Ybus example Shunt element YG j 0.01 (two per line) Series element ZS j 0.1 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 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 senik ) [1] Qi Vi Vk (Gik senik Bik cos ik ) [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 • 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 i1 i1 PGi PDi PLOSS n n i1 i1 QGi QDi QLOSS 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 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 22 July 2011 x (r 1) x (r ) 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, 22 July 2011 x (11) 1.0001 r 11, x r 12, x (13 ) 1.0000 (12 ) 1.0000 Many iterations! 33 Gauss-Seidel solution technique Algorithm beginning 1) Known Pi i 2,...,n Qi i m 1,...,n Vi i 2,...,m V1 slack bus (PV & PQ Buses) (PQ Buses) (PV Buses) V i min , V i max i m 1,...,n (PQ Buses) QGi,min , QGi,max 22 July 2011 i 2,...,m (PV Buses) 34 Gauss-Seidel solution technique Algorithm beginning 2) Build YBUS 3) Initialize voltages Vi Vi i i 22 July 2011 0 0 i m 1,...,n i 2,...,n 35 Gauss-Seidel solution technique PQ buses 4) * Si 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 Gauss-Seidel solution technique PQ buses At iteration (r+1) and bus i, the available values of voltages at previous buses are used: Vi (r 1) 22 July 2011 Ai (r ) * (Vi ) i1 Bik V k k 1 (r 1) n Bik V k (r ) k i1 37 Gauss-Seidel solution technique PV buses 5) PV buses * Si 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 Gauss-Seidel solution technique PV buses At iteration (r+1): Q(ir 1) (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 Gauss-Seidel solution technique PV buses 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 (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) P1 jQ1 22 July 2011 * n V1 Y1k V k k 1 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 i Vk ILik YLik ILki Sik Iik 0 Iki0 Sik Y ik 0 22 July 2011 k Y ki0 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 i Vk ILik YLik ILki Sik Iik 0 Iki0 Sik Y ik 0 22 July 2011 k Y ki0 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 ) (r 1) (r ) Vi(r 1) V i V i 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 %calculo los angulos nudos PV: 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 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 1 1.02 (slack) 1-2 0.02+0.04j 2 1.02 PG=50 MW 1-3 0.02+0.06j 3 - PC=100 MW QC=60 MVAr 2-3 0.02+0.04j (each) 22 July 2011 Impedance (p.u.) 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 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 All buses but the reference one 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: Q(2r 1) ( V2(r ) )* Y21V1( r 1) ( V2(r ) )* Y22 V2( r ) ( V2(r ) )* Y23 V3( r ) 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 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 ) S12 , S21, S13 , S23 , S31, S32 6.2) Power flows * 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 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 1 2 3 ... 10 11 V1 1 (º ) 1.02 1.02 1.02 ... 1.02 1.02 0 0 0 ... 0 0 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 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.02 0º 1 50.83 7.16 2 50.00 55.01 3 -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 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) (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 The Newton-Raphson solution technique Introduction • Example f ( x ) x 2 5 x 4 0; x ( r 1) x (r ) df ( x ) 2x 5 dx ( x ( r ) )2 5 x ( r ) 4 ( 0 ) ; x 0 .5 (r ) 2x 5 x (1) 0 .5 2 5 0 . 5 4 0 .5 0.9375 2 0 .5 5 x ( 2) 0.9375 2 5 0.9375 4 0.9375 0.9988 2 0.9375 5 x (3) 0.9988 2 5 0.9988 4 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) ( 0 ) 1 J f ( x(0) ) x (1) x ( 0 ) x ( 0 ) x (r 1) 22 July 2011 x (r ) (r ) 1 J f ( x (r ) ) 74 The Newton-Raphson solution technique 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 The Newton-Raphson solution technique Load flow case x (r ) (2r ) ( r ) 3 n (r ) fiP () Vi Vk (Gik cos ik Bik sinik ) n k 1 (r ) n Vm1 fiQ () Vi Vk (Gik sinik Bik cos ik ) k 1 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 ) (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 The increments below should be 0: Pi(r ) Pi,sp fiP(r ) ; 22 July 2011 Q(ir ) Qi,sp fiQ(r ) 77 The Newton-Raphson solution technique Load flow case Matrix notation: P2(r ) f (r ) 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 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 22 July 2011 NPQ Number of PQ buses NPV Number of PV buses 80 The Newton-Raphson solution technique 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 The Newton-Raphson solution technique Jacobian elements m k Hkm Pk Vk Vm (Gkm sinkm Bkm cos km ) m Nkm Pk Vm Vk Vm (Gkm cos km Bkm sinkm ) Vm Jkm Qk Vk Vm (Gkm cos km Bkm sinkm ) m Lkm Qk Vm Vk Vm (Gkm sinkm Bkm cos km ) Vm 22 July 2011 82 The Newton-Raphson solution technique 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 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 3. i , i 2,...,n 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 then compute 1) P1 jQ1 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 ) L Q 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 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; Error_p = 1; N_iter = 0; % Tolerancia del metodo (Perdida de potencia). % Error inicial (A un valor mayor que Tol). % 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) 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)); PQ = [DP ; DQ]; Error_p = norm(PQ,2); % Bucle principal (Se permiten 50 iteraciones como mucho). % Expresion compleja de la tension % Expresion compleja de la potencia % Incremento de potencia activa (nudos PV y PQ) % Incremento de potencia reactiva (nudos PQ) % 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; 22 July 2011 % indices: 1...n-1 = fases en PV y PQ; n...final = modulos en PQ 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; disp('Pulse una tecla para continuar') pause end P=real(S); Q=imag(S); V_fase=V_fase*180/pi; T_calculo=toc; % % % % % % % % Incremento el numero de iteraciones % Calculo de la potencia activa % Calculo de la potencia reactiva % Paso de Radianes a grados **** 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 Bus Voltage p.u Power 1 1.02 - TWO THREE 2 1.02 PG=50 MW 3 - 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 • 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 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 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 P2cal 0.3624·1014 P2 0.5 P2 0.5 cal 1 cal P 0 P 1 P 3 3 3 cal 15 cal Q3 7.2475·10 Q3 0.6 Q3 0.6 No tolerance satisfied: the process continues. 22 July 2011 98 Newton-Raphson Example Jacobian: H22 H23 N23 J H32 H33 N33 M 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 - 0.4557 - 0.9406 100 Ejemplo por Newton-Raphson Residuals: P2cal 0.4958 P2 0.5 0.4958 0.0042 cal P 1 ( 0.9835) 0.0165 P 0 . 9835 3 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.0024·10 V3 22 July 2011 1.0200 V 1.0200 ; 1.0043 0 - 0.4710 - 0.9612 103 Newton-Raphson Example Residuals: 5 P2cal 0.5000 P2 0.5 0.5000 0.0664·10 cal 5 P3 1.0000 P3 1 ( 1.0000) 0.5454·10 6 Qcal 0.6000 Q 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.6458·10 2 3 - 0.7534·10-5 V -7 3 1.1106·10 V 3 22 July 2011 1.0200 V 1.0200 ; 1.0043 0 - 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) δ 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 i Ycc Ycc i j t 1 22 July 2011 1 t Ycc 2 t t j t 1 Ycc t 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 Yshunt 13 Z13 Z 23 3 2 Yshunt 13 Yshunt 23 Yshunt 23 Ycc The tap-changing transformer controls voltage of bus 4 22 July 2011 1 t Ycc 2 t 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 t 1 Ycc Ycc t t It does not depend on t! 120 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 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 ) Pi dato f (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 ) ... V t n t V 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 ) ... V t n t V 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 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: 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 1.00 Slack 2 1.00 Pg=150MW 3 -- Pc=50MW, Qc=10MVAr 4 -- Pc=0MW, 5 1.00 22 July 2011 Qc=0MVAr Pc=100MW,Qc=50MVAr 131 Tap-changing Example 1 Ylínea Yshunt Yshunt 2 Ylínea Yshunt Ylínea 4 Yshunt Yshunt Yshunt Ycc 1 t Ycc 2 t 22 July 2011 3 5 t t 1 Ycc t 132 Tap-changing Example Admitance matrix: YBUS Yl Ys Y l 0 0 0 22 July 2011 Yl 0 0 2Yl 2Ys 0 Yl 0 Yl Ys Yl Yl 0 0 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 0 . 3998 j 19 . 992 0 Ybus 0 0 0.3998 j19.942 0.3998 j19.992 0 0 0 . 3998 j 19 . 992 0 . 3998 j 19 . 992 0 . 7997 j 49 . 884 j 10 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 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 0 0.3998 19.992 0 0.3998 0.3998 49.984 10 0.3998 0.7997 10 10 0 0 0.3998 0 19.892 19.992 0.7997 0 19.992 49.754 0 0 0 10 0 0 0 0 0 10 10 136 Tap-changing Example First iteration: 2 0 3 1 0 4 0.0993 1 0 . 0744 0 5 V3 0.1744 V 0.9623 ; 0.0993 ; t 0.918 V3 0.968 0.0744 0 . 0377 V 4 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.3998 j19.992 0.7997 j39.884 0 0.3998 j19.992 0 0 0 0.3998 j19.94 0.3998 j19.992 0 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 1 . 0527 5 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.2698 J 0 0 1.8242 0 22 July 2011 0 19.3273 0 0 1.0523 18.6075 18.6075 0 0.0954 0.8359 18.6261 48.3879 10.492 0.0912 0.8183 0 10.492 10.492 0 1.0527 0.8359 0.8359 0 18.3261 18.6075 0.0912 0.6803 1.0527 18.6261 48.5934 0 1.0527 1.0527 0 10.492 0 1.0527 1.0527 0 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 5 V 3 0.0021 V 0.9607 ; 0.1043 ; t 0.9144 V3 0.9644 0.0744 0 . 0016 V 4 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 j19.992 0.7997 j39.884 0 0 . 3998 j 19 . 992 0 0 0 0.3998 j19.942 0.3998 j19.992 0 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 1 . 0000 5 Q3 0.1 0.1000 0.0339 Q 0 . 0006 0 . 6375 4 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: 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 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 1 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 0 19.1935 J 0 0 1.872 0 22 July 2011 0 19.253 0 0 1.103 18.5072 18.5072 0 0.1307 0.8689 18.5271 48.2132 10.4926 0.1282 0.7431 0 10.4926 10.4926 0 0.9993 0.8689 0.8689 0 18.3071 18.5072 0.1282 0.7445 0.9993 18.5271 48.1983 0 0.9993 0.9993 0 10.4926 0 0.9993 0.9993 0 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 5 3 V 3 0.1699 10 V 0.9607 ; 0.1043 V3 0.9644 0.0744 0 . 0552 V 4 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 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 ( r 1) P(r ) H(r ) N(r ) (r 1) (r ) (r ) ( r ) V L Q J V (r ) Assume: i) V i 1 .0 ii) Gik Bik i 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 ~ B ik Bik ~ ~ B1 , B2 ~ Bii Bii 22 July 2011 Elements of YBUS 156 Fast decoupled AC load flow ~ ( r 1) P(r ) B 0 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 ) Use Newton-Raphson Iteration 22 July 2011 157 Fast decoupled load flow. Flow diagram DATA INPUT Calculate Delta P Real power coverged ? YES NO Reactive power coverged ? YES NO Solve (1) and update angles Calculate Delta Q NO Reactive power coverged ? NO YES Real power coverged ? YES NO Solve (2) and update V 22 July 2011 OUTPUT RESULTS 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; Error_p = 1; N_iter = 0; % Valores iniciales V_modulo= V_modulo_ini'; V_fase = V_fase_ini'; V = V_modulo.*exp(j*V_fase); P = P_ini'; Q = Q_ini'; % Tolerancia del metodo (Perdida de potencia). % Error inicial (A un valor mayor que Tol). % Numero de iteraciones. % Expresion compleja de la tension 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 % H L = [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))]; = imag(-Y(2:end , 2:end)) = imag(-Y(m+1:end,m+1:end)) 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)); % Bucle principal (Se permiten 50 iteraciones como mucho). % Expresion compleja de la tension % Expresion compleja de la potencia % Incremento de potencia activa (nudos PV y PQ) % Incremento de potencia reactiva (nudos PQ) Dfase = H\DP; Dmodulo = L\DQ; PQ = [DP ; DQ]; Error_p = norm(PQ,2); 22 July 2011 % Error en esa iteracion 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); Q=imag(S); V_fase=V_fase*180/pi; T_calculo=toc; % % % % % % % % Calculo de la potencia activa % Calculo de la potencia reactiva % Paso de Radianes a grados **** 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 V_fase P Q N_iter T_calculo Error_p = Modulo de la tension en todos los nodos. = Fase de la tension en todos los nodos. = Potencia activa en todos los nodos. = Potencia reactiva en todos los nodos. = Numero de iteraciones. = Tiempo de calculo. = 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 22 July 2011 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) 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 1 Slack and reference V1 = 1.02 δ1=0.0 P1, Q1 2 PV P2 =0.5 V2 = 1.02 δ2, Q2 3 PQ P3 = -1.0 Q3 = -0.6 δ3, V3 • Inicialization: δ2 = δ3 = 0.0 ; 22 July 2011 V3 = 1.02 p.u. 166 Fast decoupled load flow: Exaple • Flow diagram Vi(0) , δi(0), Piesp, Qiesp Compute: Delta P Compute: Pical, Qical Convergence 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 Fast decoupled load flow: Exaple Compute 60 40 H ; L 55 40 55 Calculate P and Q: cal P2cal 0.3624·1014 P2 0.5 P2 0.5 cal 1 cal P 0 P 1 P 3 3 3 cal 15 cal Q3 7.2475·10 Q3 0.6 Q3 0.6 No convergence 22 July 2011 168 Fast decoupled load flow: Exaple • First iteration: 2 - 0.4213 3 - 1.3481 V 3 - 0.0109 V3 22 July 2011 1.0200 V 1.0200 ; 1.0091 0 - 0.4213 - 1.3481 169 Fast decoupled load flow: Exaple Residuals: cal P2cal 0.7385 P2 0.5 P2 0.2385 cal P 1 Pcal 0.3003 P 1 . 3003 3 3 3 cal Qcal 0.4583 0 . 1417 Q 0 . 6 Q 3 3 3 Error = 0.5976 → no convergence 22 July 2011 170 Fast decoupled load flow: Exaple • System state (second iteration) 2 - 0.0372 3 0.2857 V 3 - 0.0083 V3 22 July 2011 1.0200 V 1.0200 ; 1.0008 0 - 0.4585 - 1.0264 171 Fast decoupled load flow: Exaple •Residuals: cal P2cal 0.6578 P2 0.5 P2 0.1578 cal P 1 Pcal 0.1936 P 1 . 1936 3 3 3 cal cal Q3 0.7444 Q3 0.6 Q3 0.1444 •Error = 0.2885 → no convergence 22 July 2011 172 Fast decoupled load flow: Exaple • System state (third iteration): 2 - 0.0315 3 0.1788 V 3 0.0026 V3 1.0200 V 1.0200 ; 1.0034 0 - 0.4900 - 0.8836 • The process continues. 22 July 2011 173 Fast decoupled load flow: Exaple •After 9 iterations: cal 3 P2cal 0.5006 P2 0.5 P2 0.5954·10 cal P 1 Pcal 0.7006·103 P 1 . 0007 3 3 3 cal 3 Qcal 0 . 5992 Q 0 . 6 Q 8 . 3346 · 10 3 3 3 •Error = 0.0012 → convergence attained 22 July 2011 174 Fast decoupled load flow: Exaple • System state at iteration 10: -3 0.1592·10 2 3 0.6141·10-3 V -5 3 1.5154·10 V 3 22 July 2011 1.0200 V 1.0200 ; 1.0043 0 - 0.4710 - 0.9614 175 Fast decoupled load flow: Exaple •Residuals: cal 3 P2cal 0.5003 P2 0.5 P2 0.2863·10 cal cal 3 P3 1.0004 P3 1 P3 0.3516·10 cal 4 Qcal 0 . 6003 Q 0 . 6 Q 3 . 3349 · 10 3 3 3 •Error = 5.6285·10-4 → convergence attained 22 July 2011 176 Fast decoupled load flow: Exaple • State at iteration 11: -3 0.0567·10 2 3 0.3251·10-3 V -6 3 6.0634·10 V 3 0.5098 P 0.5003 1.0004 22 July 2011 1.0200 V 1.0200 ; 1.0043 0 - 0.4711 - 0.9611 0.0711 Q 0.5515 0.6003 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 max v min v v i i i Action: Warning! 2. voltage problem Flow magnitudes out of limits A line does not meet - S max ≤ S ≤ S max ij ij ij Action: Warning! 22 July 2011 overloading of lines problem 183 Variable limits Physical Considerations 3. Reactive Power out of limits A PV BUS does not meet Qi min Qi Qi max 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 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 V Yes No yes V 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 Bijij Biji Bij j n n Pi Pij Bij i Bij j j1 j1 j1 j i j i ji P B´ n where 22 July 2011 Bii' n Bij j1 ji Bij' Bij 189 DC load flow Continuation Qij Vi V j Xij Bij ( V i V j ) Bij V i Bij V j n n Qi Qij Bij V i Bij V j j1 j1 j1 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 B ii ij 1 ' j1 B ; B ij ji 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 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 DC Power flow: example 41.67 B 25 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 DC Power flow: example 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 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: 22 July 2011 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. 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 0,00 Mvar 50,00 MW 0,00 Mvar CERO UNO DOS TRES 22 July 2011 100,00 MW 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 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 DC Power flow: example 0 41.67 25 16.67 25 75 50 0 B 16.67 50 76.67 10 0 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 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 NR. 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) 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 Comparison of load flow methods (Continuation) 3. AC decoupled B has to be computed and factorized only once It requires more iterations than NewtonRaphson method Iteration time is 5 times lower than NewtonRaphson´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