Exp7

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Roll No.:107120062 Name: Kavin Akash S Experiment No.

: 7

Load Flow Analysis – Newton-Raphson Method & Decoupled Method

Problem 1:
Write a MATLAB Code to analyse the power flow using Newton-Raphson Method (using Polar Coordinates)
for the system shown in Fig. 1. Take base MVA as 100 MVA. Perform iterations till a tolerance of 𝜀 = 0.0001
is reached. The results should display the following.

a. the bus voltages (magnitude and angles).

b. active and reactive power flows in the lines.

c. active and reactive power losses in the lines.

d. active and reactive power supplied by the slack bus.

EELR17 Power Systems Laboratory 1


MATLAB Code:
clc;
clear;
%A=[1 2 .025 .05; % 1 3
.0125 .025; % 2 3 .0125
.025];
A=input("Enter the details of the power system
\n");
n=max(A(:,2)); size=numel(A(:,1));
Yb=complex(zeros(n)); for q=1:size f=A(q,1);
t=A(q,2); R=A(q,3);
X=A(q,4);
Z=complex(R,X);
Yb(f,t)=-Yb(f,t)-1/Z;
Yb(t,f)=-Yb(t,f)-1/Z;
Yb(f,f)=Yb(f,f)+1/Z;
Yb(t,t)=Yb(t,t)+1/Z;
end disp(Yb)
mod_Yb=abs(Yb);
theta=angle(Yb)
;
Base_MVA=input("Enter the value of Base MVA: ");
%Base_MVA=100;
Delta_1=input("Enter the phase angle of voltage of bus 1: ");
%Delta_1=0;
mod_V1=input("Enter the value of voltage of bus 1: ");
%mod_V1=1.025;
Delta_2=0;
mod_V2=input("Enter the magnitude of voltage of bus 2: ");
%mod_V2=1.03;
P2=input("Enter the active power of bus 2: ");
P2=300/Base_MVA;
mod_V3=1;
Delta_3=0;
P3=input("Enter the active power of bus 3: ");
P3=-400/Base_MVA;
Q3=input("Enter the reactive power of bus 3: ");
Q3=-200/Base_MVA;
delP2=1;
delP3=1;
delQ3=1;
iteration=0
;
e=input("Enter the tolerance: ");
%e=0.0001;
while(abs(delP2)>e || abs(delP3)>e || abs(delQ3)>e)
mod_V=[mod_V1 mod_V2 mod_V3];
D=[Delta_1 Delta_2 Delta_3];
P2cal=0;
P3cal=0;
Q3cal=0;
for x=1:size

EELR17 Power Systems Laboratory 2


P2cal=P2cal+mod_V2*mod_V(1,x)*mod_Yb(2,x)*cos(theta(2,x)+D(1,x)-Delta_2);
P3cal=P3cal+mod_V3*mod_V(1,x)*mod_Yb(3,x)*cos(theta(3,x)+D(1,x)-
Delta_3); Q3cal=Q3cal-
mod_V3*mod_V(1,x)*mod_Yb(3,x)*sin(theta(3,x)+D(1,x)-Delta_3); end
delP2=P2-P2cal; delP3=P3-P3cal; delQ3=Q3-Q3cal;
J=zeros(size);

J(1,1)=mod_V2*(mod_V1*mod_Yb(2,1)*sin(theta(2,1)+Delta_1Delta_2)+mod_V3*mod_Yb(2,3)*sin(the
ta(2,3)+Delta_3-Delta_2));
J(1,2)=mod_V2*mod_V3*mod_Yb(2,3)*sin(Delta_2-theta(2,3)-Delta_3);
J(1,3)=mod_V2*mod_Yb(2,3)*cos(theta(2,3)+Delta_3-Delta_2);
J(2,1)=mod_V2*mod_V3*mod_Yb(3,2)*sin(Delta_3-theta(3,2)-Delta_2);

J(2,2)=mod_V3*(mod_V1*mod_Yb(3,1)*sin(theta(3,1)+Delta_1Delta_3)+mod_V2*mod_Yb(3,2)*sin(the
ta(3,2)+Delta_2-Delta_3));
J(2,3)=mod_V1*mod_Yb(3,1)*cos(theta(3,1)+Delta_1-
Delta_3)+mod_V2*mod_Yb(3,2)*cos(theta(3,2)+Delta_2-
Delta_3)+2*mod_V3*mod_Yb(3,3)*cos(theta(3,3));
J(3,1)=-mod_V2*mod_V3*mod_Yb(3,2)*cos(-theta(3,2)+Delta_3-Delta_2);
J(3,2)=mod_V3*(mod_V1*mod_Yb(3,1)*cos(-theta(3,1)+Delta_3-
Delta_1)+mod_V2*mod_Yb(3,2)*cos(theta(3,2)+Delta_3-Delta_2));
J(3,3)=mod_V1*mod_Yb(3,1)*sin(Delta_3-Delta_1-
theta(3,1))+mod_V2*mod_Yb(3,2)*sin(Delta_3Delta_2-theta(3,2))+2*mod_V3*mod_Yb(3,3)*sin(-
theta(3,3));
MV=[delP2;delP3;delQ3];
DiffM=inv(J)*MV;

Delta_2=Delta_2+DiffM(1,1);
Delta_3=Delta_3+DiffM(2,1);
mod_V3=mod_V3+DiffM(3,1);
iteration=iteration+1; end
V1=mod_V1*exp(1i*Delta_1);
V2=mod_V2*exp(1i*Delta_2);
V3=mod_V3*exp(1i*Delta_3);

S12=V1*conj(-Yb(1,2)*(V1-V2))*Base_MVA;
S21=V2*conj(-Yb(2,1)*(V2-V1))*Base_MVA;
S23=V2*conj(-Yb(2,3)*(V2-V3))*Base_MVA;
S32=V3*conj(-Yb(3,2)*(V3-V2))*Base_MVA;
S13=V1*conj(-Yb(1,3)*(V1-V3))*Base_MVA;
S31=V3*conj(-Yb(3,1)*(V3-V1))*Base_MVA;

fprintf("Number of Iterations: %.0f\n\n",iteration)

fprintf("a)The bus voltages(magnitudes and angles[in


deg]):\n") fprintf(" i) Bus-1: %.5f<%f
V\n",abs(V1),rad2deg(angle(V1))) fprintf(" ii) Bus-2:
%.5f<%f V\n",abs(V2),rad2deg(angle(V2))) fprintf(" iii)Bus-
3: %.5f<%f V\n\n",abs(V3),rad2deg(angle(V3)))

