0% found this document useful (0 votes)
64 views

Lab-01 Formation of Y-Bus: Date-21/07/2014 Programme Code

The document describes a MATLAB code that calculates the bus admittance matrix (Y-bus) for a power network. It takes in the line data including the from and to bus numbers, resistance, reactance, and charging admittance for each line. It then constructs the Y-bus matrix with the appropriate admittance values based on the line data. The code is then tested on a 4 bus sample network and the resulting Y-bus matrix is displayed.

Uploaded by

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

Lab-01 Formation of Y-Bus: Date-21/07/2014 Programme Code

The document describes a MATLAB code that calculates the bus admittance matrix (Y-bus) for a power network. It takes in the line data including the from and to bus numbers, resistance, reactance, and charging admittance for each line. It then constructs the Y-bus matrix with the appropriate admittance values based on the line data. The code is then tested on a 4 bus sample network and the resulting Y-bus matrix is displayed.

Uploaded by

Gaurav Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab-01

Formation of Y-bus
Date-21/07/2014

Programme code:
clc
clear all
nbranch=input('Enter total no. of lines in network');
disp('Enter line data')
for p=1:1:nbranch
fb=input('From bus no. :');
tb=input('To bus no. :');
r=input('Resistance of line =');
x=input('Reactance of line =');
B=input('Line Charging Admittance"b/2"=');
T=input('Tap=');
z = r + 1i*x;
y = 1./z;
Ldata(p,:)=[fb tb r x B T y];
end
fb = Ldata(:,1);
tb = Ldata(:,2);
r = Ldata(:,3);
x = Ldata(:,4);
b = Ldata(:,5);
a = Ldata(:,6);
y = Ldata(:,7);
b = 1i*b;
nbus = max(max(fb),max(tb));
Y = zeros(nbus,nbus);
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
for m =1:nbus
for n =1:nbranch
if fb(n) == m
Y(m,m) = Y(m,m) + y(n) + b(n);
elseif tb(n) == m
Y(m,m) = Y(m,m) + y(n) + b(n); end
end
end

Data :

enter total no. of lines in network 4


enter line data
from bus no. :1
to bus no. :2
resistance of line =0.01008
reactance of line =0.0504
line charging admittance"b/2"=0.05125
tap=0
from bus no. :1
to bus no. :3
resistance of line =0.00744
reactance of line =0.0372
line charging admittance"b/2"=0.03875
tap=0
from bus no. :2
to bus no. :4
resistance of line =0.00744
reactance of line =0.0372
line charging admittance"b/2"=0.03875
tap=0
from bus no. :3
to bus no. :4
resistance of line =0.01272
reactance of line =0.0636
line charging admittance"b/2"=0.06375
tap=0
>> Y

Result:

Y=
8.9852 -44.8360i -3.8156 +19.0781i -5.1696 +25.8478i
0
-3.8156 +19.0781i 8.9852 -44.8360i
0
-5.1696 +25.8478i
-5.1696 +25.8478i
0
8.1933 -40.8638i -3.0237 +15.1185i
0
-5.1696 +25.8478i -3.0237 +15.1185i 8.1933 -40.8638i
>>

You might also like