You are on page 1of 8

%program to find voltages and currents in sending or receving end of a line

clear all;
clc;
disp('MENU');
disp('1.MEDIUM LINE');
disp('2.LONG LINE');
c=input('enter your choice:');
if c==1
disp('1. AT SENDING END');
disp('2.AT RECEVING END');
ch=input('enter your choice');
if ch==1
r1=input('enter the resistance value in ohms:');
xl1=input('enter your inductance value in henry:');
g1=input('enter the conductance value:');
y1=input('enter the admittance value in siemens:');
dis=input('enter the distance of the line:');
v1=input('enter the receving end voltage in volts:');
p1=input('enter the receving end power in watts:');
pf1=input('enter the receving end power factor:');
r=r1*dis;
xl=xl1*dis;
g=g1*dis;
y2=y1*dis;
z=complex(r,xl);
y=complex(g,y2);
vr=v1/(3^(1/2));
ir=p1/(3*vr*pf1);
ang1=acos(0.9);
[a,b]=pol2cart(-ang1,ir);
irv=complex(a,b);
abcd11=(1+((z*y)/2));
abcd22=abcd11;
abcd12=z;
abcd21=y*(1+((z*y)/4));
mat1=[abcd11,abcd12;abcd21,abcd22];
mat2=[vr;irv];
mat3=mat1*mat2;
ss=mat3(1);
disp(' sending end voltage:');
disp(ss);
[a1 b1]=cart2pol(real(ss),imag(ss));
ss1=mat3(2);
disp('sending end current:');
disp(ss1);
[a2 b2]=cart2pol(real(ss1),imag(ss1));
pis=a1-a2;
sang=cos(pis);
reg=((b1-vr)/vr)*100;
disp('% regulation :');
disp(reg);
eff=(p1/(3*b1*b2*sang));
disp('% efficiency :');
disp(eff);
else
end
end
OUTPUT:
enter your choice:1
1. AT SENDING END
2.AT RECEVING END
enter your choice1
enter the resistance value in ohms:.124
enter your inductance value in henry:.497
enter the conductance value:0
enter the admittance value in siemens:3.30*10^-6
enter the distance of the line:160
enter the receving end voltage in volts:220*10^3
enter the receving end power in watts:40*10^6
enter the receving end power factor:.9

sending end voltage:


1.3048e+005 +
8004i

sending end current:


102.86 + 17.138i

% regulation :
2.9164

