Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
48 views

Program For Load Flow by Newton

The document describes the Newton-Raphson load flow method for solving power systems. It discusses forming the Jacobian matrix, which relates mismatches in real and reactive power to updates in voltage magnitude and angle. The algorithm iterates between calculating the mismatches, forming the Jacobian, and solving for the updates until convergence is reached. An example 5-bus system is used to demonstrate calculating the various submatrices that make up the full Jacobian matrix.

Uploaded by

athar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Program For Load Flow by Newton

The document describes the Newton-Raphson load flow method for solving power systems. It discusses forming the Jacobian matrix, which relates mismatches in real and reactive power to updates in voltage magnitude and angle. The algorithm iterates between calculating the mismatches, forming the Jacobian, and solving for the updates until convergence is reached. An example 5-bus system is used to demonstrate calculating the various submatrices that make up the full Jacobian matrix.

Uploaded by

athar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Theory:

Section I: Load Flow By Newton-Raphson Method

 Load Flow Algorithm


 Formation of the Jacobian Matrix
 Solution of Newton-Raphson Load Flow

Let us assume that an n -bus power system contains a total np number of P-Q buses while the
number of P-V (generator) buses be ng such that n = np + ng + 1. Bus-1 is assumed to be the
slack bus. We shall further use the mismatch equations of ΔPi and ΔQi given in (4.9) and (4.10)
respectively. The approach to Newton-Raphson load flow is similar to that of solving a system
of nonlinear equations using the Newton-Raphson method: At each iteration we have to form
a Jacobian matrix and solve for the corrections from an equation of the type given in (4.27).
For the load flow problem, this equation is of the form

(4.30)

where the Jacobian matrix is divided into submatrices as

(4.31)
It can be seen that the size of the Jacobian matrix is ( n + np − 1) x ( n + np −1). For example
for the 5-bus problem of Fig. 4.1 this matrix will be of the size (7 x 7). The dimensions of the
submatrices are as follows:

J11: (n  1)  (n  1), J12: (n  1)  np, J21: np  (n  1) and J22: np  np

The submatrices are

(4.32)

(4.33)

(4.34)

(4.35)
Load Flow Algorithm

The Newton-Raphson procedure is as follows:

Step-1: Choose the initial values of the voltage magnitudes |V| (0) of all np load buses and n − 1
angles δ (0) of the voltages of all the buses except the slack bus.

Step-2: Use the estimated |V|(0) and δ (0) to calculate a total n − 1 number of injected real power
Pcalc(0) and equal number of real power mismatch ΔP (0) .

Step-3: Use the estimated |V| (0) and δ (0) to calculate a total np number of injected reactive power
Qcalc(0) and equal number of reactive power mismatch ΔQ (0) .

Step-3: Use the estimated |V| (0) and δ (0) to formulate the Jacobian matrix J (0) .

Step-4: Solve (4.30) for δ (0) and Δ |V| (0) ÷ |V| (0).

(4.36)

(4.37)

Step-5 : Obtain the updates from

Step-6: Check if all the mismatches are below a small number. Terminate the process if yes.
Otherwise go back to step-1 to start the next iteration with the updates given by (4.36) and
(4.37).
Solution of Newton-Raphson Load Flow

The Newton-Raphson load flow program is tested on the system of Fig. 4.1 with the system data
and initial conditions given in Tables 4.1 to 4.3. From (4.41) we can write

Similarly from (4.39) we have

Hence from (4.42) we get

In a similar way the rest of the components of the matrix J11(0) are calculated. This matrix is
given by

For forming the off diagonal elements of J21 we note from (4.44) that

Also from (4.38) the real power injected at bus-2 is calculated as

Hence from (4.45) we have


Similarly the rest of the elements of the matrix J21 are calculated. This matrix is then given as

