0% found this document useful (0 votes)
32 views5 pages

Experiment No 8

Uploaded by

smshamima265
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views5 pages

Experiment No 8

Uploaded by

smshamima265
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Experiment No: 08

Study of Load Flow Analysis by Gauss-Seidel Method using MATLAB.


Theory:
The n complex equation that describe the power injected to an n node power system are:
Si = Pi + jQi = ViIi*
n
= ∑ V i Y ik∗V k ∗¿ ¿ k=1,2,3,…………n
k =1
n

=V i Y ii∗V i*+∑ V i Y ik∗V k ∗¿ ¿


k =1
k ≠i
Rearranging the equations we get –
n
Si
Y ii∗V i∗¿ = -∑ V i Y ik∗V k ∗¿ ¿ i=1,2,3……….n
V i k =1
k ≠i
n
1
Therefore, V i = ¿ -∑ V i Y ik∗V k ∗¿ ¿]……………………. (1)
Y ii k =1
k ≠i

Problem: Single line diagram of a system is given below. Using Gauss-Seidel Method
determine the phasor values of the voltage at buses 2 and 3.

Here, y 12=0.05+0.25j; y 13=0.04+0.2j ; y 23=0.03+0.15j

Bus |v| Pg Qg Pl Ql angle

1 1.03 0 0 0 0 0
2 1.02 0.8 0 0.4 0.3 0
3 1 0 0 1 0.8 0

MATLAB CODE:
clc; % clear command window
clear all; % clear Workspace
cd('E:\semester\6 TH SEMESTER\main\fatin\Power System I');
% Change current directory

a=xlsread('EXPNO5_1.xlsx'); % Read data from MS Excel file


[r,c]=size(a); % Size of Matrix a
%-----------To know total bus number---------------
n=max(max(a(:,1)),max(a(:,2)));
Z=zeros(n); % Z has n-by-n matrices with Zero...
% ........values in all elements
q=1;
for p=1:r
Z(a(p,q),a(p,q+1))=a(p,q+2)+i*a(p,q+3); % Z receive the..
%...values from a
Z(a(p,q+1),a(p,q))=Z(a(p,q),a(p,q+1)); % For symmetry
end
for l=1:n
for k=1:n
if(Z(l,k)==0)
Z(l,k)=inf;
end
end
end
y=1./Z; % To get admittance from Impedance
Y=zeros(n); % Y has n-by-n matrices with ZERO...
% ........values in all elements
%--------For Y bus Matrices from y Matrices---------
for l=1:n
for k=1:n
if(l~=k)
Y(l,k)=-y(l,k);
else
for l1=1:n
Y(l,l)=Y(l,l)+y(l,l1);
end
end
end
end

disp(['This Problem is ',num2str(n),' Bus System']);


%For display
disp('The Admittance Matrix is:');
Y

%-------For Load Flow Study by Gauss-Seidel ------------


