You are on page 1of 6

MATLAB PROGRAM:-

1.Code for finding the base impedance value and the PU


value for the transmission system.
prompt='enter the base kilo values in the first bus bar
side';
bvoltage = input(prompt);
prompt='enter the base MVA in the first bus bar side';
bMVA= input(prompt);
bimp= (bvoltage*bvoltage)/bMVA;
prompt='enter the no of generator on the first bus bar
side';
N= input(prompt);
for i=1:N;
prompt='enter the actual impedance of the generator';
g(i)= input(prompt);
G(i)= g(i)/bimp;
display(G(i));
end
prompt='enter the number of transformer in first bus bar
side ';
M= input(prompt);
for i=1:M;
prompt='enter the pri volt of the transformer';
privoltage=input(prompt);
prompt='enter the sec volt of the transformer';
secvoltage=input(prompt);
prompt='enter the actual impedance: 1-primary, 0-
secondary';
aimpedance=input(prompt);
if(aimpedance==1)
prompt='Enter the actual imp of primary
side';
actual_impedance=input(prompt);
t(i)=actual_impedance/bimp;
display(t(i));
else
prompt='Enter the actual imp of secondary
side';
bnewvoltage=(secvoltage*bvoltage)/privoltage;
actual_impedance=input(prompt);

t(i)=(actual_impedance*bMVA)/((bnewvoltage)*(bnewvoltage)
);
display(t(i));
end

end
bnewvoltage1=(secvoltage*bvoltage)/privoltage;
prompt='transmission line actual impedance';
Ztl=input(prompt);
Ztl_in_pu=(Ztl*bMVA)/((bnewvoltage1)*(bnewvoltage1));
display(Ztl_in_pu);
%
prompt='enter the no of generator on the second bus bar';
k= input(prompt);
for i=1:k;
prompt='enter the actual impedance of the generator';
g2(i)= input(prompt);
G2(i)= (g2(i)*bMVA)/((bnewvoltage1)*(bnewvoltage1));
display(G2(i));
end

Here in this code I have defined some variables.


bvoltage=Base voltage on the first bus bar side.
bMVA= Base MVA value for the given transmission line
which is equal all the transmission line part.
bimp=Base impedance value.
N=no of the generator on the first bus bar side.
g=actual impedance of the generator,
G=pu value of the generator in the first bus bar side.
M is the number of the transformer on the first bus bar
side.
t=PU value of transformer.
K is the number of the generator in the second bus bar side.
G2= pu value of the transformer in second bus bar side,
2.Code for finding new impedance value if we connect new
branch between one existing bus and ground.
prompt='Enter number of buses';
N=input(prompt);
Znew1=zeros(N);
for i=1:N
for j=1:N
prompt='Enter impedance value';
Z(i,j)=input(prompt);
end
end
prompt='Enter new impedance value to be added';
Znew=input(prompt);
for i=1:N
Z(i,N+1)=Z(i,N);
Z(N+1,i)=Z(N,i);
end
Z(N+1,N+1)=Znew + Z(N,N);

for i=1:N
for j=1:N
Znew1(i,j)=Z(i,j)-
((Z(i,N+1)*Z(N+1,j))/Z(N+1,N+1))
end
end

where N is the number of the bus for the given impedance.


Znew is the impedance value.
Znew1 is the new admittance matrix.
Inference:-
1.Base MVA value will be same for all the buses, base kv value will
be changed based on the transformer rating and there is no unit for
the per-unit system.
2.After adding the new branch to the given transmission system,
the size of the given impedance matrix will be same as old matrix.

Result:-
1.If I take base kv=11;
And base MVA=100;
So calculated base imp will be=1.21
And generator impedance value in first bus bars side 15 ohms
then result would be
2.For the given impedance matrix if I add one branch
then results are-
And and

And the matlab result are-

Hence both results are same.

You might also like