import math
#initialisation of variables
# to campute cu loss in rotoe windings, input to the motor, efficiency
f_s=120.0/60 #cycles/min
f=50.0
s=f_s/f
n_s=1000.0
#Calculations
n=(1-s)*n_s
w=n*2*math.pi/60.0
T=160.0
P=T*w
T_L=10
P_m=(T+T_L)*w
cu=P_m*(s/(1.0-s))
print(cu,'rotor cu loss(W)')
P_sl=800.0 #stator loss
P_in=P_m+cu+P_sl
print(P_in,'power i/p to motor(W)')
eff=P/P_in
#Results
print(eff*100.0,'efficiency(%)')
import math
#initialisation of variables
#to calculate torque,resitance to be added to rotor ckt
f=50.0
P=6.0
n_s=120.0*f/P
w_s=2*math.pi*n_s/60
n=875.0
s_maxT=(n_s-n)/n_s
R_2=.25
X_2=R_2/s_maxT
T_max=10.0
#v=V/a
#Calculations
v=math.sqrt((T_max*w_s*X_2)/(3*.5))
T=((3.0)*v**2*(R_2/s))/(w_s*((R_2/s)**2+(X_2)**2))
print(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
def quad(a,b,c):
d=math.sqrt(b**2-4*a*c)
x1=(-b+d)/(2*a)
x2=(-b-d)/(2*a)
if(x1>x2):
x=x2
else:
x=x1
return x
Rt=quad(1,-6.67,4)
r2=.25
#Results
print(Rt-r2,'external resistance(ohm)')
import math
#initialisation of variables
#to find slip at max torque,full load slip and rotor current at starting
#Tfl=(3/w_s)*(V**2*Rs/s_fl)/((R2/s_fl)**2+X2**2) (i)
#Ts=(3/w_s)*(V**2*R2)/(R2**2+X2**2) (ii)
#Tmax=(3/w_s)*(.5*V**2)/X2**2 (iii)
#Tmax/Ts=2 k=R2/X2 (iii)/(ii)and solving
#k**2-4*k+1=0
#Calculations
def quad(a,b,c):
d=math.sqrt(b**2-4*a*c)
x1=(-b+d)/(2*a)
x2=(-b-d)/(2*a)
if(x1>x2):
x=x2
else:
x=x1
return x
k=quad(1,-4,1)
print(k,'s_max_T')
#(iii)/(i)and solving
#s_fl**2-1.072*s_fl+.072=0
s_fl=quad(1,-1.072,.072)
print(s_fl,'s_fl')
#a=I2_start/I2_fullload
a=math.sqrt((k/s_fl)**2+1)/(k**2+1)
#Results
print(a,'I2_start/I2_fullload')
import math
#initialisation of variables
#to determine ckt model parameters,parameters of thevenin equivalent, max torque and slip, stator current, pf and eff
j=math.sqrt(1.0)
#NL test
V=3300.0
f=50.0
Inl=5.0
Po=2500.0
Zo=V/(math.sqrt(3.0)*Inl)
Ro=Po/(3*Inl**2)
print(Ro,'Ro(ohm)')
Xo=math.sqrt(Zo**2-Ro**2)
print(Xo,'Xo(ohm)')
#BR test
V_BR=400.0
I_BR=27.0
ff=15.0
P_BR=15000.0
#Calculations
Z_BR=V_BR/(math.sqrt(3.0)*I_BR)
R_BR=P_BR/(3*I_BR**2)
X_BR=math.sqrt(Z_BR**2-R_BR**2)
x1=X_BR/2 #at 15 Hz
X1=x1*f/ff #at 50Hz
print(X1,'X1(ohm)')
Xm=Xo-X1
print(Xm,'Xm(ohm)')
R1=3.75
R2=(R_BR-R1)*((Xm+X1)/Xm)**2
print(R2,'R2(ohm)')
V_TH=(V/math.sqrt(3))*complex(math.cos(math.radians(0)),math.sin(math.radians(0)))*complex(0,Xm)/complex(R1,X1+Xm)
print(V_TH,'V_TH(V)')
Z_TH=complex(0,Xm)*complex(R1,X1)/complex(R1,X1+Xm)
print((Z_TH.real),'R_TH(ohm)')
print((Z_TH.imag),'X_TH(ohm)')
a=(math.sqrt((Z_TH.real)**2+(X1+(Z_TH.imag))**2))
s_max_T=R2/a
n_s=1000.0
Z_tot=complex((Z_TH.real)+a,X1+(Z_TH.imag))
I2=abs(V_TH)/abs(Z_tot)
T_max=3*(I2**2)*R2/(s_max_T*(2*math.pi*n_s/60))
print(T_max,'T_max(Nm)')
Z_f=complex(0,Xm)*complex(81.25,X1)/complex(81.25,X1+Xm)
Z_in=Z_f+complex(R1,X1)
I1=V/(math.sqrt(3)*abs(Z_in))
pf=math.cos(math.radians(math.degrees(math.atan((Z_in.imag)/(Z_in.real)))))
s=.04
Pmechg=(1-s)*3*I1**2*(Z_f.real)
Prot=Po-Inl**2*R1
Pip=math.sqrt(3.0)*V*I1*pf
Pop=Pmechg-Prot
eff=Pop/Pip
print(eff,'efficiency')
Tint=Pmechg/((1-s)*2*math.pi*n_s/60)
#Results
print(Tint,'internal torque developed(Nm)')
import math
#initialisation of variables
#to calculate starting torque and current,full load current,pf, torque , internal and overall eff,slip and max torque
R1=.3
R2=.25
X1=.6
X2=.6
Xm=35
Prot=1500.0
V=231.0
Z_TH=complex(0,Xm)*complex(R1,X1)/complex(R1,X1+Xm)
V_TH=(V*complex(0,Xm))/complex(R1,X1+Xm)
n_s=1500.0
w_s=2*math.pi*n_s/60
s=1
Z_f=complex(0,Xm)*complex(R2,X2)/complex(R2,X2+Xm)
R_f=(Z_f.real)
Z_in=Z_f+complex(R1,X1)
I1=V/abs(Z_in)
print(I1,'starting current(A)')
Tstart=3*I1**2*R_f/w_s
print(Tstart,'starting torque(Nm)')
n=1450.0
s=1-n/n_s
a=R2/s
Z_f=complex(0,Xm)*complex(a,X2)/complex(a,X2+Xm)
R_f=(Z_f.real)
Z_in=Z_f+complex(R1,X1)
I1=V/abs(Z_in)
print(I1,'full load current(A)')
#Calculations
pf=math.cos(math.radians(math.degrees(math.atan((Z_in.imag)/(Z_in.real)))))
print(pf,'pf')
P_G=3*I1**2*R_f
Popg=P_G*(1-s)
Pop=Popg-Prot
Tnet=Pop/((1.0-s)*w_s)
print(Tnet,'net torque(Nm)')
Vt=400
Pip=math.sqrt(3)*Vt*I1*pf
eff=Pop/Pip
print(eff*100,'efficiency(%)')
int_eff=Popg/Pip
print(int_eff*100,'internal eff(%)')
s_max_T=1/(math.sqrt((Z_TH.real)**2+((Z_TH.imag)+X1)**2)/R2)
print(s_max_T,'max slip')
Z_tot=Z_TH+complex(R2/s_max_T,X2)
I2=abs(V_TH)/abs(Z_tot)
T_max=3*I2**2*(R2/s_max_T)/w_s
#Results
print(T_max,'max torque(Nm)')
import math
#initialisation of variables
#to determine the line current,pf, power ip, shaft torque, mech op and efficiency
R1=1.4
R2=.6
X1=2
X2=1
Xm=50.0
V=400.0
Prot=275.0
n_s=1000.0
#Calculations
w_s=2*math.pi*n_s/60.0
print('slip=0.03')
s=0.03
I2=(V/math.sqrt(3.0))/complex(R1+R2/s,X1+X2)
Im=(V/math.sqrt(3.0))/(Xm*complex(math.cos(math.radians(90)),math.sin(math.radians(90))))
I1=Im+I2
I_L=abs(I1)
print(I_L,'line current(A)')
pf=math.cos(math.radians(math.degrees(math.atan((Z_in.imag)/(Z_in.real)))))
print(pf,'pf')
Pip=math.sqrt(3.0)*V*abs(I1)*math.cos(math.radians(math.degrees(math.atan((I1.imag)/(I1.real)))))
print(Pip,'power i/p(W)')
P_G=3*abs(I2)**2*R2/s
Pmechg=(1-s)*P_G
print(Pmechg,'mech power op(W)')
Popnet=Pmechg-Prot
Tnet=Popnet/(w_s*(1.0-s))
print(Tnet,'shaft torque(Nm)')
eff=Popnet/Pip
print(eff,'efficiency')
print('slip= -0.03')
s=-0.03
I2=(V/math.sqrt(3))/complex(R1+R2/s,X1+X2)
Im=(V/math.sqrt(3))/(Xm*complex(math.cos(math.radians(90)),math.sin(math.radians(90))))
I1=-(Im+I2)
I_L=abs(I1)
print(I_L,'line current(A)')
pf=math.cos(math.radians(math.degrees(math.atan((I1.imag)/(I1.real)))))
print(pf,'pf')
Pip=math.sqrt(3.0)*V*abs(I1)*math.cos(math.radians(math.degrees(math.atan((I1.imag)/(I1.real)))))
print(Pip,'power i/p(W)')
P_G=3*abs(I2)**2*R2/s
Pmechop=(1-s)*P_G
Pmechipnet=-Pmechop
Pmechipg=Pmechipnet+Prot
print(Pmechipg,'mech power op(W)')
Tnet=Pmechipg/(w_s*(1-s))
print(Tnet,'shaft torque(Nm)')
eff=Pip/Pmechipg
print(eff,'efficiency')
print('slip= 1.2')
s=1.2
I2=(V/math.sqrt(3))/complex(R1+R2/s,X1+X2)
Im=(V/math.sqrt(3))/(Xm*complex(math.cos(math.radians(90)),math.sin(math.radians(90))))
I1=Im+I2
I_L=abs(I1)
print(I_L,'line current(A)')
pf=math.cos(math.radians(math.degrees(math.atan((I1.imag)/(I1.real)))))
print(pf,'pf')
Pip=math.sqrt(3)*V*abs(I1)*pf
print(Pip,'power i/p(W)')
P_G=3*abs(I2)**2*.5/s
Pmechg=(1-s)*P_G
print(Pmechg,'mech power op(W)')
Pmechabs=-Pmechg
n=n_s*(1-s)
w=2*math.pi*n/60
Tnet=Pmechg/w
#Results
print(Tnet,'torque developed(Nm)')
P=Pmechabs+Pip
print(P,'power disipated(W)')
import math
#initialisation of variables
#to calculate max torque and slip, starting torque
k=5.0 #k=I_s/I_fl
s_fl=0.04
#Calculations
s_max_T=math.sqrt((s_fl**2*(1-k**2))/((k*s_fl)**2-1))
print(s_max_T,'slip')
T_max=.5*(s_max_T**2+s_fl**2)/(s_fl*s_max_T)
print(T_max,'max torque(pu)')
T_s=k**2*s_fl
#Results
print(T_s,'starting torque(pu)')
import math
#initialisation of variables
#to find starting current and torque, necessary exteranl resistance and corresponding starting torque
f=50.0
R2=.1
X2=2*math.pi*f*3.61*10**-3
a=3.6
R22=a**2*R2
X22=a**2*X2
V=3000.0
n_s=1000.0
#Calculations
w_s=2*math.pi*n_s/60
I_s=(V/math.sqrt(3.0))/math.sqrt(R22**2+X22**2)
print(I_s,'starting current(A)')
T_s=(3/w_s)*(V/math.sqrt(3.0))**2*R22/(R22**2+X22**2)
print(T_s,'torque(Nm)')
Iss=30
Rext=math.sqrt(((V/math.sqrt(3.0)/Iss)**2-X22**2)-R22)
print(Rext,'external resistance(ohm)')
T_s=(3/w_s)*(V/math.sqrt(3.0))**2*(R22+Rext)/((R22+Rext)**2+X22**2)
#Results
print(T_s,'torque(Nm)')
import math
#initialisation of variables
#find line current and starting torque with direct switching, stator resistance starting, autotransformer starting, star delta starting, autotransformer ratio give 1 pu
#I_s/I_fl=6
s_fl=0.05
print('by direct switching')
Is=6.0
#Calculations
print(Is,'line current(pu)')
T=Is**2*s_fl
print(T,'torque(pu)')
print('by stator resistance starting')
Is=2.0
print(Is,'line current(pu)') #given
T=Is**2*s_fl
print(T,'torque(pu)')
print('by autotransformer starting')
x=2/6.0
Is_motor=2
Is=Is_motor*x
print(Is,'line current(pu)')
T=Is**2*s_fl
print(T,'torque(pu)')
print('by star delta starting')
Is=(1/3.0)*6
print(Is,'line current(pu)')
T=Is**2*s_fl*3.0
#Results
print(T,'torque(pu)')
print('by autotransformer starting')
Ts=1.0
x=math.sqrt(Ts/((6**2)*s_fl))
print(x,'x')
import math
#initialisation of variables
#to find resistance added to ckt
Rrot=.061
R2=Rrot/2.0
f=50.0
P=12.0
w_s=(120.0*f/P)*(2*math.pi/60.0)
s=0.045
#Calculations
w=(1.0-s)*w_s
P=200.0*10.0**3
T_fan=P/w
I2=math.sqrt(T_fan*w_s*s/(3.0*R2))
E2=I2*R2/s
n=450.0
ww=2*math.pi*n/60
nn=500.0
ss=(nn-n)/nn
Tnew=T_fan*(ww/w)**2
Rt=(3.0/w_s)*(E2*ss)**2/(ss*Tnew)
Rext=Rt-R2
#Results
print(Rext,'external resistance(ohm)')
import math
#initialisation of variables
#to find resistance added to ckt
n_s=1500.0
w_s=2*math.pi*n_s/60.0
n=1250.0
s=1-n/n_s
#Im=(1/3.0)*(0.3+.25/s+j*1.83)ohm/ph
T=150.0
V=440.0
#Calculations
#T=(3.0/w_s)*(V**2*(R_2t/s))/((.1+(R_2t/s))**2+(X1+X2)**2)
#after solving R_2t**2-1.34*R_2t+0.093=0
def quad(a,b,c):
d=math.sqrt(b**2-4*a*c)
x1=(-b+d)/(2*a)
x2=(-b-d)/(2*a)
if(x1>x2):
x=x1
else:
x=x2
return x
x=quad(1,-1.34,0.093)
Rext=x-0.083
#Results
print(Rext,'external resitance(ohm)')
import math
#initialisation of variables
#to calculate the min resistance to be added and speed of the motor
V=400.0
a=2.5
X2=.4
R2=0.08
n_s=750.0
#Calculations
w_s=2*math.pi*n_s/60.0
T=250.0
x=[];
#T=(3.0/w_s)*((V/math.sqrt(3))/a)*R2t/(R2t**2+X2**2)
#after solving
#R2t**2-1.304*R2t+0.16=0
def quad(a,b,c):
d=math.sqrt(b**2-4*a*c)
x1=(-b+d)/(2*a)
x2=(-b-d)/(2*a)
if(x1>x2):
x=x1
else:
x=x2
return x1,x2
x=quad(1,-1.304,0.16)
if x[0]>x[1]:
R2t=x[1]
else:
R2t=x[0]
Rext=R2t-R2
print(Rext,'external resistance(ohm)')
#T=(3/w_s)*((V/math.sqrt(3))/a)*(R2t/s)/((R2t/s)**2+X2**2)
#after solving
#(R2t/s)**2-1.304*(R2t/s)+0.16=0
x=[0,0]
x=quad(1,-1.304,0.16)
s=x[1]/x[0]
n=n_s*(1-s)
print(n,'speed(rpm)')
#T=(3/w_s)*((V/math.sqrt(3))/a)*(R2/s)/((R2/s)**2+X2**2)
#after solving
#(R2/s)**2-1.304*(R2/s)+0.16=0
x=quad(1,-1.304,0.16)
R2=0.08
s1=R2/x[0]
s2=R2/x[1]
if s1>s2:
ss=s2
else:
ss=s1
n=n_s*(1-ss)
#Results
print(n,'speed(rpm)')
import math
#initialisation of variables
T_jm=125
th_jc=.15 #degC/W
th_cs=0.075 #degC/W
#Calculations
dT=54 #dT=T_s-T_a
P_av=120
th_sa=dT/P_av
T_a=40 #ambient temp
P_av=(T_jm-T_a)/(th_sa+th_jc+th_cs)
if (P_av-120)<1 :
print("selection of heat sink is satisfactory")
dT=58 #dT=T_s-T_a
P_av=120
th_sa=dT/P_av
T_a=40 #ambient temp
P_av=(T_jm-T_a)/(th_sa+th_jc+th_cs)
if (P_av-120)<1 :
print("selection of heat sink is satisfactory")
V_m=math.sqrt(2)*230
R=2
I_TAV=V_m/(R*math.pi)
P_av=90
th_sa=(T_jm-T_a)/P_av-(th_jc+th_cs)
dT=P_av*th_sa
print("for heat sink")
print("T_s-T_a=%.2f degC" %dT)
print("\nP_av=%.0f W" %P_av)
P=(V_m/2)**2/R
eff=P/(P+P_av)
print("\nckt efficiency=%.3f pu" %eff)
a=60 #delay angle
I_TAV=(V_m/(2*math.pi*R))*(1+math.cos(math.radians(a)))
print("\nI_TAV=%.2f A" %I_TAV)
dT=46
T_s=dT+T_a
T_c=T_s+P_av*th_cs
T_j=T_c+P_av*th_jc
#Results
print("\ncase temp=%.2f degC" %T_c)
print("\njunction temp=%.2f degC" %T_j)
import math
#initialisation of variables
#to find the ratio of currents and torques at the starting,V2/V1
f1=50.0
f2=60.0
f=f2/f1
V=1 #V=V2/V1
s_max_T=0.2
#Is=I_s2/I_s1
#Calculations
Is=V*math.sqrt((s_max_T**2+1)/(s_max_T**2+f**2))
print(Is,'ratio of currents at starting')
#Ts=T_s2/T_s1
Ts=V**2*((s_max_T**2+1)/(s_max_T**2+f**2))
print(Ts,'ratio of torques at starting')
#Tmax=Tmax2/Tmax1
Tmax=V**2/f**2
print(Tmax,'ratio of max torques')
Vr=math.sqrt(1/math.sqrt((s_max_T**2+1)/(s_max_T**2+f**2)))
#Results
print(Vr,'V2/V1')
import math
#initialisation of variables
#to calculate ratio of torques at starting and at slip=0.05
R1=0.01
X1=.5
R2=0.05
X2=.1
#Calculations
Ts=((R1**2+X1**2)/(R2**2+X2**2))*(R2/R1)
print(Ts,'Tso/Tsi')
s=0.05
T=(((R1/s)**2+X1**2)/((R2/s)**2+X2**2))*(R2/R1)
#Results
print(T,'To/Ti')
import math
#initialisation of variables
#to compute acc time and value of rotor resistance
s=1-.96 #load is brought to .96 of n_s
s_max_T=math.sqrt((1.0-s**2)/(2*math.log(1.0/s)))
R=1.5
R2_opt=R*s_max_T
#Calculations
print(R2_opt,'rotor resistance(ohm)')
n=1000
w_s=2*math.pi*n/60
V=415
Tmax=(3.0/w_s)*(.5*(V/math.sqrt(3.0))**2)/R
J=11
t_A=(J*w_s/(2*Tmax))*((1-s**2)/(2*s_max_T)+s_max_T*math.log(1.0/s))
#Results
print(t_A,'acc time(min)')