% efficiency :
0.98344
%program to find voltages and currents in sending or receving end of a line
clear all;
clc;
disp('MENU');
disp('1.MEDIUM LINE');
disp('2.LONG LINE');
c=input('enter your choice:');
if c==1
disp('1. AT SENDING END');
disp('2.AT RECEVING END');
ch=input('enter your choice');
switch lower(ch)
case 1
r1=input('enter the resistance value in ohms:');
xl1=input('enter your inductance value in henry:');
g1=input('enter the conductance value:');
y1=input('enter the admittance value in siemens:');
dis=input('enter the distance of the line:');
v1=input('enter the receving end voltage in volts:');
p1=input('enter the receving end power in watts:');
pf1=input('enter the receving end power factor:');
r=r1*dis;
xl=xl1*dis;
g=g1*dis;
y2=y1*dis;
z=complex(r,xl);
y=complex(g,y2);
vr=v1/(3^(1/2));
ir=p1/(3*vr*pf1);
ang1=acos(pf1);
[a,b]=pol2cart(-ang1,ir);
irv=complex(a,b);
abcd11=(1+((z*y)/2));
abcd22=abcd11;
abcd12=z;
abcd21=y*(1+((z*y)/4));
mat1=[abcd11,abcd12;abcd21,abcd22];
mat2=[vr;irv];
mat3=mat1*mat2;
ss=mat3(1);
disp(' sending end voltage:');
disp(ss);
[a1 b1]=cart2pol(real(ss),imag(ss));
ss1=mat3(2);
disp('sending end current:');
disp(ss1);
[a2 b2]=cart2pol(real(ss1),imag(ss1));
pis=a1-a2;
sang=cos(pis);
reg=((b1-vr)/vr)*100;
disp('% regulation :');
disp(reg);
eff=(p1/(3*b1*b2*sang))*100;
disp('% efficiency :');
disp(eff);
case 2
r1=input('enter the resistance value in ohms:');
xl1=input('enter your inductance value in henry:');
g1=input('enter the conductance value:');
y1=input('enter the admittance value in siemens:');
dis=input('enter the distance of the line:');
v1=input('enter the sending end voltage in volts:');
p1=input('enter the sending end power in watts:');
pf1=input('enter the sending end power factor:');
r=r1*dis;
xl=xl1*dis;
g=g1*dis;
y2=y1*dis;
z=complex(r,xl);
y=complex(g,y2);
vr=v1/(3^(1/2));
ir=p1/(3*vr*pf1);
ang1=acos(pf1);
[a,b]=pol2cart(-ang1,ir);
irv=complex(a,b);
abcd11=(1+((z*y)/2));
abcd22=abcd11;
abcd12=z;
abcd21=y*(1+((z*y)/4));
mat1=[abcd22,-abcd12;-abcd21,abcd11];
mat2=[vr;irv];
mat3=mat1*mat2;
ss=mat3(1);
disp('receving end voltage:');
disp(ss);
[a1 b1]=cart2pol(real(ss),imag(ss));
ss1=mat3(2);
disp('receving end current:');
disp(ss1);
[a2 b2]=cart2pol(real(ss1),imag(ss1));
pis=a2-a1;
sang=cos(pis);
reg=((vr-b1)/b1)*100;
disp('% regulation :');
disp(reg);
eff=((3*b1*b2*sang)/p1)*100;
disp('% efficiency :');
disp(eff);
end
else
r1=input('enter the resistance value in ohms:');
l11=input('enter your inductance value in henry:');
g1=input('enter the conductance value:');
c1=input('enter the admittance value in siemens:');
dis=input('enter the distance of the line:');
v1=input('enter the receving end voltage in volts:');
p1=input('enter the receving end power in watts:');
pf1=input('enter the receving end power factor:');
r=r1*dis;
xl=l11*2*pi*50*dis;
g=g1*dis;
c2=c1*2*pi*50*dis;
z=complex(r,xl);
y=complex(g,c2);
vr=v1/(3^(1/2));
ir=p1/(3*vr*pf1);
ang1=acos(pf1);
[a,b]=pol2cart(-ang1,ir);
irv=complex(a,b);
pg=(z*y)^(1/2);
alpha=real(pg);
bheta=imag(pg);
zc=(z/y)^(1/2);
se=complex(alpha,bheta);
se1=cosh(se);
abcd11=se1;
abcd22=abcd11;
se2=sinh(se);
abcd12=zc*se2;
abcd21=se2/zc;
mat1=[abcd11,abcd12;abcd21,abcd22];
mat2=[vr;irv];
mat3=mat1*mat2;
ss=mat3(1);
disp(' sending end voltage:');
disp(ss);
[a1 b1]=cart2pol(real(ss),imag(ss));
ss1=mat3(2);
disp('sending end current:');
disp(ss1);
[a2 b2]=cart2pol(real(ss1),imag(ss1));
pis=a1-a2;
sang=cos(pis);
eff=(p1/(3*b1*b2*sang))*100;
disp('% efficiency :');
disp(eff);
end
OUTPUT:

MENU
1.MEDIUM LINE
2.LONG LINE
enter your choice:1
1. AT SENDING END
2.AT RECEVING END
enter your choice1
enter the resistance value in ohms:.124
enter your inductance value in henry:.497
enter the conductance value:0
enter the admittance value in siemens:3.30*10^-6
enter the distance of the line:160
enter the receving end voltage in volts:220*10^3
enter the receving end power in watts:40*10^6
enter the receving end power factor:.9

sending end voltage:


1.3048e+005 +8.0040e+003i

sending end current:


1.0286e+002 +1.7138e+001i

% regulation :
2.9164

% efficiency :
98.3437

MENU
1.MEDIUM LINE
2.LONG LINE
enter your choice:1
1. AT SENDING END
2.AT RECEVING END
enter your choice2
enter the resistance value in ohms:.03
enter your inductance value in henry:.4
enter the conductance value:0
enter the admittance value in siemens:4.0*10^-6
enter the distance of the line:200
enter the sending end voltage in volts:350*10^3
enter the sending end power in watts:407*10^6
enter the sending end power factor:1

receving end voltage:


1.9158e+005 -5.3225e+004i

receving end current:


6.5009e+002 -1.5746e+002i

% regulation :
1.6287

% efficiency :
97.9776
>>

MENU
1.MEDIUM LINE
2.LONG LINE
enter your choice:2
enter the resistance value in ohms:.032
enter your inductance value in henry:1.06*10^-3
enter the conductance value:0
enter the admittance value in siemens:.011*10^-6
enter the distance of the line:250
enter the receving end voltage in volts:400*10^3
enter the receving end power in watts:640*10^6
enter the receving end power factor:.8

sending end voltage:


2.8689e+005 +7.1373e+004i

sending end current:


8.9287e+002 -4.6776e+002i

% efficiency :
95.7619
>>

You might also like