import math
from sympy.functions.elementary.trigonometric import acot
#initialisation of variables
rt= 1.3 #ft
rr= 0.6 #ft
Q= 75. #ft**3 flow rate
rm= 0.95
w1= 40. #rev/sec
bim= 153. #degrees blade inlet angle
bom= 147. #degrees blade outlet angle
w= 62.4 #lb/ft**3
g= 32.2 #ft/sec**2
#CALCULATIONS
A= round(math.pi*(rt**2-rr**2),2)
Va= round(Q/A,2)
Vbm= rm*w1
#a= -1/math.degrees(math.atan(-Vbm/Va))
a = math.degrees(acot(-Vbm/Va))
im= a-bim
vwm= Vbm+Va*1/math.tan(math.radians(bom))
dvwm= rm*vwm
C= w*Q*dvwm/g
Cw= C*w1
dp= Cw/Q
#RESULTS
print ' Incidence = %.1f degrees'%(im)
print ' Oulet velocity = %.2f ft/sec'%(vwm)
print ' Change of whirl at the mean radius = %.2f ft**2/sec'%(dvwm)
print ' Torque = %.f lbf/ft'%(C)
print ' Rate of working = %.f ft lbf/sec'%(Cw)
print ' Workdone by the rotor = %.f lbf/ft**2'%(dp)
# note : answer in book is wrong. please check manually.
import math
#initialisation of variables
vbm= 38. #ft/sec
va= 17.94 #ft/sec
a= 147.5 #degrees
vwm= 10.37 #ft/sec
C= 1430. #lbf/ft
P= 763. #lbf/ft**2
#CALCULATIONS
vwm1= vbm+va*1/math.tan(math.radians(a))
p= (vwm-vwm1)/vwm
C1= C*(1-p)
P1= P*(1-p)
#RESULTS
print ' Oulet Velocity = %.2f ft/sec'%(vwm1)
print ' Torque = %.f lbf/ft'%(round(C1,-1))
print ' Workdone by the rotor = %.f lbf/ft**2'%(P1)
import math
from sympy.functions.elementary.trigonometric import acot
#initialisation of variables
a= 154 #degrees
vbm= 38 #ft/sec
bom= 147 #degrees outlet angle
vwm= -7.78 #ft/sec outlet whirl velocity
w= 62.4 #lbf/ft**3
g= 32.2 #ft/sec**2
vb= 38 #ft/sec velocity
A= 4.18 #ft**2 flow area
e= 0.95
#CALCULATIONS
vat= (vwm-vb)*math.tan(math.radians(bom))
Q= vat*A
#a1= 1/math.tan(math.radians(-vbm/vat))
a1 = math.degrees(acot(-vbm/vat))
imt= a1-a
C= w*Q*vwm*e/g
#RESULTS
print ' Flow rate = %.1f ft**3'%(Q)
print ' Incidence angle= %.f degrees'%(imt)
print ' Torque= %.f lbf ft'%(C)
#Incorrect value for a1 in textbook. Hence the difference in answers
import math
from numpy import *
#initialisation of variables
rt= 0.5 #ft radius
rr= 0.16 #ft root radius
dv1= 88.3 #ft/sec
b= 150. #degrees
r= array([0.16, 0.3, 0.5])
vw= array([2.5, 5, 7.5])
vb= array([46.6, 88.3, 132.5])
vrb= array([44.16, 88.3, 132.5])
v1= array([-1.154, -0.385])
#CALCULATIONS
A= math.pi*(rt**2-rr**2)
Va= -dv1*math.tan(math.radians(b))
Q= Va*A
ari = degrees((arctan(Va/(vw - vb)))) + 180
ari = array([ari[0],ari[2]])
#a= tan(radians(v1))+180
b = degrees(math.tan(0.577))
i = ari - 150
#RESULTS
print ' Velocity = %.2f ft/sec'%(Va)
print ' Flow rate = %.1f ft**3'%(Q)
print (v1)
print (ari)
print (i)
# rounding off error. and for 'i' answer is wrong. please check.
import math
from numpy import *
#initialisation of variables
rt= 0.5 #ft
rr= 0.16 #ft
dv1= 88.3 #ft/sec
b= 150. #degrees
a= 5. #degrees mean radius
v1= array([-0.933 ,-0.311])
i= array([1.0, 5.0 ,6.7])
#CALCULATIONS
b1= b+a
A= math.pi*(rt**2-rr**2)
Va= -dv1*math.radians(math.tan(b1))
Q= Va*A
a1= degrees(tan(v1))+180
#RESULTS
print ' Velocity = %.2f ft/sec'%(Va)
print ' Flow rate = %.1f ft**3/sec'%(Q)
print (v1)
print (a1)
print (i)
#Incorrect calculations in textbook
import math
#initialisation of variables
r= 1. #in
b= 0.75 #in rotor inlet width
w= 180. #rev/sec
B= 120. #degrees blade inlet angle
Bo= 150. #degrees blade outlet angle
ro= 3. #ft
bo= 0.5 #ft
Vbo= 180. #ft/sec
w1= 62.4 #lbf/ft**3 density
g= 32.2 #ft/sec**2
#CALCULATIONS
Q= -2*math.pi*(r/12)**2*(b/12)*w*math.tan(math.radians(B))
Vfo= Q/(2*math.pi*(ro/12)*(bo/12))
Vwo= Vbo*(ro/12)+Vfo*1/math.tan(math.radians(Bo))
C= w1*Q*Vwo*(ro/12)/g
dp= w1*Vwo*w*(ro/12)/g
ari= degrees(math.atan((-Q*0.8/(2*math.pi*(r/12)**2*(b/12)*w))))+180
i1= ari-B
#RESULTS
print ' Flow rate = %.2f ft**3/sec'%(Q)
print ' radial velocity= %.2f ft/sec'%(Vfo)
print ' outlet whirl velocity= %.2f ft/sec'%(Vwo)
print ' Torque= %.2f lbf ft'%(C)
print ' Stagnant pressure = %.f lbf/ft**2'%(dp)
print ' Incidence angle = %.1f degrees'%(i1)
import math
#initialisation of variables
r= 1.4
Mai= 0.5 #ft/sec mach number
T= 582. #R temperature
psi= 3040. #lbf/in**2 pressure
R= 53.3 #ft lbf/lbm gas
g= 32.2 #ft/sec**2
Vwi= 300. #ft/sec velocity
m= 35. #lb/sec
rm= 0.7 #ft radius
rp= 4.25
w= 1200. #rev/sec
cp= 0.24
J= 778. #lb
#CALCULATIONS
tr= 1+0.5*(r-1)*Mai**2
Ti= round(T/tr)
pr= tr**(r/(r-1))
pi= psi/pr
ai= pi/(R*Ti)
Vi= Mai*(r*R*g*Ti)**0.5
Vai= math.sqrt(Vi**2-Vwi**2)
h= m/(2*math.pi*ai*rm*Vai)
pr1= rp**(1./12)
Vwo= Vwi+(pr1**((r-1)/r)-1)*(cp*J*g*T/(rm*w))
BO= 1/math.tan(math.radians((Vwo-w*rm)/Vai))
#RESULTS
print ' Absolute air velocity = %.f ft/sec'%(Vi)
print ' air velocity = %.f ft/sec'%(Vai)
print ' Blade height = %.3f ft'%(h)
print ' velocity = %.f ft/sec'%(Vwo)
print ' outlet balde angle = %.1f degrees'%(BO) #incorrect answer in the textbook