from math import pi
#slip,the air gap power and efficiency
#given data :
w=100 # in rad/sec
F1=50 #in Hz
P=4
Ns=(120*F1)/P
ws=2*pi*(Ns/60)
s=((ws-w)/ws)
print "part (1)"
print "slip is", round(s,4)," or ", round(s*100,2), " % "
print "part (2)"
T=100 # in N-M
w=100 # in rad/sec
Pag=ws*T
P_slip=s*Pag
P_mech=(1-s)*Pag
print "(a)the air gap power, pag = %0.f W" %Pag
print "(b)slip power = %0.f W" %P_slip
print "(c)Mech o/p power, P_mech = %0.f W" %P_mech
#air gap power is calculated wrong in the textbook
print "part (3)"
eta=(P_mech/Pag)
print "efficiency of the rotor circuit is", round(eta,4)," or", round(eta*100,2)," % "
from __future__ import division
#voltage per phase,slip,slip frequency ,slip and rotor loss
#given data :
V_rms=240 # in volts
F1=50 #in Hz
Vs_rms=240/2
print "part (1)"
print "supply voltage = %0.2f V"%Vs_rms
print "part (2)"
N=1440 # in rpm
P=4 # pole
Ns=(120*F1)/4
S=((Ns-N)/Ns)
print "slip is ", S, " or", S*100, " % "
print "part (3)"
S_frequency=S*F1
print "slip frequency = %0.2f Hz" %S_frequency
print "part (4)"
f=2 #Hz
f1=25 #Hz
s=(f/f1) #
print "slip is", s, " or", s*100, " % "
print "part (5)"
F2=25 #in Hz
S1=(S_frequency/F2)
rotor_loss=S1/(1-S1)
print "Rotor loss = %0.4f %%" %rotor_loss
#voltage per phase , slip ,slip frequency and percentage rotor loss
Ns1=750 #
V_rms=240 # in volts
f2=25 #Hz
F1=50 #in Hz
Vs_rms=240/2
N=1440 # in rpm
P=4 # pole
Ns=(120*F1)/4
S=((Ns-N)/Ns)
S_frequency=S*F1
fs12=S_frequency/4 #
S1=fs12/f2
rotor_loss=S1/(1-S1)
n=Ns1-((S1*Ns1)) #
print "supply voltage = %0.2f V" %Vs_rms
print "slip,S = %0.2f %%"%(1*100)
print "slip frequency at 50Hz = %0.2f Hz"%S_frequency
print "slip frequency at 25Hz = %0.2f Hz"%fs12
print "Rotor loss = %0.2f %%" %rotor_loss
print "speed = %0.2f rpm" %n