PROGRAM:
Determination Zbus for the network shown in the figure where the impedances labelled form bus(1) through bus(6) are shown in p.u. Preserve all buses.
Theoretical Calculation: MATLAB Program : clc; clear all; nbus=input('Enter no. of buses excluding ref
bus :'); zbus=zeros(nbus,nbus); fprintf('case number:enter 1 for ref to
new; 2 for ext to new; 3 for 2 ext nodes; 4 for ext to ref;5 go to next'); while(1)
m=input('case :'); s=m; switch(s);
case{1} zb=input('Enter the zbus value : '); zbus=zb;
case{2} n=input('Enter the 2nd bus no : '); zb=input('Enter the reactance value : ');
for i=1:n if i==n
zbus(n,n)=zbus(n-1,n-1)+zb;
else zbus(i,n)=zbus(i,n-1); zbus(n,i)=zbus(n-1,i); end end
case{3} n=input('Enter the existing bus number 1 :
');
l=input('Enter the existing bus number 2 :
');
zb=input('Enter the reactance value : '); n=n+1; for i=1:n if i==n
zbus(n,n)=zbus(l,l)+zb+zbus(n-1,n-1)-(2*zbus(l,n-1)); zbus(n,n); else
zbus(i,n)=zbus(i,n-1)-zbus(i,l); zbus(i,n); zbus(n,i)=zbus(i,n); end end for i=1:nbus for j=1:nbus if
i==j zbus(i,j)=zbus(i,j)-(zbus(i,n)*zbus(n,j)/zbus(n,n));
zbus(j,i)=zbus(i,j); zbus(i,j)=zbus(j,i); else
zbus(i,j)=zbus(i,j)-(zbus(i,n)*zbus(n,j)/zbus(n,n)); end end end zbus(5,:)=[]; zbus(:,5)=[];
case{4} n=input('Enter the bus number : '); zb=input('Enter reactance value : ');
n=n+1; for i=1:n if i==n zbus(n,n)=zbus(n-1,n-1)+zb; else zbus(i,n)=zbus(i,n-1); zbus(n,i)=zbus(n-1,i); end end for i=1:n for j=1:n if
i==j
zbus(i,j)=zbus(i,j)-(zbus(i,n)*zbus(n,j)/zbus(n,n)); zbus(j,i)=zbus(i,j); zbus(i,j)=zbus(j,i); else
zbus(i,j)=zbus(i,j)-(zbus(i,n)*zbus(n,j)/zbus(n,n)); end end end zbus(4,:)=[]; zbus(:,4)=[];
case{5} disp('end the program'); disp(zbus); break end end MATLAB Output: |
YouTube Video of My Channel on the Problem you can use this also
( If you have any problem in doing this you can comment below , I will help as soon as possible)
0 Comments