cd('E:\semester\6 TH SEMISTER\main\RAKIBUL HASAN\Power System
I');
ab=xlsread('EXPNO5_2.xlsx');
[rb,cb]=size(ab);
for lb=1:rb
v(1,ab(lb,1))=ab(lb,2); % Here, v(iteration ,Bus no.)
Pg(ab(lb,1),1)=ab(lb,3);
Qg(ab(lb,1),1)=ab(lb,4);
Pl(ab(lb,1),1)=ab(lb,5);
Ql(ab(lb,1),1)=ab(lb,6);
A(ab(lb,1),1)=ab(lb,7);
V(1,ab(lb,1))=v(1,ab(lb,1))*exp(i*deg2rad(A(ab(lb,1),1)));
end
tol=.000001; % error tolerance level
it=input('Iteration: ');
for d=2:it
I=zeros(1,n);
I1=zeros(1,n);
S=zeros(1,n);
V(d,1)=V(d-1,1); % Slack Bus Voltage 1=fixed
for k=2:n
if(Pg(k) ~=0)
% Generator BUS, So We need To know find I(i)
for k1=1:k-1
I(1,k)=I(1,k)+Y(k,k1)*V(d,k1);
% BUS(1 to k-1 ) has d iteration voltage,
% We use this updated (d) value
end
for k1=k:n
I(1,k)=I(1,k)+Y(k,k1)*V(d-1,k1);
% BUS(k to n ) has not d iteration voltage,
% We use the old(d-1) value
end
S(1,k)=(Pg(k,1)-Pl(k,1))+i*imag(V(d-
1,k)*conj(I(1,k)));
% Generator BUS S=P+jQ;P=Pg-Pl and Q=Im(S=V*conj(I))

elseif((Pg(k)==0) && (Qg(k)==0)) % Load BUS


S(1,k)=(Pg(k,1)-Pl(k,1))+i*(Qg(k,1)-Ql(k,1));
% Load BUS S=P+jQ;P=Pg-Pl and Q=Qg-Ql
end
%___________________________________________________
% We know Gauss-Seidel Voltage Equation
% V(i) = (Conjugate of (S(i)/V(i))-I1)/Y(ii)
% where, I1=SUM(k=1 to n but k is not i) Y(ik)V(k)

for k1=1:k-1
I1(1,k)=I1(1,k)+Y(k,k1)*V(d,k1);
% BUS(1 to k-1 ) has d iteration voltage,
% We use this updated (d) value
end
for k1=k+1:n
I1(1,k)=I1(1,k)+Y(k,k1)*V(d-1,k1);
% BUS(k+1 to n ) has not d iteration voltage,
% We use the old(d-1) value,here k1 is not k
end
V(d,k)=(conj(S(1,k)/V(d-1,k))-I1(1,k))/Y(k,k);
% Gauss-Seidel Iterative Voltage
if(Pg(k) ~=0)
V(d,k)=V(1,k)*exp(i*angle(V(d,k)));
% For Generator BUS, Magnitude of V is Fixed
% only angle is iterated
end
end
%_____________For Error Checking_______
noerror=1; % Let, initially no error
for k=2:n
if(Pg(k) ~=0)
% For gen, check (|angle difference|<tol)
noerror=noerror && ((abs(rad2deg(angle(V(d,k))-
angle(V(d-1,k)))))<tol);
elseif((Pg(k)==0) && (Qg(k)==0))
% For load, check (|magnitude difference|<tol)
% and (|angle difference|<tol)
noerror=noerror && ((abs(abs(V(d,k))-abs(V(d-
1,k))))<tol) && ((abs(rad2deg(angle(V(d,k))-angle(V(d-
1,k)))))<tol);
end
end
% Here, if all above difference < tol; noerror=1
% program enter into following if condition and
% iteration break. Otherwise iteration continues
if (noerror)
break;
end
end
%_____For Showing Output____
for k=1:n
disp(['Voltage of BUS ',num2str(k),': ',
num2str(abs(V(d,k))),' Angle= ',
num2str(rad2deg(angle(V(d,k))))]);
end

Excel File:
EXPNO5_1.xlsx
BUS 1 BUS 2 R X
1 2 0.05 0.25
1 3 0.04 0.2
2 3 0.03 0.15

EXPNO5_2.xlsx

BUS |V| Pg Qg Pl Ql Angle


1 1.03 0 0 0 0 0
2 1.02 0.8 0 0.4 0.3 0
3 1 0 0 1 0.8 0

OUTPUT:
This Problem is 3 Bus System
The Admittance Matrix is:

Y =

1.7308 - 8.6538i -0.7692 + 3.8462i -0.9615 + 4.8077i


-0.7692 + 3.8462i 2.0513 -10.2564i -1.2821 + 6.4103i
-0.9615 + 4.8077i -1.2821 + 6.4103i 2.2436 -11.2179i

Iteration: 500
Voltage of BUS 1: 1.03 Angle= 0
Voltage of BUS 2: 1.02 Angle= -1.4954
Voltage of BUS 3: 0.929 Angle= -5.1907
Conclusion:
We can analysis load flow study analysis by Gauss-Seidel using MATLAB very easily.

You might also like