fprintf("b)Active and Reactive power flows in lines:\n") fprintf("


Active Power flow from bus 1 to 2 is %.2f MW\n",real(S12)) fprintf("
Reactive Power flow from bus 1 to 2 is %.2f MVAr\n",imag(S12))

EELR17 Power Systems Laboratory 3


fprintf(" Active Power flow from bus 2 to 1 is %.2f MW\n",real(S21))
fprintf(" Reactive Power flow from bus 2 to 1 is %.2f
MVAr\n",imag(S21)) fprintf(" Active Power flow from bus 2 to 3 is %.2f
MW\n",real(S23)) fprintf(" Reactive Power flow from bus 2 to 3 is %.2f
MVAr\n",imag(S23)) fprintf(" Active Power flow from bus 3 to 2 is %.2f
MW\n",real(S32)) fprintf(" Reactive Power flow from bus 3 to 2 is %.2f
MVAr\n",imag(S32)) fprintf(" Active Power flow from bus 1 to 3 is %.2f
MW\n",real(S13)) fprintf(" Reactive Power flow from bus 1 to 3 is %.2f
MVAr\n",imag(S13)) fprintf(" Active Power flow from bus 3 to 1 is %.2f
MW\n",real(S31)) fprintf(" Reactive Power flow from bus 3 to 1 is %.2f
MVAr\n\n",imag(S31))

fprintf("c)Active and Reactive power losses in the lines:\n")


fprintf(" i) Active power loss in line(1,2) is %.2f MW\n",real(S21)+real(S12))
fprintf(" ii) Reactive power loss in line(1,2) is %.2f MVAr\n",imag(S12)+imag(S21))
fprintf(" iii)Active power loss in line(2,3) is %.2f MW\n",real(S23)+real(S32))
fprintf(" iv) Reactive power loss in line(2,3) is %.2f MVAr\n",imag(S23)+imag(S32))
fprintf(" v) Active power loss in line(1,3) is %.2f MW\n",real(S31)+real(S13))
fprintf(" vi) Reactive power loss in line(1,3) is %.2f MVAr\n\n",imag(S13)+imag(S31))

fprintf("c)Active and Reactive power supplied by slack bus:\n")


fprintf("Active power supplied by slack bus is %.2f MW\n",real(S12)+real(S13))
fprintf("Reactive power supplied by slack bus is %.2f MVAr\n",-
(imag(S12)+imag(S13)))
MATLAB Output:
Enter the details of the power system
[1 2 .025 .05;
1 3 .0125 .025;
2 3 .0125 .025];
24.0000 -48.0000i -8.0000 +16.0000i -16.0000 +32.0000i
-8.0000 +16.0000i 24.0000 -48.0000i -16.0000 +32.0000i -
16.0000 +32.0000i -16.0000 +32.0000i 32.0000 -64.0000i

Enter the value of Base MVA: 100


Enter the phase angle of voltage of bus 1: 0
Enter the value of voltage of bus 1: 1.025
Enter the magnitude of voltage of bus 2: 1.03
Enter the active power of bus 2: 300
Enter the active power of bus 3: 400
Enter the reactive power of bus 3: 200
Enter the tolerance: 0.0001

EELR17 Power Systems Laboratory 4


Number of Iterations: 4
a)The bus voltages(magnitudes and angles[in deg]):
i) Bus-1: 1.02500<0.000000 V
ii) Bus-2: 1.03000<1.451540 V
iii)Bus-3: 0.97544<-1.416876 V

