load_flow

download load_flow

of 5

Transcript of load_flow

  • 7/25/2019 load_flow

    1/5

    % ==========Power flow program using Newton-Raphson Method========= %% By: %% Abdul Wahab orai ! "ni#ersity of $uisburg-ssen %% %% $ate: &'(&)(*&'+ %

    % ================================================================= %

    %%%------------------,mportant----------------------%

    % load flow euations are non-linear in nature. /o find the solution of su0heuations1 it is assumed that% '. solution e2ists thats is 3f324=&4% *. euation are 0ontinuous and diffrentiable.% 5ow to sol#e these non-linear euations of power 3P164 7.% one 0an sol#e these euations by 0onsidering assumptions ' and * and usinglinear% appro2imation method 3also 8nown as newton-raphson method4. also to be% noted here is that the taylor series e2pnasion is the basis of the newton-raphson method.

    % so if we ha#e one euation whose solution we assume e2ists and is% 0ontinuous and diffretiable then a00ording to the newton-raphson

    % f32&4=-32-2&49f32&4 ----3'4% where 2& is our initial guess.uation ' here gi#es the linearappro2imation of the fun0tion f324 at point 2&.% this euation will always result in straight line 3/agent line of f324 atthe 2&4% thus our solution in this 0ase by manipulating euation ' will be% 2 = 2&-f32&4(f32&4 ------ 3*4 3updated #alue of 2&4

    % ,t should be noted that the euation ' is linear euation 1 and higher orderderi#ati#es 3higher than '4 are% negle0ted. hen0e for the solution of f324 3non- linear euation41 an% iterati#e method is reuired to mat0h the solution we are loo8ing for3be0ause we ha#e trun0ted the non-linear% euation after first deri#ati#e1 so obi#ously the solution will not bee2a0t1 so iterations are reuired to get the% e2a0t solution4.

    % uation ' 0an be used in matri2 form1 in that 0ase1 f32&41 will be our% ;a0obian whi0h is a matri2 of a first order partial deri#ati#es of the non-linear

    % fun0tion 3P164 e#aluated at 2&.

    %

  • 7/25/2019 load_flow

    2/5

    % /hings to note :% '4 the #oltage and angle at the swing bus is spe0ified and therefore notpart of the the solution #e0tor% *4 the bus #oltage magnitudes at P? buses are spe0ified and therefore not% part of abs 3?4. nly the bus #oltage magnitudes of P6 buses are in0luded% 4 angle in0ludes all P6 and P? buses% therefore #e0tor 2 is an m9' #e0tor with% m = *9n

  • 7/25/2019 load_flow

    3/5

    31*4=-'(H*>314='(H' C '(H*>> % Print =OCEB Admittan0e Matri2

    %----------ondu0tan0e ?alues------------%O3'1'4=real33'1'44>O3'1*4=real33'1*44>O3'14=real33'144>O3*1'4=real33*1'44>O3*1*4=real33*1*44>O3*14=real33*144>O31'4=real331'44>O31*4=real331*44>O314=real33144>%--------Dus0eptan0e ?alues----------%B3'1'4=imag33'1'44>B3'1*4=imag33'1*44>B3'14=imag33'144>B3*1'4=imag33*1'44>B3*1*4=imag33*1*44>

    B3*14=imag33*144>B31'4=imag331'44>B31*4=imag331*44>B314=imag33144>

    %--------- Oi#en Dpe0ifi0ations in pu 3nown4----------%?'MAO='.&>ANO'=&>?*MAO='.&+>P*sp=*.&>Psp=-+.&>6sp=-'.&>

    % -------------alulate ANO*1 ?MAO and ANO---------------%% ----Dolution Parameters----%/oleran0e= &.&&'>,ter%----- ,nitialiFation-------%,ter=&>i=&>on#lag='>delANO*=&>delANO=&>delMAO=&>%-------------- to be determined 3lat start4-----------%%%%%%%%ANO*=&>ANO=&>?MAO='.&>%------------------ Dtart ,teration Pro0ess for N-R-----------------%while3 on#lag==' QQ ,ter ,ter%%----------- update the ?oltage and Angles to 0al0ulate new Ea0obian---%ANO*=ANO*CdelANO*>ANO=ANOCdelANO>?MAO=?MAOCdelMAO>

  • 7/25/2019 load_flow

    4/5

    %------- reation of ;a0obian ;--------%

    % ------ delP*(delANO*=;3'1'4;3'1'4 = ?*MAO93?'MAO93B3*1'490os3ANO*-ANO'4-O3*1'49sin3ANO*-ANO'44C?MAO93B3*1490os3ANO*-ANO4-O3*149sin3ANO*-ANO444>

    %%%%--------- delP*(delANO = ;3'1*4------------%;3'1*4=?*MAO9?MAO93O3*149sin3ANO*-ANO4-B3*1490os3ANO*-ANO44>%%%%%%%------ delP*(del?Mag = ;3'14--------%;3'14 = ?*MAO93O3*1490os3ANO*-ANO4CB3*149sin3ANO*-ANO44>%%%%%%%%%%%--- delP(delANO* = ;3*1'4---------%%%;3*1'4 = ?MAO9?*MAO93O31*49sin3ANO-ANO*4-B31*490os3ANO-ANO*44>%%%%%%%%%%%-------delP(delANO = ;3*1*4-----------------%%;3*1*4= ?MAO93?'MAO93B31'490os3ANO-ANO'4-O31'49sin3ANO-ANO'44C?*MAO93B31*490os3ANO-ANO*4-O31*49sin3ANO-ANO*444>%%%%%%%%%%%----------delP(del?MAO = ;3*14------%;3*14 = *9O3149?MAOC?'MAO93O31'490os3ANO-ANO'4CB31'49sin3ANO-ANO'4C?*MAO93O31*490os3ANO-ANO*4CB31*49sin3ANO-ANO*444>%%%%%%%%%--------------del6(delANO* = ;31'4--------%; 31'4= -?MAO9?*MAO93O31*490os3ANO-ANO*4CB31*49sin3ANO-ANO*44>

    %%%%%%%%%% ----------------del6(delANO = ;31*4--------%;31*4 = ?MAO93?'MAO93B31'490os3ANO-ANO'4CO31'49sin3ANO-ANO'44C?*MAO93B31*490os3ANO-ANO*4CO31*49sin3ANO-ANO*444>%%%%%%%%%%-------------del6(del?MAO = ;314------%;314 = -*9B3149?MAOC?'MAO93O31'490os3ANO-ANO'4-B31'49sin3ANO-ANO'4C?*MAO93O31*490os3ANO-ANO*4-B31*49sin3ANO-ANO*444>

    ; = ;3'1'4 ;3'1*4 ;3'14>;3*1'4 ;3*1*4 ;3*14> ;31'4 ;31*4 ;314@>

    %%%%%%% 0al0ulation of updated #oltages with angles %%%%%%%%%%%%?3'4 = ?'MAO9e2p3'i9ANO'4>?3*4= ?*MAO9e2p3'i9ANO*4>?34 = ?MAO9e2p3'i9ANO4>

    %%%%%%%----------- urrent inEe0tions at ea0h bus based on updated #oltagesand angles----------%%%%%%%%%, = 9?>

    %%%%%%%%%----------0al0ulation of P and 6-----------%%%%%%%%%%%D3'4 = ?3'490onE3,3'44>D3*4 = ?3*490onE3,3*44>D34 = ?3490onE3,344>%%%%%%%%%%%------------- Mistmat0hes--------------%%%%%%%%%%Mismat0h3'4 = P*sp-real3D3*44>Mismat0h3*4 = Psp-real3D344>Mismat0h34 = 6sp-imag3D344>%%%%%%%-------- 0al0ulate the deltaANO and delta?MAO-----------%%%%%%%

    del=in#3;49Mismat0h> % for large matri0es1 this mathod is bad.% Always use G" fa0toriFaFion to sol#e this linear euation.delANO* = del3'4>delANO = del3*4>delMAO = del34>%%%%%%%%%%%----------- al0ulate power flow on transmission line-------%%P'* = real3?3'4490onE33?3'4-?3*44(H'*4>P' = real3?3'4490onE33?3'4-?344(H'4>P*' = real3?3*4490onE33?3*4-?3'44(H'*4>P* = real3?3*4490onE33?3*4-?344(H*4>

  • 7/25/2019 load_flow

    5/5

    P' = real3?34490onE33?34-?3'44(H'4>P* = real3?34490onE33?34-?3*44(H*4>

    6'* = imag3?3'4490onE33?3'4-?3*44(H'*4>6' = imag3?3'4490onE33?3'4-?344(H'4>6*' = imag3?3*4490onE33?3*4-?3'44(H'*4>6* = imag3?3*4490onE33?3*4-?344(H*4>6' = imag3?34490onE33?34-?3'44(H'4>6* = imag3?34490onE33?34-?3*44(H*4>

    P' = real3D3'44>6' = imag3D3'44>P* = real3D3*44>6* = imag3D3*44>P = real3D344>6 = imag3D344>

    %%%%%%%%%%-----------$isplay the results -----------%%%%%%%%%%%%%%%%

    fprintf3Sn %s %*d %s Sn1 ,ter 1,ter1 Mismat0h ' Mismat0h * Mismat0h 4fprintf3 %K.)f %K.)f %K.)f Sn1 Mismat0h3'41Mismat0h3*41 Mismat0h34 4>

    ifma23abs3Mismat0h4T /oleran0e4

    on#lag = '>else on#lag = &>endend;>%radians into degreesANO*$O=ANO*9'U&(piANO$O=ANO9'U&(pi

    ?MAO?/=Feros34fori=': forE=': /3i1E4=?3i490onE33?3i4-?3E4493-3i1E444> endend>/J=Feros34> J3'1*4=/3'1*4C/3'14C/31*4> J3'14=/3'14C/3'1*4C/3*14> J3*1'4=/3*1'4C/3*14C/31'4>

    J3*14=/3*14C/3*1'4C/3'14> J31'4=/31'4C/31*4C/3*1'4> J31*4=/31*4C/31'4C/3'1*4> J