For calculating the off diagonal elements of the matrix J12 we note from (4.47) that they are
negative of the off diagonal elements of J21 . However the size of J21 is (3 X 4) while the size of
J12 is (4 X 3). Therefore to avoid this discrepancy we first compute a matrix M that is given by

The elements of the above matrix are computed in accordance with (4.44) and (4.45). We can
then define

Furthermore the diagonal elements of J12 are overwritten in accordance with (4.48). This matrix
is then given by

Finally it can be noticed from (4.50) that J22 = J11 (1:3, 1:3). However the diagonal elements of
J22 are then overwritten in accordance with (4.51). This gives the following matrix
From the initial conditions the power and reactive power are computed as

Consequently the mismatches are found to be

Then the updates at the end of the first iteration are given as

The load flow converges in 7 iterations when all the power and reactive power mismatches are
below 10−6 .
% Program for load flow by Newton-Raphson Method.
clear;
% n stands for number of buses
n=3;
% V,voltages those buses are initialised
V=[ 1.04 1.0 1.0];
% Y is YBus
Y = [ 6.88228- j*2.350514 -2.9427+ j*11.7676 -1.9427+ j*11.7676
-2.9427+ j*11.7676 6.88228- j*23.50514 -1.9427+ j*11.7676
-1.9427+ j*11.7676 -2.9427+ j*11.7676 6.88228- j*23.50514];
%Bus types are initialised in type array to code 1 which stands for PQ
%bus.
%code 2 stands for PVbus
type = ones(n,1);
%when Q limits are exceeded for PV bus Bus type is changed to PQ
%temporarily
%an element i type changed is set to 1 in case its bus status
%is temporarily changed from PQ to PV.Otherwise it is zero
typechanged = zeros(n,1);
%Since max and min Q limits are checked only for PV buses,
% max and min Q limits for other types of buses can be set to any values.
Qlimitmax=zeros(n,1);
Qlimitmin=zeros(n,1);
Vmagfixed=zeros(n,1);
% Here we change type of PV buses to 2 and also set the Q limits for them
type(3)=2;
Qlimitmax(3)=1.5;
Qlimitmin(2)=0;
Vmagfixed(2)=1.04;
diff=10;noofiter=1;
Pspec=[inf 0.5 -1.5];
Qspec=[inf 1 0];
S = [inf+ j*inf (0.5- j*0.2) (-1-0 + j*0.5) (0.3- j*0.1)];
%here for all the buses depending on bustype, associated varibles array
%element for each equation (deltaP or del taQ) is initialised
%also associated varibles with each col(ddelta or dv ) is formed
while(diff>0.00001|| noofiter==1),
eqcount=1;
for i=2:n,
Scal(i) = 0;
sumyv=0;
for k=1:n;
sumyv= sumyv +Y(i,k)*V(k);
end
Scal(i)=V(i)*conj(sumyv);
P(i)=real(Scal(i));
Q(i)=imag(Scal(i));
%if the bus is pv bus and the calculated Q is exceeding the
%limits, the bus type is temporarily changed to PQ and
%type changed is made 1 for that bus
%otherwise its switched back to PV bus and
%type changed is resetted to zero for that bus
if type(i)==2 || typechanged(i)==1,
if (Q(i)>Qlimitmax(i) || Q(i)<Qlimitmin(i)),
if(Q(i)<Qlimitmin(i)),
Q(i)=Qlimitmin(i);
else
Q(i)=Qlimitmax(i);
end
type(i)=1;
typechanged(i)=1;
else
type(i)=2;
typechanged(i)=0;
end
end
%The mismatch equations are arranged and solved in matrix form
%as indicated below
%|dPi| |dDelta|
%|dQi|= [J] |dV|
%|dP(i+1)| |dDelta|
%|dQ(i+1)| |dV|
%Assoeqvar(i[associated equation varible]indicates if the equation
%deal
if type(i)==1,
assoeqvar(eqcount)='p';
assoeqbus(eqcount)=i;
mismatch(eqcount)=Pspec(i)-P(i);
assoeqvar(eqcount+1)='Q';
assoqbus(eqcount+1)=i;
mismatch(eqcount+1)=Qspec(i)-Q(i);

assocolvar(eqcount)='d';
assocolbus(eqcount)=i;
assocolvar(eqcount+1)='V';
assocolbus(eqcount+1)=i;
ecount=eqcount+2;

else
assoeqvar(eqcount)='p';
assoeqbus(eqcount)=i;
assocolvar(eqcount)='d';
assocolbus(eqcount)=i;
mismatch(eqcount)=Pspec(i)-P(i);
eqcount=eqcount+1;
end
end
mismatch;
eqcount=eqcount-1;
noofeq=eqcount;
Update = zeros(eqcount,1);
Vprev=V;
abs(V);
abs(Vprev)
pause
Vprev=V;
% ceq stands for current equation being processed, which is vried from
%1 to total no. of equations (eqcount)
for ceq =1 :eqcount,
for ccol=1:eqcount,
am=real(Y(assoeqbus(ceq),assocolbus(ccol))*V(assocolbus(ccol)));
bm=imag(Y(assoeqbus(ceq),assocolbus(ccol))*V(assocolbus(ccol)));
ei=real(V(assoeqbus(ceq)));
fi=imag(V(assoeqbus(ceq)));

if assoeqvar(ceq)=='P' && assocolvar(ccol)=='d',

if assoeqbus(ceq)~=assocolbus(ccol),
H=am*fi - bm*ei;
else
H=-
Q(assoeqbus(ceq))*imag(Y(assoeqbus(ceq),assocolbus(ceq))*abs(V(assoeqbus(ceq)
))^2);

end
Jacob(ceq,ccol)=H;
end
if assoeqvar(ceq)=='P' && assocolvar(ccol)=='V',
if assoeqbus(ceq)~=assocolbus(ccol),
N=am*ei+bm*fi;
else

N=P(assoeqbus(ceq))+real(Y(assoeqbus(ceq),assocolbus(ceq))*abs(V(assoeqbus(ce
q)))^2);
end
Jacob(ceq,ccol)=N;
end
if assoeqvar(ceq)=='Q' && assocolvar(ccol)=='d',
if assoeqbus(ceq)~=assocolbus(ccol),
J=am*ei+bm*fi;
else
J=P(assoeqbus(ceq)) +
real(Y(assoeqbus(ceq),assocolbus(ceq))*abs(V(assoeqbus(ceq)))^2);
end
Jacob(ceq,ccol)=J;
end
if assoeqvar(ceq)=='Q' && assocolvar(ccol)=='V',
if assoebus(ceq)~=assocolbus(ccol),
L=am*fi-bm*ei;
else
L=Q(assoeqbus(ceq))-
imag(Y(assoeqbus(ceq),assocolbus(ceq))*abs(V(assoeqbus(ceq)))^2);
end
Jacob(ceq,ccol)=L;
end
end
end
%New Update vector is calculated from inverse of the Jacobian
Jacob
pause
update=inv(Jacob)* mismatch;
noofeq=1;
for i=2:n;
if type(i)==1
newchinangV=update(noofeq);
newangV=angle(V(i))+newchinangV;
newchinmagV=update(noofeq+1)*abs(V(i));
newmagV=abs(V(i))+newchinmagV;
V(i)=polarTorect(newmagV,newangV*180/pi);
noofeq=noofeq+2;
else
newchinangV=update(noofeq);
newangV=angle(V(i))+newchinangV;
V(i)= polarTorect(abs(V(i)),newangV*180/pi);
noofeq=noofeq+1;
end
end
clear 'mismatch Jacob update assoeqvar assoeqbus assocolvar assocolbus' ;
diff=min(abs(abs(V(2:n))-abs(Vprev(2:n))));
noofiter=noofiter+1;
end

>> atharnewton

ans =

1.0400 1.0000 1.0000

You might also like