Source Code:
disp('**** Computation of power system components in per unit****');
%Generator:
disp('Reactance of Generator');
gm=input('Enter the MVA value:');
gk=input('Enter the KV value:');
gx=input('Enter the generator reactance:');
%Transformer 1(T1):
disp('Reactance for Transformer 1');
t1m=input('Enter the MVA value of T1:');
t1kp=input('Enter the KV value(HT)of T1:');
t1ks=input('Enter the KV value (LT) of T1:');
t1x=input('Enter the T1 reactance value:');
%Transmission Line:
disp('Transmission Line:');
tr1=input('Enter the transmission line length:');
trx=input('Enter the transmission line reactance (ohm/km):');
%Transformer 2(T2):
disp('Reactance for Transformer 2');
t2m=input('Enter the MVA value of T2:');
t2kp=input('Enter the KV value(LT)of T2:');
t2ks=input('Enter the KV value (HT) of T2:');
t2x=input('Enter the T2 reactance value:');
%Motor 1:
m1m=input('Enter the M1 MVA value:');
m1k=input('Enter the M1 KV value:');
m1x=input('Enter the M1 reactance value:');
%Motor 2:
m2m=input('Enter the M2 MVA value:');
m2k=input('Enter the M2 KV value:');
m2x=input('Enter the M2 reactance value:');
%Base Values:
disp('Base values');
bm=input('Enter the base MVA:');
bk=input('Enter the base KV:');
% per unit Calculation
t1new=(t1x*((t1kp/bk)^2)*(bm/t1m));
tr=tr1*trx;
bkr=bk*(t1ks/t1kp);
bz=((bkr)^2)/bm;
trnew=tr/bz;
bkrl=bkr*(t2ks/(1.732*t2kp));
t2new=t2x*((t2ks/bkrl)^2)*(bm/(3*t2m));
m1new=m1x*((m1k/bkrl)^2)*(bm/m1m);
m2new=m2x*((m2k/bkrl)^2)*(bm/m2m);
%Output in p.u
disp('Reactance of Generator');
gx
disp('Reactance of Transformer 1');
t1new
disp('Reactance of Transmission Line');
trnew
disp('Reactance of Transformer 2');
t2new
disp('Reactance of Motor 1');
m1new
disp('Reactance of Motor 2');
m2new