summaryrefslogtreecommitdiff
path: root/503
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:38:01 +0530
committerprashantsinalkar2017-10-10 12:38:01 +0530
commitf35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch)
treeeb72842d800ac1233e9d890e020eac5fd41b0b1b /503
parent7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff)
downloadScilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip
updated the code
Diffstat (limited to '503')
-rwxr-xr-x503/CH10/EX10.6/ch10_6.sci99
-rwxr-xr-x503/CH12/EX12.2/ch12_2.sci18
-rwxr-xr-x503/CH5/EX5.11/ch5_11.sci41
-rwxr-xr-x503/CH5/EX5.14/ch5_14.sci62
-rwxr-xr-x503/CH5/EX5.18/ch5_18.sci40
-rwxr-xr-x503/CH5/EX5.4/ch5_4.sci35
-rwxr-xr-x503/CH7/EX7.54/ch7_54.sci40
-rwxr-xr-x503/CH8/EX8.18/ch8_18.sci30
-rwxr-xr-x503/CH8/EX8.31/ch8_31.sci55
-rwxr-xr-x503/CH8/EX8.42/ch8_42.sci74
-rwxr-xr-x503/CH9/EX9.2/ch9_2.sci68
11 files changed, 288 insertions, 274 deletions
diff --git a/503/CH10/EX10.6/ch10_6.sci b/503/CH10/EX10.6/ch10_6.sci
index 73c95442f..0b5bfa7df 100755
--- a/503/CH10/EX10.6/ch10_6.sci
+++ b/503/CH10/EX10.6/ch10_6.sci
@@ -1,49 +1,50 @@
-//to calculate starting torque and atarting current,motor performance
-
-clc;
-V_a=110*complex(cosd(90),sind(90));
-V_m=220*complex(cosd(0),sind(0));
-R_1=3;
-R_2=2.6;
-X_1=2.7;
-X_2=2.7;
-X=110;
-V_f=(1/2)*(V_m-imult(V_a));
-V_b=(1/2)*(V_m+imult(V_a));
-Z_f=(complex(0,X)*complex(R_2,X_2))/(complex(0,X)+complex(R_2,X_2));
-Z_b=Z_f;
-Z_ftot=complex(R_1,X_1)+Z_f;
-Z_btot=complex(R_1,X_1)+Z_b;
-I_f=V_f/Z_ftot;
-I_b=V_b/Z_btot;
-T_s=(2/157)*real(Z_f)*(abs(I_f)^2-abs(I_b)^2);disp(T_s,'starting torque(Nm)');
-I_m=I_f+I_b;
-I_a=imult(I_f-I_b);disp(abs(I_a),'starting current(A)');
-s=0.04;
-
-Z_f=(complex(0,X)*complex(R_2/s,X_2))/(complex(0,X)+complex(R_2/s,X_2));
-Z_b=(complex(0,X)*complex(R_2/(2-s),X_2))/(complex(0,X)+complex(R_2/(2-s),X_2));
-Z_ftot=complex(R_1,X_1)+Z_f;
-Z_btot=complex(R_1,X_1)+Z_b;
-I_f=V_f/Z_ftot;
-I_b=V_b/Z_btot;
-w_s=157.1;
-T_s=(2/157.1)*(abs(I_f)^2*real(Z_f)-abs(I_b)^2*real(Z_b));disp(T_s,'starting torque(Nm)');
-I_m=I_f+I_b;m=atand(imag(I_m)/real(I_m));
-I_a=imult(I_f-I_b);a=atand(imag(I_a)/real(I_a));
-P_m=w_s*(1-s)*T_s;
-P_L=200;
-P_out=P_m-P_L;
-P_min=V*abs(I_m)*cosd(m);
-P_ain=V*abs(I_a)*cosd(a);
-P_in=P_min+P_ain;
-n=P_out/P_in;
-disp(n,'efficiency');
-
-r=Z_ftot/Z_btot; //r=V_mf/V_bf
-//V_mf+V_bf=220
-V_mf=220/(1+r);
-V_mb=220-V_mf;
-V_a=imult(V_mf-V_mb);
-disp(abs(V_a),'V_a(V)');
-
+//to calculate starting torque and starting current,motor performance
+
+clc;
+clear
+ V = 220;
+V_a=110*complex(cosd(90),sind(90));
+V_m=220*complex(cosd(0),sind(0));
+R_1=3;
+R_2=2.6;
+X_1=2.7;
+X_2=2.7;
+X=110;
+V_f=(1/2)*(V_m-imult(V_a));
+V_b=(1/2)*(V_m+imult(V_a));
+Z_f=(complex(0,X)*complex(R_2,X_2))/(complex(0,X)+complex(R_2,X_2));
+Z_b=Z_f;
+Z_ftot=complex(R_1,X_1)+Z_f;
+Z_btot=complex(R_1,X_1)+Z_b;
+I_f=V_f/Z_ftot;
+I_b=V_b/Z_btot;
+T_s=(2/157)*real(Z_f)*(abs(I_f)^2-abs(I_b)^2);disp(T_s,'starting torque(Nm)');
+I_m=I_f+I_b;
+I_a=imult(I_f-I_b);disp(abs(I_a),'starting current(A)');
+s=0.04;
+
+Z_f=(complex(0,X)*complex(R_2/s,X_2))/(complex(0,X)+complex(R_2/s,X_2));
+Z_b=(complex(0,X)*complex(R_2/(2-s),X_2))/(complex(0,X)+complex(R_2/(2-s),X_2));
+Z_ftot=complex(R_1,X_1)+Z_f;
+Z_btot=complex(R_1,X_1)+Z_b;
+I_f=V_f/Z_ftot;
+I_b=V_b/Z_btot;
+w_s=157.1;
+T_s=(2/157.1)*(abs(I_f)^2*real(Z_f)-abs(I_b)^2*real(Z_b));disp(T_s,'starting torque(Nm)');
+I_m=I_f+I_b;m=atand(imag(I_m)/real(I_m));
+I_a=imult(I_f-I_b);a=atand(imag(I_a)/real(I_a));
+P_m=w_s*(1-s)*T_s;
+P_L=200;
+P_out=P_m-P_L;
+P_min=V*abs(I_m)*cosd(m);
+P_ain=V*abs(I_a)*cosd(a);
+P_in=P_min+P_ain;
+n=P_out/P_in;
+disp(n,'efficiency');
+
+r=Z_ftot/Z_btot; //r=V_mf/V_bf
+//V_mf+V_bf=220
+V_mf=220/(1+r);
+V_mb=220-V_mf;
+V_a=imult(V_mf-V_mb);
+disp(abs(V_a),'V_a(V)'); \ No newline at end of file
diff --git a/503/CH12/EX12.2/ch12_2.sci b/503/CH12/EX12.2/ch12_2.sci
index eec86e1de..36e538981 100755
--- a/503/CH12/EX12.2/ch12_2.sci
+++ b/503/CH12/EX12.2/ch12_2.sci
@@ -1,9 +1,11 @@
-//calculate firing angle value
-
-clc;
-Po=15000;
-Ro=1.5;
-Va=sqrt(Po*Ro);
-a=acosd((Va*2*%pi/(3*sqrt(6)*V))-1);disp(a,'firing angle(deg)');
-Ia=Va/Ro;
+//calculate firing angle value
+
+clc;
+clear
+ V = 220;
+Po=15000;
+Ro=1.5;
+Va=sqrt(Po*Ro);
+a=acosd((Va*2*%pi/(3*sqrt(6)*V))-1);disp(a,'firing angle(deg)');
+Ia=Va/Ro;
Ith=Ia/3;disp(Ith,'avg current through diodes(A)'); \ No newline at end of file
diff --git a/503/CH5/EX5.11/ch5_11.sci b/503/CH5/EX5.11/ch5_11.sci
index 5042cb8f8..6b7603dea 100755
--- a/503/CH5/EX5.11/ch5_11.sci
+++ b/503/CH5/EX5.11/ch5_11.sci
@@ -1,20 +1,21 @@
-// to find fundamental mmf wave,speed and its peak value
-
-clc;
-p=4;
-S=60;
-g=180*p/S;
-ph=3;
-m=S/(p*ph); //slots/pole/phase
-K_b=sind(m*g/2)/(m*sind(g/2)); //breadth factor
-I_L=48;
-I_P=I_L/sqrt(3);
-I_Pmax=I_P*sqrt(2);
-c=24; //conductors
-N_ph=S*c/(ph*2); //turns/phase
-F_m=(4/%pi)*K_b*(N_ph/p)*I_Pmax;
-disp(F_m,'F_m(AT/pole)');
-F_peak=(3/2)*F_m;
-disp(F_peak,'F_peak(AT/pole)');
-n=120*f/P;
-disp(n,'speed(rpm)');
+// to find fundamental mmf wave,speed and its peak value
+
+clc;
+p=4;
+f = 50;
+S=60;
+g=180*p/S;
+ph=3;
+m=S/(p*ph); //slots/pole/phase
+K_b=sind(m*g/2)/(m*sind(g/2)); //breadth factor
+I_L=48;
+I_P=I_L/sqrt(3);
+I_Pmax=I_P*sqrt(2);
+c=24; //conductors
+N_ph=S*c/(ph*2); //turns/phase
+F_m=(4/%pi)*K_b*(N_ph/p)*I_Pmax;
+disp(F_m,'F_m(AT/pole)');
+F_peak=(3/2)*F_m;
+disp(F_peak,'F_peak(AT/pole)');
+n=120*f/p;
+disp(n,'speed(rpm)'); \ No newline at end of file
diff --git a/503/CH5/EX5.14/ch5_14.sci b/503/CH5/EX5.14/ch5_14.sci
index 8d39a413f..177e97ac6 100755
--- a/503/CH5/EX5.14/ch5_14.sci
+++ b/503/CH5/EX5.14/ch5_14.sci
@@ -1,31 +1,33 @@
-//to determine in F2,peak rotor AT, max torque, ele i/p at max torque(motoring mode),open ckt voltage(generating mode)
-
-clc;
-disp('motoring mode');
-K_w=.976;
-N_pole=746;
-p=4;
-I_f=20;
-F2=(4/%pi)*K_w*(N_pole/p)*I_f;
-disp(F2,'F2(AT)');
-B_r=1.6;
-D=.29;
-l=.35;
-T_max=(p/2)*(%pi*D*l/2)*F2*B_r;
-disp(T_max,'T_max');
-f=50;
-w_m=4*%pi*f/p;
-P_in=T_max*w_m;
-disp(P_in,'P_in(W)');
-
-disp('generating mode');
-m=S/(3*p);
-ga=180*p/S;
-K_b=sind(30)/(3*sind(15/2));
-K_w=K_b;
-u_o=4*%pi*10^-7;
-phi_r=((2*D*l/p)*(u_o/g))*F2;
-N_ph=20*p*4/2;
-E_ph=4.44*K_b*f*N_ph*phi_r;
-E_l=sqrt(3)*E_ph;
+//to determine in F2,peak rotor AT, max torque, ele i/p at max torque(motoring mode),open ckt voltage(generating mode)
+
+clc;
+disp('motoring mode');
+K_w=.976;
+N_pole=746;
+p=4;
+I_f=20;
+F2=(4/%pi)*K_w*(N_pole/p)*I_f;
+S = 48;
+g = 1.5 *10^-3;
+disp(F2,'F2(AT)');
+B_r=1.6;
+D=.29;
+l=.35;
+T_max=(p/2)*(%pi*D*l/2)*F2*B_r;
+disp(T_max,'T_max');
+f=50;
+w_m=4*%pi*f/p;
+P_in=T_max*w_m;
+disp(P_in,'P_in(W)');
+
+disp('generating mode');
+m=S/(3*p);
+ga=180*p/S;
+K_b=sind(30)/(3*sind(15/2));
+K_w=K_b;
+u_o=4*%pi*10^-7;
+phi_r=((2*D*l/p)*(u_o/g))*F2;
+N_ph=20*p*4/2;
+E_ph=4.44*K_b*f*N_ph*phi_r;
+E_l=sqrt(3)*E_ph;
disp(E_l,'E_l(V)'); \ No newline at end of file
diff --git a/503/CH5/EX5.18/ch5_18.sci b/503/CH5/EX5.18/ch5_18.sci
index d8e275fcc..022fd02e6 100755
--- a/503/CH5/EX5.18/ch5_18.sci
+++ b/503/CH5/EX5.18/ch5_18.sci
@@ -1,21 +1,21 @@
-//to find no of poles, slip and freq of rotor currents at full load, motor speed at twice of full load
-
-clc;
-n_s=600;
-f=50;
-P=120*f/n_s;
-disp(p,'no of poles');
-n=576;
-s=(n_s-n)/n_s;
-disp(s,'slip');
-f2=s*f;
-n_r=s*n_s;
-disp(n_r,'rotor speed wrt rotating field(rpm)');
-ss=f2*s;
-n=(1-ss)*n_s;
-disp(n,'motor speed(rpm)');
-nn=528;
-s_old=s;
-s_new=(n_s-nn)/n_s;
-fac=s_new/s_old;
+//to find no of poles, slip and freq of rotor currents at full load, motor speed at twice of full load
+
+clc;
+n_s=600;
+f=50;
+P=120*f/n_s;
+disp(P,'no of poles');
+n=576;
+s=(n_s-n)/n_s;
+disp(s,'slip');
+f2=s*f;
+n_r=s*n_s;
+disp(n_r,'rotor speed wrt rotating field(rpm)');
+ss=f2*s;
+n=(1-ss)*n_s;
+disp(n,'motor speed(rpm)');
+nn=528;
+s_old=s;
+s_new=(n_s-nn)/n_s;
+fac=s_new/s_old;
disp(fac,'factor is'); \ No newline at end of file
diff --git a/503/CH5/EX5.4/ch5_4.sci b/503/CH5/EX5.4/ch5_4.sci
index cc120a890..171bb33b9 100755
--- a/503/CH5/EX5.4/ch5_4.sci
+++ b/503/CH5/EX5.4/ch5_4.sci
@@ -1,17 +1,18 @@
-// to calculate flux/pole
-
-clc;
-S=42;
-p=2;
-ph=3;
-m=S/(p*ph); //slots/pole/phase
-g=180*p/S; //slots angle
-K_b=sind(m*g/2)/(m*sind(g/2)); //breadth factor
-cp=17;
-pp=S/p;
-theta_sp=(pp-cp)*g; //short pitch angle
-K_p=cosd(theta_sp/2);
-N_ph=S*2/(ph*p*2); //2 parallel paths
-E_p=2300/sqrt(3);
-phi=E_p/(4.44*K_b*K_p*f*N_ph);
-disp(phi,'flux/pole(Wb)');
+// to calculate flux/pole
+
+clc;
+S=42;
+p=2;
+ f = 50;
+ph=3;
+m=S/(p*ph); //slots/pole/phase
+g=180*p/S; //slots angle
+K_b=sind(m*g/2)/(m*sind(g/2)); //breadth factor
+cp=17;
+pp=S/p;
+theta_sp=(pp-cp)*g; //short pitch angle
+K_p=cosd(theta_sp/2);
+N_ph=S*2/(ph*p*2); //2 parallel paths
+E_p=2300/sqrt(3);
+phi=E_p/(4.44*K_b*K_p*f*N_ph);
+disp(phi,'flux/pole(Wb)'); \ No newline at end of file
diff --git a/503/CH7/EX7.54/ch7_54.sci b/503/CH7/EX7.54/ch7_54.sci
index d7481be22..032738917 100755
--- a/503/CH7/EX7.54/ch7_54.sci
+++ b/503/CH7/EX7.54/ch7_54.sci
@@ -1,20 +1,20 @@
-//to find speed and ratio of mech o/p
-
-clc;
-V=400;
-Ra=.25;
-Ia1=25;
-Ea1=V-Ra*Ia1;
-n1=1200;
-Rr=2.75;
-Ia2=15;
-Ea2=V-(Ra+Rr)*Ia2;
-phi=.7; //phi=(phi(15)/phi(25))
-n2=(Ea2/Ea1)*n1/phi;
-disp(n2,'speed(rpm)');
-
-Po2=Ea2*I2;
-Po1=Ea1*I1;
-disp(Po2/Po1,'ratio of mech o/p');
-Ia=120; //Ia is constant indep of speed
-disp(Ia,'Ia(A)');
+//to find speed and ratio of mech o/p
+
+clc;
+V=400;
+Ra=.25;
+Ia1=25;
+Ea1=V-Ra*Ia1;
+n1=1200;
+Rr=2.75;
+Ia2=15;
+Ea2=V-(Ra+Rr)*Ia2;
+phi=.7; //phi=(phi(15)/phi(25))
+n2=(Ea2/Ea1)*n1/phi;
+disp(n2,'speed(rpm)');
+
+Po2=Ea2*Ia2;
+Po1=Ea1*Ia1;
+disp(Po2/Po1,'ratio of mech o/p');
+Ia=120; //Ia is constant indep of speed
+disp(Ia,'Ia(A)'); \ No newline at end of file
diff --git a/503/CH8/EX8.18/ch8_18.sci b/503/CH8/EX8.18/ch8_18.sci
index e0a0b31c6..1ea82ae77 100755
--- a/503/CH8/EX8.18/ch8_18.sci
+++ b/503/CH8/EX8.18/ch8_18.sci
@@ -1,15 +1,17 @@
-//find the change in the poweer angle;
-
-clc;
-Pe=4000;
-V=400';
-pf=.8;dl=acosd(pf);
-Ia=Pe/(sqrt(3)*V*pf);
-Vt=V/sqrt(3);
-Xs=25;
-Ef=Vt+j*Ia*complex(cosd(-dl),sind(-dl))*Xs;
-a=atand(imag(Ef)/real(Ef));
-
-dl=asind((Pe/3)*Xs/(Vt*abs(Ef)));
-ang=dl+a;
+//find the change in the poweer angle;
+
+clc;
+clear
+j = %i
+Pe=4000;
+V=400';
+pf=.8;dl=acosd(pf);
+Ia=Pe/(sqrt(3)*V*pf);
+Vt=V/sqrt(3);
+Xs=25;
+Ef=Vt+j*Ia*complex(cosd(-dl),sind(-dl))*Xs;
+a=atand(imag(Ef)/real(Ef));
+
+dl=asind((Pe/3)*Xs/(Vt*abs(Ef)));
+ang=dl+a;
disp(ang,'change in power angle(deg)'); \ No newline at end of file
diff --git a/503/CH8/EX8.31/ch8_31.sci b/503/CH8/EX8.31/ch8_31.sci
index b5eb73d87..9caece0ba 100755
--- a/503/CH8/EX8.31/ch8_31.sci
+++ b/503/CH8/EX8.31/ch8_31.sci
@@ -1,27 +1,28 @@
-//to calculate synchronising power and torque coeff/deg mech shift
-
-clc;
-V=11000;
-Vt=V/sqrt(3);
-P=6*10^6;
-Ia=P/(sqrt(3)*V);
-ohm_b=Vt/Ia;
-Xs=.5;
-Xss=Xs*ohm_b;
-
-f=50;
-P=8;
-n_s=(120*f/P)*(2*%pi/60);
-
-Ef=Vt;
-dl=0;
-Psyn=(%pi/15)*(Ef*Vt/Xss)*cosd(dl);disp(Psyn,'synchronising power(W)');
-Tsyn=Psyn/n_s;disp(Tsyn,'torque coeff(Nm)');
-
-pf=.8;
-phi=acosd(pf);
-Ef=Vt+j*Ia*Xss*complex(cosd(-phi),sind(-phi));
-dl=atand(imag(Ef)/real(Ef));
-Psyn=(%pi/15)*(abs(Ef)*Vt/Xss)*cosd(dl);disp(Psyn,'synchronising power(W)');
-Tsyn=Psyn/n_s;disp(Tsyn,'torque coeff(Nm)');
-
+//to calculate synchronising power and torque coeff/deg mech shift
+
+clc;
+clear
+j = %i;
+V=11000;
+Vt=V/sqrt(3);
+P=6*10^6;
+Ia=P/(sqrt(3)*V);
+ohm_b=Vt/Ia;
+Xs=.5;
+Xss=Xs*ohm_b;
+
+f=50;
+P=8;
+n_s=(120*f/P)*(2*%pi/60);
+
+Ef=Vt;
+dl=0;
+Psyn=(%pi/15)*(Ef*Vt/Xss)*cosd(dl);disp(Psyn,'synchronising power(W)');
+Tsyn=Psyn/n_s;disp(Tsyn,'torque coeff(Nm)');
+
+pf=.8;
+phi=acosd(pf);
+Ef=Vt+j*Ia*Xss*complex(cosd(-phi),sind(-phi));
+dl=atand(imag(Ef)/real(Ef));
+Psyn=(%pi/15)*(abs(Ef)*Vt/Xss)*cosd(dl);disp(Psyn,'synchronising power(W)');
+Tsyn=Psyn/n_s;disp(Tsyn,'torque coeff(Nm)'); \ No newline at end of file
diff --git a/503/CH8/EX8.42/ch8_42.sci b/503/CH8/EX8.42/ch8_42.sci
index 711c23065..b1bb0c317 100755
--- a/503/CH8/EX8.42/ch8_42.sci
+++ b/503/CH8/EX8.42/ch8_42.sci
@@ -1,36 +1,38 @@
-//to caculate generator current,pf, real power,ecitation emf
-
-clc;
-r=500*10^6;
-V=22000;
-Ia=r/(sqrt(3)*V);disp(Ia,'generator current(A)');
-Vt=V/sqrt(3);
-Zb=Vt/Ia;
-MVA_b=500;
-MW_b=500;
-Xsg=1.57;
-Xb=.4;
-Xb=Xb/Zb;
-
-rr=250;
-rr=rr/MVA_b;
-Vb=1;
-Vt=1;
-Ia=.5;
-phi=asind(Xb*Ia/2);
-pf=cosd(phi);disp(pf,'pf');
-Pe=rr*pf;disp(Pe,'real power(pu)');
-Eg=Vt+j*Xsg*rr**complex(cosd(-phi),sind(-phi));
-Egg=abs(Eg)*V;disp(Egg,'excitation emf(V)');
-
-
-rr=500;
-rr=rr/MVA_b;
-Vb=1;
-Vt=1;
-Ia=1;
-phi=asind(Xb*Ia/2);
-pf=cosd(phi);disp(pf,'pf');
-Pe=rr*pf;disp(Pe,'real power(pu)');
-Eg=Vt+j*Xsg*rr*complex(cosd(-phi),sind(-phi));
-Egg=abs(Eg)*V;disp(Egg,'excitation emf(V)');
+//to caculate generator current,pf, real power,ecitation emf
+
+clc;
+clear
+j = %i;
+r=500*10^6;
+V=22000;
+Ia=r/(sqrt(3)*V);disp(Ia,'generator current(A)');
+Vt=V/sqrt(3);
+Zb=Vt/Ia;
+MVA_b=500;
+MW_b=500;
+Xsg=1.57;
+Xb=.4;
+Xb=Xb/Zb;
+
+rr=250;
+rr=rr/MVA_b;
+Vb=1;
+Vt=1;
+Ia=.5;
+phi=asind(Xb*Ia/2);
+pf=cosd(phi);disp(pf,'pf');
+Pe=rr*pf;disp(Pe,'real power(pu)');
+Eg=Vt+j*Xsg*rr**complex(cosd(-phi),sind(-phi));
+Egg=abs(Eg)*V;disp(Egg,'excitation emf(V)');
+
+
+rr=500;
+rr=rr/MVA_b;
+Vb=1;
+Vt=1;
+Ia=1;
+phi=asind(Xb*Ia/2);
+pf=cosd(phi);disp(pf,'pf');
+Pe=rr*pf;disp(Pe,'real power(pu)');
+Eg=Vt+j*Xsg*rr*complex(cosd(-phi),sind(-phi));
+Egg=abs(Eg)*V;disp(Egg,'excitation emf(V)'); \ No newline at end of file
diff --git a/503/CH9/EX9.2/ch9_2.sci b/503/CH9/EX9.2/ch9_2.sci
index 956c0e816..4a6297148 100755
--- a/503/CH9/EX9.2/ch9_2.sci
+++ b/503/CH9/EX9.2/ch9_2.sci
@@ -1,33 +1,35 @@
-//to calculate torque,resitance to be added to rotor ckt
-
-clc;
-f=50;
-P=6;
-n_s=120*f/P;
-w_s=2*%pi*n_s/60;
-n=875;
-s_maxT=(n_s-n)/n_s;
-R_2=.25;
-X_2=R_2/s_maxT;
-T_max=10;
-//v=V/a
-v=sqrt((T_max*w_s*X_2)/(3*.5));
-T=((3)*v^2*(R_2/s))/(w_s*((R_2/s)^2+(X_2)^2));
-disp(T,'torque(Nm)');
-
-//from eqn(T_start/T_max)=(R2+Rext)*(X2/.5)/((R2+Rext)^2+X2^2)
-//after solving
-//Rt^2-6.67*Rt+4=0
-function [x]=quad(a,b,c)
- d=sqrt(b^2-4*a*c);
- x1=(-b+d)/(2*a);
- x2=(-b-d)/(2*a);
- if(x1>x2)
- x=x2;
- else
- x=x1;
- end
-endfunction
-Rt=quad(1,-6.67,4);
-r2=.25;
-disp(Rt-r2,'external resistance(ohm)');
+//to calculate torque,resitance to be added to rotor ckt
+
+clc;
+clear
+s = 0.05;
+f=50;
+P=6;
+n_s=120*f/P;
+w_s=2*%pi*n_s/60;
+n=875;
+s_maxT=(n_s-n)/n_s;
+R_2=.25;
+X_2=R_2/s_maxT;
+T_max=10;
+//v=V/a
+v=sqrt((T_max*w_s*X_2)/(3*.5));
+T=((3)*v^2*(R_2/s))/(w_s*((R_2/s)^2+(X_2)^2));
+disp(T,'torque(Nm)');
+
+//from eqn(T_start/T_max)=(R2+Rext)*(X2/.5)/((R2+Rext)^2+X2^2)
+//after solving
+//Rt^2-6.67*Rt+4=0
+function [x]=quad(a,b,c)
+ d=sqrt(b^2-4*a*c);
+ x1=(-b+d)/(2*a);
+ x2=(-b-d)/(2*a);
+ if(x1>x2)
+ x=x2;
+ else
+ x=x1;
+ end
+endfunction
+Rt=quad(1,-6.67,4);
+r2=.25;
+disp(Rt-r2,'external resistance(ohm)'); \ No newline at end of file