Professional Documents
Culture Documents
Sym Fault
Sym Fault
%Modification of type4
%A new element is added between two old buses
if newbus <= currentbusno & ref~=0
zbus=zbus-1/(value+zbus(from,from)+zbus(to,to)2*zbus(from,to))*((zbus(:,from)-zbus(:,to))*((zbus(from,:)-zbus(to,:))));
continue
end
end
disp('[Zbus]:')
disp(zbus)
%Calculation of symmetrical fault bus voltages and line currents
zf=input('Enter the fault impedance:');
vf=1+0j
ter=1;
for i=1:nbus
fc(i)=(vf/(zbus(i,i)+zf));
end
fc
while ter==1
bn=input('Enter fault bus number:');
bv(bn)=zf*fc(bn);
for i=1:nbus
if i~=bn
bv(i)=vf-(zbus(i,bn)*fc(bn));
end
end
bv
from=z(:,2);
to=z(:,3);
nlength=length(from);
for i=1:nlength
if to(i)==0
linech(from(i))=((vf-bv(from(i)))/(z(i,4)));
end
if to(i)~=0
linec(from(i),to(i))=((bv(from(i))-bv(to(i)))/(z(i,4)));
end
end
for i=1:nlength
if to(i)==0
fprintf('line current %d - %d',from(i),to(i));
linech(from(i))
end
end
for i=1:nlength
if to(i)~=0
fprintf('line current %d - %d',from(i),to(i));
linec(from(i),to(i))
end
end
fprintf('\n if you want fault at various bus yes=1,no=0');
ter=input('');
end