0% found this document useful (0 votes)
14 views1 page

Document From Manasa

The document contains MATLAB code for constructing a bus admittance matrix from given line data. It initializes parameters such as resistance, reactance, and tap settings, and then computes the off-diagonal and diagonal elements of the admittance matrix. The final output is the bus admittance matrix 'ybus'.

Uploaded by

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

Document From Manasa

The document contains MATLAB code for constructing a bus admittance matrix from given line data. It initializes parameters such as resistance, reactance, and tap settings, and then computes the off-diagonal and diagonal elements of the admittance matrix. The final output is the bus admittance matrix 'ybus'.

Uploaded by

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

1/6/25 3:24 PM C:\Users\EEE\Documents\MATLAB\newybus.

m 1 of 1

%bus admittance matrix


clear;
linedata=[1 3 0 0.0125 0 0.8;
3 4 0 0.2 0 1;
3 4 0 0.25 0 1;
4 2 0 0.16 0 1.25];
lp=linedata(:,1); %from bus no....
lq=linedata(:,2); %to bus no.....
r=linedata(:,3); %resistance,R.....
x=linedata(:,4); %reactance,X.....
ycp=linedata(:,5); %ground admittance, B/2..
a=linedata(:,6); %tapsetting value.....
z=r+1i*x; %Z matrix......
Y=1./z; %to get inverse of each element...
y=1i*ycp; %make B imaginary.....
nbus=max(max(lp),max(lq)); %no. of buses....
nline=length(lp); %no. of branches
ybus=zeros(nbus,nbus); %initialise ybus
%formation of off diagonal elements.......
for k=1:nline
ybus(lp(k),lq(k))=ybus(lp(k),lq(k))-Y(k)/a(k);
ybus(lq(k),lp(k))=ybus(lp(k),lq(k));
end
%formation of diagonal elements....
for m=1:nbus
for n=1:nline
if lp(n)==m
ybus(m,m)=ybus(m,m)+Y(n)/a(n)^2+y(n);
elseif lq(n)==m
bus(m,m)=ybus(m,m)+Y(n)+y(n);
end
end
end
ybus

You might also like