import math
#initialisation of variables
nop= 0.88
nom= 0.88 # constant
Pm= 75. #hp
p= 3000. #lb/in**2 pressure
d= 54.5 #lbm/ft**3 density
u= 1.05*10**-4 # viscosity
d1= 0.5 #in
g= 32.2 #ft/sec**2
#CALCULATIONS
nt= (7./11)*nop*nom
pp= Pm/nt
Q= nop*pp*550/(p*144)
Re= 4*d*Q/(math.pi*u*(d1/12)*g)
#RESULTS
print ' ntrans = %.3f '%(nt)
print ' Input power = %.f hp'%(pp)
print ' Flow rate = %.3f ft**3/sec'%(Q)
print ' Reynolds Number = %.1e '%(Re)
import math
#initialisation of variables
lc= 0.25
a= 90. #degrees
p= 3000. #lb/in**2 pressure
g= 32.2 #ft/sec**2
d1= 0.5 #in
Q= 0.171 #ft**3/sec
d= 54.5 #lbm/ft**3 density
n1= 2.
n2= 6.
lc1= 0.9
nop= 0.88
nom= 0.88
#CALCULATIONS
P1= 4*p*144/11
P2= 8*d*Q**2*(n1*lc+n2*lc1)/(math.pi**2*(d1/12)**4*g)
pt= P1+P2
dpm= (p*144-pt)
ntrans= nop*nom*dpm/(p*144)
#RESULTS
print ' Frictional pressure drop = %.2e lbf/ft**2'%(P1)
print ' Extra Frictional pressure drop = %.2e lbf/ft**2'%(P2)
print ' Total pressure drop = %.2e lbf/ft**2'%(pt)
print ' Motor pressure drop = %.2e lbf/ft**2'%(dpm)
print ' Overall transmission coefficiency = %.3f'%(ntrans)
import math
#initialisation of variables
bip= 135. #degrees inlet angle
bop= 150. #degrees outlet angle
bot= 140. #degrees turbine outlet angle
bos= 137. #degrees stator blade outlet angle
r= 1.8
r1= 1.8 # ratio b1/b2
r2= 0.7 # ratio b1/b3
r3= 0.95 # ratio r3/r1
#CALCULATIONS
Vw2r2byVw1r1 = (1+(1/math.tan(math.radians(bip))/1/math.tan(math.radians(bos))))*r**2-r1*(1/math.tan(math.radians(bop))/1/math.tan(math.radians(bos)))
Vw3r3byVw1r1 = r2*r3**2*(1+(1/math.tan(math.radians(bip))/1/math.tan(math.radians(bos))))-(1/math.tan(math.radians(bot))/1/math.tan(math.radians(bos)))
CtbyCp = (Vw2r2byVw1r1-Vw3r3byVw1r1)/(Vw3r3byVw1r1-1)
#RESULTS
print ' R1 = %.2f'%(Vw2r2byVw1r1)
print ' R2 = %.2f'%(Vw3r3byVw1r1)
print ' Torque ratio = %.2f'%(CtbyCp)
# rounding off error. please check. instead of cot, have used 1/tan. please check.