b)Active and Reactive power flows in lines:


Active Power flow from bus 1 to 2 is -46.62 MW
Reactive Power flow from bus 1 to 2 is 13.74 MVAr
Active Power flow from bus 2 to 1 is 47.18 MW
Reactive Power flow from bus 2 to 1 is -12.61 MVAr
Active Power flow from bus 2 to 3 is 252.82 MW

Reactive Power flow from bus 2 to 3 is 103.42 MVAr


Active Power flow from bus 3 to 2 is -244.03 MW
Reactive Power flow from bus 3 to 2 is -85.83 MVAr
Active Power flow from bus 1 to 3 is 160.88 MW
Reactive Power flow from bus 1 to 3 is 123.98 MVAr
Active Power flow from bus 3 to 1 is -155.97 MW
Reactive Power flow from bus 3 to 1 is -114.17 MVAr

c)Active and Reactive power losses in the lines:


i) Active power loss in line(1,2) is 0.56 MW
ii) Reactive power loss in line(1,2) is 1.12
MVAr iii)Active power loss in line(2,3) is 8.79
MW iv) Reactive power loss in line(2,3) is
17.58 MVAr
v) Active power loss in line(1,3) is 4.91 MW
vi) Reactive power loss in line(1,3) is 9.82
MVAr

d)Active and Reactive power supplied by slack bus:


Active power supplied by slack bus is 114.26 MW
Reactive power supplied by slack bus is -137.72 MVAr

EELR17 Power Systems Laboratory 5


Observations:
The Newton Raphson method is an iterative technique for resolving a collection of nonlinear algebraic equations, much
to the Gauss-Seidel method. Using the available line and bus data, the steady state operational characteristics of a power
system network can be determined via power flow analysis using the Newton-Raphson method. Similar to the Gauss-
Seidel technique of power flow analysis, we must assume a slack bus in the NR approach and classify the remaining
buses as load buses/PQ buses and generator buses/PV buses. The primary benefit of Newton-Raphson is the system-
independent nature of the number of iterations.

