Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Lab report: Construction of Y-BUS matrix using 6 bus.

Figure: Y-bus construction using 6 bus

Input Data

From Bus To Bus Impedance,z

1 2 0.4j

1 5 0.7j

2 1 0.4j

2 3 0.3j

3 2 0.3j

3 4 0.2j
4 3 0.2j

4 5 0.7j

5 1 0.7j

5 4 0.7j

5 6 0.08j

6 5 0.08j

Ground reactor

From Bus To Ground Impedance,z Admittance, Y

1 0 1.0j 1

2 0 0.8j 1.25

3 0 0.2j 5

4 0 0.5j 2

5 0 0 0

6 0 0 0

Code

clc;clear all;close all;


display('----------Ybus formation code--------');
nbranch=input('enter the number of branches in system = ');
display('enter line data');
for n=1:1:nbranch
fb=input('enter from bus = ');
tb=input('enter to bus = ');
x=input('enter value of reactance = ');
z=i*x;
y=1./z;
Ldata(n,:)=[fb tb x y]
end
fb=Ldata(:,1)
tb=Ldata(:,2)
x=Ldata(:,3)
y=Ldata(:,4)
nbus=max(max(fb),max(tb))
Y=zeros(nbus,nbus)
for k=1:nbus
bs=input('enter the bus at which ground reactor is linked = ');
x0=input('enter value of ground reactor = ');
if x0~=0
y0=1./(i*x0)
else
y0=0
end
Yreact(k,:)=[bs y0]
end
bs=Yreact(:,1)
y0=Yreact(:,2)
% off diagonal element
for k=1:nbranch
Y(fb(k),tb(k))=Y(fb(k),tb(k))-y(k)
Y(tb(k),fb(k))=Y(fb(k),tb(k))
end
% diagonal element
for m=1:nbus
for n=1:nbranch
if fb(n)==m
Y(m,m)=Y(m,m)+y(n)
elseif tb(n)==m
Y(m,m)=Y(m,m)+y(n)
end
end
end
for k=1:nbus
Y(k,k)=Y(k,k)+y0(k)
end
Yb=Y
Output:

Conclusion: Y-bus is used for load flow analysis. After this


experiment, now we can construct y-bus matrix to calculate load flow
analysis.

You might also like