from math import exp,sqrt
SCL=1000. # stator copper loss in watts
V=460. # line voltage of induction motor in volts
I=25. # line current of motor in amperes
pf=0.85 # power factor of motor
Pin=sqrt(3.)*V*I*pf # ans may vary due to roundoff error
print"Pin=W",Pin
Pg=Pin-SCL # air gap power
print"Pg=W",Pg# ans may vary due to roundoff error
RCL=500. # rotor copper loss in watts
Phe=800. # core loss in watts
Pfw=250. # winding and friction loss in Watts
PLL=200. # stray load loss in watts
DMP=Pg-RCL # /developed mechanical power in watts
print"DMP=W",DMP# ans may vary due to roundoff error
Prot=Phe+Pfw+PLL # power loss in rotor in watts
Pout=DMP-Prot
print"Pout=DMP-Prot=",Pout,"W"# ans may vary due to roundoff error
print"Horsepower=Pout/746=",Pout/746.,"hp"# ans may vary due to roundoff error,conversion of watts to hp needs division by 746
print"n=Pout/Pin=",Pout/Pin# ans may vary due to roundoff error
from math import sqrt,exp,pi
# this is an extension of Ex4_1
# following comes from Ex4_1
SCL=1000. # stator copper loss in watts
V=460. # line voltage of induction motor in volts
I=25.# line current of motor in amperes
pf=0.85 # power factor of motor
Pin=sqrt(3.)*V*I*pf # ans may vary due to roundoff error
Pg=Pin-SCL # air gap power
RCL=500. # rotor copper loss in watts
Phe=800. # core loss in watts
Pfw=250. # winding and friction loss in Watts
PLL=200. # stray load loss in watts
DMP=Pg-RCL # /developed mechanical power in watts
Prot=Phe+Pfw+PLL # power loss in rotor in watts
Pout=DMP-Prot
# above is from Ex4_1
s=RCL/Pg
p=4. # no of poles
print"s=RCL/Pg=",s# ans may vary due to roundoff error
ws=(4.*pi*60.)/p # synchronous angular frequency
print"ws=",ws,"rad/s"# ans may vary due to roundoff error
ns=(120.*60.)/p
print"ns=",ns,"rev/min"# ans may vary due to roundoff error
w=ws*(1.-s)
n=ns*(1.-s)
print"w=ws(1-s)=",w,"rad/s"# ans may vary due to roundoff error
print"n=ns(1-s)=",n,"rev/min"# ans may vary due to roundoff error
print"td=DMP/w=",DMP/w,"N-m"# ans may vary due to roundoff error
print"t=Pout/w=",Pout/w,"N-m"# ans may vary due to roundoff error
from math import sqrt,pi,exp,acos
# code uses userdefined function complexstring
# induction machine parameters in ohms
r1=0.39 # primary resistance
r2=0.14 # secondary resistance
x1=0.35# primary reactance
x2=0.35# secondary reactance
Xm=16.# manetizing reactance
VL=220. # supply volatge in volts
f=60. # frequency in Hz
# part a
p=4. # no of poles
ns=(120.*f)/p
print"ns=",ns,"rev/min"
n=1746. # runnimg speed of motor in rev/min
s=(ns-n)/ns
print"s=",s
z2=(r2/s)+(1j*x2)# ans may vary due to roundoff error
print'Z2=',z2,'ohm'
print"Z2=",0.376962,"ohm having a phase angle of",4.289153,"degrees"
Zf=(1j*Xm*z2)/(z2+(1j*Xm))# ans may vary due to roundoff error
print'Zf=',Zf,'omega'
print"Zf=",0.368879,"ohms having a phase angle of",20.219120,"degrees"
#Rf=real(Zf)# ans may vary due to roundoff error
#print"Rf=",Rf,"omega"
Zin=r1+(1j*x1)+Zf# ans may vary due to roundoff error
print'Zin=r1+jx1+Zf=',Zin,'omega'
print"Zin=",0.869366,"ohms having a phase angle of",22.486540,"degrees"
#Powerfctor=real(Zin)/abs(Zin)# ans may vary due to roundoff error
print"Power facto=",0.923969
I1=VL/(sqrt(3.)*abs(Zin))
print"|I1|=",I1,"A"# ans may vary due to roundoff error
#Pin=sqrt(3.)*I1*VL*Powerfctor
print"Pin=",9136.825581,"W"# ans in the textbook is wrong
#Pg=3*I1*I1*Rf
print"Pg=",8348.882711,"W"# ans in the textbook is wrong
DMP=8098.416230;#(1-s)*Pg
print"Developed power=(1-s)Pg=",DMP,"W"# ans in the textbook is wrong
#Prot=s*Pg # rotor copper losses
Pout=7847.949749;#DMP-Prot# ans in the textbook is wrong
print"Output power=",Pout,"W"
print"Output horsepower=",Pout/746.# ans may vary due to roundoff error,1 hp=746 watts
print"Developed torque=",32.653408,"lb-ft"# ans may vary due to roundoff error,1 N-m=7.04 lb-ft ot torque
n=(1-s)*ns# ans may vary due to roundoff error
print"Output torque=",7.04*(Pout/n),"lb-ft"
print"Efficiency=",0.858936
# part b
s=1. # machine at stanstill
z2=r2+(1j*x2)# ans may vary due to roundoff error
print'Z2=',z2,'omega'
print"Z2=",abs(z2),"ohm having a phase angle of",68.198591,"degrees"
Zf=(1j*Xm*z2)/(z2+(1j*Xm))# ans may vary due to roundoff error
print'Zf=',Zf,'omega'
print"Zf=",abs(Zf),"ohms having a phase angle of",68.689185,"degrees"
Zin=r1+(1j*x1)+Zf# ans may vary due to roundoff error
print'Zin=',Zin,'omega'
print"Zin=",abs(Zin),"ohms having a phase angle of",52.928760,"degrees"
I1=VL/(sqrt(3.)*abs(Zin))# ans may vary due to roundoff error
#Rf=real(Zf)
print"Starting current=",I1,"A"
Pg=8585.006361;#3.*I1*I1*Rf
print"Pg=",Pg,"W" #ans in the textbook is wrong
print"td=7.04*(Pg/ns)=",7.04*(Pg/ns),"lb-ft" #ans may vary due to roundoff error,1 N-M=7.04 lb-ft of torque
from math import sqrt,pi,exp
# below is an extension of Ex4_3
# code uses userdefined function complexstring
x1=0.35 # primary reactance in ohms
r1=0.39 # primary resistance in ohms
Xm=16. # magnetizing reactance
r2=0.14 # secondary resistance in ohms
x2=0.35 # secondary reactance in ohms
ws=188.5 # angular frequency in rad/sec
V=220. # rated voltage in volts
# part a
V1m=V/sqrt(3.)# ans may vary due to roundoff error
VTH=V1m*(Xm/(Xm+x2))
print"VTH=V1m=",VTH,"V"# ans may vary due to roundoff error
X1=x1
print"X1=",X1,"ohm"
R1=r1*(Xm/(x1+Xm))# ans may vary due to roundoff error
print"R1=",R1,"ohm"
print"tmax=",((3./ws)*(VTH**2.))/(2.*(R1+sqrt((R1**2.)+((2.*X1)**2.)))),"N-m"# ans may vary due to roundoff error
# part b
sM=r2/sqrt((R1**2.)+((X1+x1)**2.))# ans may vary due to roundoff error
print"sM=",sM
print"r2/sM=",r2/sM,"ohm"# ans may vary due to roundoff error
Zf=((1j*Xm)*((r2/sM)+(1j*x2)))/((r2/sM)+(1j*(x2+Xm)))# ans may vary due to roundoff error
print'Zf=',Zf,'ohm'
print"Zf=",0.851072,"ohm having a phase angle of",26.492804,"degrees"
z1=r1+(1j*x1)
Zin=z1+Zf
print'Zin=',Zin,'ohm'# ans may vary due to roundoff error
print"Zin=",1.363380,"ohm having a phase angle of",32.355964,"degrees"
I1=V1m/abs(Zin)
print"I1=",I1,"A"# ans may vary due to roundoff error
Rf=0.762;#real(Zf) # resistance in ohms
Pg=3.*I1*I1*Rf# ans in the textbook is wrong
print"Pg=",Pg,"W"
print"tmax=Pg/ws=",Pg/ws,"N-m"# ans may vary due to roundoff error
ns=1800. # synchronous speed in rev/min
n=1745. # initial speed in rev/min
hp=10. # hp rating of the motor horsepower(1 hp=746 Watts)
s=(ns-n)/ns
print"s=",s# ans may vary due to roundoff error
s=s/2. # slip at half torque
n1=ns*(1.-s)# ans may vary due to roundoff error
print"n=ns(1-s)=",n1,"rev/min"
# output at half torque
print"New horsepower output=",(0.5*hp*n1)/n,"hp"# ans may vary due to roundoff error,0.5 factor comes due to half torque
V1m1=1. # reference voltage in volts
V1m2=0.9# reduced voltage in volts
ratio=(V1m1/V1m2)**2. # ratio of s2/s1
print"s2/s1=",ratio# ans may vary due to roundoff error
print"I2(2)/I2(1)=s2*V1m(2)/s1*V1m(1)=",(V1m2/V1m1)*ratio# ans may vary due to roundoff error
print"(copperloss)2/(copperloss)1=(I2(2)/I2(1))**2=",(V1m1/V1m2)**2.# ans may vary due to roundoff error
s=0.03 # at 60Hz slip
ns=1800. # synchronous speed in rev/min
print"Speed at 90 percent voltage=",ns*(1-(ratio*s)),"rev/min"# ans may vary due to roundoff error
from math import sqrt,pi,exp,acos,sin
# code uses userdefined function complexstring
# dc test
Vdc=13.8 # dc voltage in volts
Idc=13. # direct current in amperes
# no load test
Vnl=220. # applied no voltage in volts
f=60. # applied frequency in Hz
# blocked rotor test
VBR=23.5 # blocked rotor voltage in volts
f1=15. # frequency in Hz
Ia=12.8 # current of phase A
Ib=13.1 # current of phase B
Ic=12.9 # current of phase C
# from blocked rotor
IBR=(Ia+Ib+Ic)/3.# ans may vary due to roundoff error
print"IBR=",IBR,"A"
ZBR=VBR/(sqrt(3.)*IBR)
print"|ZBR|=",ZBR,"ohm"# ans may vary due to roundoff error
P1=179. # power in watts
P2=290. # power in watts
PBR=P1+P2
print"PBR=",PBR,"W"
RBR=PBR/(3.*(IBR**2.))# ans may vary due to roundoff error
print"RBR=",RBR,"ohm"
print"0BR=",(acos(PBR/(sqrt(3.)*VBR*IBR)))*(180./pi)# ans may vary due to roundoff error
print"X1BR=|ZBR|*sin0BR=",ZBR*sin(acos(PBR/(sqrt(3.)*VBR*IBR))),"ohm"# ans may vary due to roundoff error
XBR=(f/f1)*(ZBR*sin(acos(PBR/(sqrt(3.)*VBR*IBR))))
print"XBR=(fB/f1)*X1BR=",XBR,"ohm"# ans may vary due to roundoff error
x1=0.4*XBR # designed reactance
x2=0.6*XBR # designed reactance
print"x1=",x1,"ohm"# ans may vary due to roundoff error
print"x2=",x2,"ohm"# ans may vary due to roundoff error
# from dc test
r1=0.5*(Vdc/Idc)
print"r1=",r1,"ohm"# ans may vary due to roundoff error
r2=RBR-r1
print"r2=",r2,"ohm"# ans may vary due to roundoff error
# from no load test
Ia=3.86 # current of phase A in amperes
Ib=3.86 # current of phase B in amperes
Ic=3.89 # current of phase C in amperes
Inl=(Ia+Ib+Ic)/3
print"Inl=",Inl,"A"# ans may vary due to roundoff error
Znl=Vnl/(sqrt(3.)*Inl)
print"Znl=x1+Xm=",Znl,"ohm"# ans may vary due to roundoff error
Xm=Znl-x1
print"Xm=Znl-x1=",Xm,"ohm"# ans may vary due to roundoff error
P1=550. # power in watts
P2=-350. # power in watts
Pnl=P1+P2
print"Pnl=",Pnl,"W"# ans may vary due to roundoff error
Pfwc=Pnl-(3*Inl*Inl*r1)
print"Pfwc=",Pfwc,"W"# ans may vary due to roundoff error
Prot=Pfwc
s=0.03
z2=(r2/s)+(1j*x2)
print'z2=',z2,'ohm'# ans may vary due to roundoff error
print"Z2=",13.509856,"ohms with a phase angle of",4.855429,"degrees"
Zf=(z2*(1j*Xm))/(z2+(1j*Xm))
print'Zf=',Zf,'ohm'# ans may vary due to roundoff error
print"Zf=",12.088780,"ohms with a phase angle of",26.924898,"degrees"
Rf=10.8;#real(Zf)
Zin=r1+Zf+(1j*x1)
print'Zin=',Zin,'ohm'# ans may vary due to roundoff error
print"Zin=",12.914691,"ohms with a phase angle of",28.874452,"degrees"
print"power factor=",0.875680;#(real(Zin)/abs(Zin)))# ans may vary due to roundoff error
I1=Vnl/(sqrt(3)*abs(Zin))
print"|I1|=",I1,"A"# ans may vary due to roundoff error
Pin=3281.759431;#(sqrt(3)*(real(Zin)/abs(Zin))*I1*Vnl)# ans is wrong in textbook
print"power drawn from line=sqrt(3)*VL*|I|*cos0O=",Pin,"W"
Rf=10.8;#real(Zf)
Pg=3.*I1*I1*Rf
print"Pg=",Pg,"W"# ans is wrong in textbook
DMP=Pg*(1.-s)
print"DMP=",DMP,"W"# ans is wrong in textbook
Pout=DMP-Prot
print"output horsepower=",Pout/746.,"hp"# ans may vary due to roundoff error,1 hp=746 watts
print"n=Pout/Pin=",Pout/Pin# ans may vary due to roundoff error
from math import sqrt
kVA=6.3 # upper limit for kVA per horsepower
hp=10. # rating of induction motor in hp.(1 hp=746 watts)
V=230. # voltage rating of the motor
I=(kVA*hp*1000.)/(sqrt(3.)*V)
print"I=",I,"A"# ans may vary due to roundoff error
from math import sqrt,pi
vtap=0.8 # percantage voltage tap of compensator
hp=100. # rating of motor in horsepower,I hp=746 watts
n=1750. # rated speed of motor in rev/min
a=1./vtap # compensator turns ratio
V=2300. # voltage rating of induction motor in volts
I1=150. # current rating in amperes
print"a=",a
print"Voltage applied at starting of motor=",V/a,"V"
I1start=I1/a
print"I1start=(1840/2300)*150A=150/a=",I1start,"A"
IL=I1start/a
print"IL=I1start/a=",IL,"A"
tfl=hp*5252./n
print"tfl=(hp*5252)/(rev/min)=",tfl,"lb-ft"# ans may vary due to roundoff error
t=1.2*tfl # 120 percent of the full load torque in lb-ft
print"tst=360/a*a=",t/(a*a),"lb-ft"# ans may vary due to roundoff error