Problem 2:

EELR17 Power Systems Laboratory 6


Write a MATLAB Code to analyse the power flow using Decoupled Method for the system shown in Fig. 1. Take base
MVA as 100 MVA. Perform iterations till a tolerance of 𝜀 = 0.0001 is reached. The results should display the
following.
a. the bus voltages (magnitude and angles).
b. active and reactive power flows in the lines.
c. active and reactive power losses in the lines.
d. active and reactive power supplied by the slack bus.

MATLAB Code:

EELR17 Power Systems Laboratory 7


clc;
clear;
%A=[1 2 .025 .05;
% 1 3 .0125 .025;
% 2 3 .0125 .025];
A=input("Enter the details of the power system
\n"); n=max(A(:,2)); size=numel(A(:,1));
Yb=complex(zeros(n)); for q=1:size f=A(q,1);
t=A(q,2); R=A(q,3);
X=A(q,4);
Z=complex(R,X);
Yb(f,t)=-Yb(f,t)-1/Z;
Yb(t,f)=-Yb(t,f)-1/Z;
Yb(f,f)=Yb(f,f)+1/Z;
Yb(t,t)=Yb(t,t)+1/Z;
end disp(Yb)
mod_Yb=abs(Yb);
theta=angle(Yb)
;
Base_MVA=input("Enter the value of Base MVA: ");
%Base_MVA=100;
Delta_1=input("Enter the phase angle of voltage of bus 1: ");
%Delta_1=0;
mod_V1=input("Enter the value of voltage of bus 1: ");
%mod_V1=1.025;
Delta_2=0;
mod_V2=input("Enter the magnitude of voltage of bus 2: ");
%mod_V2=1.03;
P2=input("Enter the active power of bus 2: ");
P2=300/Base_MVA;
mod_V3=1;
Delta_3=0;
P3=input("Enter the active power of bus 3: ");
P3=-400/Base_MVA;
Q3=input("Enter the reactive power of bus 3: ");
Q3=-200/Base_MVA;
delP2=1;
delP3=1;
delQ3=1;
iteration=0
;
e=input("Enter the tolerance: ");
%e=0.0001;
while(abs(delP2)>e || abs(delP3)>e || abs(delQ3)>e)
mod_V=[mod_V1 mod_V2 mod_V3];
D=[Delta_1 Delta_2 Delta_3];
P2cal=0;
P3cal=0;
Q3cal=0;
for x=1:size
P2cal=P2cal+mod_V2*mod_V(1,x)*mod_Yb(2,x)*cos(theta(2,x)+D(1,x)-Delta_2);
P3cal=P3cal+mod_V3*mod_V(1,x)*mod_Yb(3,x)*cos(theta(3,x)+D(1,x)-
Delta_3); Q3cal=Q3cal-

EELR17 Power Systems Laboratory 8


mod_V3*mod_V(1,x)*mod_Yb(3,x)*sin(theta(3,x)+D(1,x)-Delta_3); end
delP2=P2-P2cal; delP3=P3-P3cal; delQ3=Q3-Q3cal;
J=zeros(size);

J(1,1)=mod_V2*(mod_V1*mod_Yb(2,1)*sin(theta(2,1)+Delta_1Delta_2)+mod_V3*mod_Yb(2,3)*sin(the
ta(2,3)+Delta_3-Delta_2));
J(1,2)=mod_V2*mod_V3*mod_Yb(2,3)*sin(Delta_2-theta(2,3)-Delta_3);
J(1,3)=0;
J(2,1)=mod_V2*mod_V3*mod_Yb(3,2)*sin(Delta_3-theta(3,2)-Delta_2);

J(2,2)=mod_V3*(mod_V1*mod_Yb(3,1)*sin(theta(3,1)+Delta_1Delta_3)+mod_V2*mod_Yb(3,2)*sin(the
ta(3,2)+Delta_2-Delta_3));
J(2,3)=0;
J(3,1)=0;
J(3,2)=0;
J(3,3)=mod_V1*mod_Yb(3,1)*sin(Delta_3-Delta_1-
theta(3,1))+mod_V2*mod_Yb(3,2)*sin(Delta_3Delta_2-theta(3,2))+2*mod_V3*mod_Yb(3,3)*sin(-
theta(3,3));
MV=[delP2;delP3;delQ3];
DiffM=inv(J)*MV;

Delta_2=Delta_2+DiffM(1,1);
Delta_3=Delta_3+DiffM(2,1);
mod_V3=mod_V3+DiffM(3,1);
iteration=iteration+1; end
V1=mod_V1*exp(1i*Delta_1);
V2=mod_V2*exp(1i*Delta_2);
V3=mod_V3*exp(1i*Delta_3);

S12=V1*conj(-Yb(1,2)*(V1-V2))*Base_MVA;
S21=V2*conj(-Yb(2,1)*(V2-V1))*Base_MVA;
S23=V2*conj(-Yb(2,3)*(V2-V3))*Base_MVA;
S32=V3*conj(-Yb(3,2)*(V3-V2))*Base_MVA;
S13=V1*conj(-Yb(1,3)*(V1-V3))*Base_MVA;
S31=V3*conj(-Yb(3,1)*(V3-V1))*Base_MVA;

fprintf("Number of Iterations: %.0f\n\n",iteration)

fprintf("a)The bus voltages(magnitudes and angles[in


deg]):\n") fprintf(" i) Bus-1: %.5f<%f
V\n",abs(V1),rad2deg(angle(V1))) fprintf(" ii) Bus-2:
%.5f<%f V\n",abs(V2),rad2deg(angle(V2))) fprintf(" iii)Bus-
3: %.5f<%f V\n\n",abs(V3),rad2deg(angle(V3)))

