from __future__ import division
from numpy import array, sqrt, nditer
#Given data:
hp=array([50,100,150,120,0]) #hp
t=array([20,20,10,20,15]) #seconds
#Solution :
def rms(hp,t):
it = nditer([hp,t,None])
for x,y,z in it:
z[...] = (x**2*y) #hp
return it.operands[2]
hp_rms_t = rms(hp,t)
hp_rms=sqrt(sum(hp_rms_t)/sum(t)) #hp
print "Required hp = %0.2f hp" %hp_rms
print "Motor size should be 100 hp"
from __future__ import division
import math
from sympy import symbols, simplify, solve, exp
#Given data:
P=30 #kW
theta1=30.0 #degree C
t1=40 #minutes
theta2=45 #degree C
t2=80 #minutes
t2=2*t1 #minutes
Loss_fl=2 #kW
Loss_Cu=2.5 #kW
#Solution :
#formula : theta1=theta_f*(1-exp(-t1/T))
T = symbols('T')
expr = theta1/theta2-(1-exp(-t1/T))/(1-exp(-t2/T))
expr = simplify(expr)
T = solve(expr, T)[0] # minutes
print "Thermal time constant = %0.2f minutes" %T
theta_f=theta1/(1-math.exp(-t1/T))
print "Final temperature rise = %0.f degrees" %theta_f
alfa=Loss_fl/Loss_Cu
t=20 #minutes
rating=P*math.sqrt((1+alfa)/(1-math.exp(-t/T))-alfa) #kW
print "20 minute rating of motor = %0.2f kW " %rating
from __future__ import division
from math import sqrt, pi, acos, degrees
#Given data:
V=230 #V
f=50 #Hz
alfa=0 #degree
Rf=200 #ohm
Ra=0.3 #ohm
T=50 #N-m
N=900 #rpm
Kv=0.8 #V/A-rad/s
Kt=0.8 #N-m/A**2
#Solution :
Vm=V*sqrt(2) #V
Vf=2*Vm/pi #V
If=Vf/Rf #A
print "Field current = %0.4f A " %If
Ia=T/(Kt*If) #A
omega=(2*pi/60)*N #radian/s
Eb=Kv*omega*If #V
Va=Eb+Ia*Ra #V
alfa_a=degrees(acos(Va/(Vm/pi)-1)) #degree
print "Firing angle of armature circuit = %0.3f degree" %alfa_a
Pout=Va*Ia #W
from sympy.mpmath import quad
I_in = sqrt(Ia**2/180*quad(lambda omegat:1,[alfa_a, 180])) # replaced pi degree to 180 radian
VA_in=V*I_in #VA
pf_in=Pout/VA_in #lagging
print "Input power factor = %0.3f lagging " %pf_in