Code covered by the BSD License  

Highlights from
z bus system

z bus system

by

 

z impedence calculation of power system

zbus.m
clear all;  %CLEARS THE CONTENT OF MEMORY OR WORKSPACE
clc          %CLEARS THE SCREEN
% GETTING INPUT DATA FROM THE PROGRAMMER
disp('          THE INPUT DATAS ARE AS FOLLOWS                ');
nb=input('the number of buses\n');
nl=input('the number of lines\n');
sb=input('the number of starting buses\n');
eb=input('the number of ending buses\n');
sli=input('enter the details of series line impedance\n');
lca=input('enter the detail of line impedance\n');
% EXECUTION STARTS HERE
for m=1:nb
    for n=1:nb
        if m==n||m~=n
            if sli(m,n)==0
            n=n+1;
            else
            y(m,n)=+sli(m,n)^-1+lca(m,n);
            y(n,n)=+sli(m,n)^-1+lca(m,n);
            y(m,n)=-sli(m,n)^-1;
            y(n,m)=y(m,n);
            end
        end
    end
end
% OUTPUT OF Y-BUS
disp('          THE RESULT OF Y BUS MATRIX IS           ');
ybus=y
% OUTPUT OF Z-BUS
zbus=ybus^-1;
disp('          THE RESULT CHECK MATRIX IS           ');
chkmat=zbus*ybus
disp('          THE RESULT OF Z BUS MATRIX IS           ');
zbus=zbus

Contact us