fprintf("b)Active and Reactive power flows in lines:\n") fprintf("


Active Power flow from bus 1 to 2 is %.2f MW\n",real(S12)) fprintf("
Reactive Power flow from bus 1 to 2 is %.2f MVAr\n",imag(S12))
fprintf(" Active Power flow from bus 2 to 1 is %.2f MW\n",real(S21))
fprintf(" Reactive Power flow from bus 2 to 1 is %.2f
MVAr\n",imag(S21)) fprintf(" Active Power flow from bus 2 to 3 is %.2f
MW\n",real(S23)) fprintf(" Reactive Power flow from bus 2 to 3 is %.2f
MVAr\n",imag(S23)) fprintf(" Active Power flow from bus 3 to 2 is %.2f
MW\n",real(S32)) fprintf(" Reactive Power flow from bus 3 to 2 is %.2f

EELR17 Power Systems Laboratory 9


MVAr\n",imag(S32)) fprintf(" Active Power flow from bus 1 to 3 is %.2f
MW\n",real(S13)) fprintf(" Reactive Power flow from bus 1 to 3 is %.2f
MVAr\n",imag(S13)) fprintf(" Active Power flow from bus 3 to 1 is %.2f
MW\n",real(S31)) fprintf(" Reactive Power flow from bus 3 to 1 is %.2f
MVAr\n\n",imag(S31))

fprintf("c)Active and Reactive power losses in the lines:\n")


fprintf(" i) Active power loss in line(1,2) is %.2f MW\n",real(S21)+real(S12))
fprintf(" ii) Reactive power loss in line(1,2) is %.2f MVAr\n",imag(S12)+imag(S21))
fprintf(" iii)Active power loss in line(2,3) is %.2f MW\n",real(S23)+real(S32))
fprintf(" iv) Reactive power loss in line(2,3) is %.2f MVAr\n",imag(S23)+imag(S32))
fprintf(" v) Active power loss in line(1,3) is %.2f MW\n",real(S31)+real(S13))
fprintf(" vi) Reactive power loss in line(1,3) is %.2f MVAr\n\n",imag(S13)+imag(S31))
fprintf("c)Active and Reactive power supplied by slack bus:\n")
fprintf("Active power supplied by slack bus is %.2f MW\n",real(S12)+real(S13))
fprintf("Reactive power supplied by slack bus is %.2f MVAr\n",-(imag(S12)+imag(S13)))

MATLAB Output:
Enter the details of the power system
[1 2 .025 .05;
1 3 .0125 .025;
2 3 .0125 .025];
24.0000 -48.0000i -8.0000 +16.0000i -16.0000 +32.0000i
-8.0000 +16.0000i 24.0000 -48.0000i -16.0000 +32.0000i -
16.0000 +32.0000i -16.0000 +32.0000i 32.0000 -64.0000i

Enter the value of Base MVA: 100


Enter the phase angle of voltage of bus 1: 0
Enter the value of voltage of bus 1: 1.025
Enter the magnitude of voltage of bus 2: 1.03
Enter the active power of bus 2: 300
Enter the active power of bus 3: 400
Enter the reactive power of bus 3: 200
Enter the tolerance: 0.0001
Number of Iterations: 16

a)The bus voltages(magnitudes and angles[in deg]):


i) Bus-1: 1.02500<0.000000 V
ii) Bus-2: 1.03000<1.451539 V
iii)Bus-3: 0.97544<-1.416848 V

EELR17 Power Systems Laboratory 10


b)Active and Reactive power flows in lines:
Active Power flow from bus 1 to 2 is -46.62 MW
Reactive Power flow from bus 1 to 2 is 13.74 MVAr
Active Power flow from bus 2 to 1 is 47.18 MW
Reactive Power flow from bus 2 to 1 is -12.61 MVAr
Active Power flow from bus 2 to 3 is 252.82 MW

Reactive Power flow from bus 2 to 3 is 103.42 MVAr


Active Power flow from bus 3 to 2 is -244.03 MW
Reactive Power flow from bus 3 to 2 is -85.83 MVAr
Active Power flow from bus 1 to 3 is 160.88 MW
Reactive Power flow from bus 1 to 3 is 123.98 MVAr
Active Power flow from bus 3 to 1 is -155.97 MW
Reactive Power flow from bus 3 to 1 is -114.17 MVAr

c)Active and Reactive power losses in the lines:


i) Active power loss in line(1,2) is 0.56 MW
ii) Reactive power loss in line(1,2) is 1.12
MVAr iii)Active power loss in line(2,3) is 8.79
MW iv) Reactive power loss in line(2,3) is
17.58 MVAr
v) Active power loss in line(1,3) is 4.91 MW
vi) Reactive power loss in line(1,3) is 9.82
MVAr

d)Active and Reactive power supplied by slack bus:


Active power supplied by slack bus is 114.26 MW
Reactive power supplied by slack bus is -137.72 MVAr

Observations:
The load flow analysis decoupled method replaces the Newton-Raphson method. This method and the NR method are
fairly equivalent in terms of calculation. The only difference between all of the formulations is that we substitute zeros
for some parts of the Jacobian matrix due to weak coupling. Power flow analysis can be obtained using this decoupling

EELR17 Power Systems Laboratory 11


method in a remarkably short amount of time. It is more dependable and memory-friendly than the NR approach. It does
more iterations but is ultimately faster than the NR approach.

Problem 3:
Compare the results obtained with that of Gauss-Seidel method. Write the inferences.

Observations:
The output numbers of the NR technique and the decoupled method are extremely similar. However,
compared to the NR method or the GS method, the decoupled approach is much faster. The GS technique is
significantly impacted by the slack bus selection, but the NR method is less vulnerable. The GS approach
requires more iterations to converge than the NR method does.
The NR approach yields data that are more accurate though. In contrast to the NR approach, the size of the
system has no effect on the number of cycles required to converge for the GS method. The decoupled method
is speedier than the NR method while requiring more iterations. The decoupling method uses the least amount
of storage and is the fastest.

EELR17 Power Systems Laboratory 12

You might also like