import math
#initialisation of variables
v= 231. #ft/sec
g= 32.2 #ft/sec**2
vc= 0.97
r= 0.47
p= 85. #per cent
A= 170. #degrees
p1= 88. #per cent
l= 950. #ft
#CALCULATIONS
H= v**2/(vc**2*2*g)
u= r*v
vr= v-u
vr1= p*vr/100
w1= u-vr1*math.cos(math.radians(180-A))
W= u*(v-w1)/g
he= W*100/H
W1= p1*W/100
oe= W1*100/l
#RESULTS
print 'hydraulic efficiency = %.f percent'%(he)
print ' overall efficiency = %.1f percent'%(oe)
import math
#initialisation of variables
d= 1. #in
v= 95. #ft/sec
F= 173.2 #lb
A= 163. #degrees
H= 500. #ft
Cv= 0.97
d1= 1.33 #ft
r= 0.47
w= 62.4 #lb/ft**3
g= 32.2 #ft/sec**2
#CALCULATIONS
Q= w*math.pi*v/(144*4)
k= (F-v)/(v*math.cos(math.radians(180-A)))
v1= Cv*math.sqrt(2*g*H)
W= v1*w*d**2*math.pi/(4*144)
N= 60*r*v1/(math.pi*d1)
whp= (v1-v)*(1+k*math.cos(math.radians(180-A)))*v1*2/550
Ns= N*whp**0.5/H**1.25
#RESULTS
print 'specific speed = %.2f r.p.m'%(Ns)
import math
#initialisation of variables
D= 2. #ft
f= 0.005
l= 10000. #ft
g= 32.2 #ft/sec**2
H= 1000. #ft
w= 62.4 #lb/ft**3
#CALCULATIONS
d= (2*D**5/(f*l))**0.25
v= math.sqrt(8*g*H*D**5/(f*l*d**4+4*D**5))
HP= w*math.pi*d**2*v**3/(2*g*550*4)
Q= math.pi*d**2*(HP/67)/4
#RESULTS
print 'Quantity flowing = %.f cusecs'%(Q)
# rounding off error
import math
#initialisation of variables
pl= 122.5 # ft
Hw= 1225 #ft
g= 32.2 #ft/sec**2
Cd= 0.98
Cd1= 0.45
N= 500. #r.p.m
P= 6800. #h.p
n= 0.86
w= 62.4 #lb/ft**2
l= 5450. #ft
f= 0.005
A= 18. #ft**2
#CALCULATIONS
Ah= Hw-pl
js= Cd*math.sqrt(2*g*Ah)
bs= Cd1*js
D= bs*60*2/(N*2*math.pi)
a= P*2*g*550*144/(n*w*js**3*2)
vp= math.sqrt(pl*2*g/(4*f*l))
dp= (js*2*4*A/(math.pi*144*vp))**(2./3)
dp=2.495 #ft
#RESULTS
print 'diameter of bucket circle D = %.1f ft'%(D)
print ' area of jet = %.f in**2'%(a)
print ' diameter of pipe = %.1f ft'%(dp)
import math
#initialisation of variables
u= 10.*math.pi #ft/sec
u1= 5.*math.pi #ft/sec
a= 20. #degrees
A= 300. #r.p.m
v= 10. #ft/sec
g= 32.2 #ft/sec**2
wi= 2. #ft
d= 6. #in
w1= 62.4 #lb/ft**3
#CALCULATIONS
w= v/math.tan(math.radians(a))
a1= math.degrees(math.atan((v/(u-w))))
b= math.degrees(math.atan((v/u1)))
W= u*w/g
A1= math.pi*wi*d/12
Q= A1*v
WHP= W*Q*w1/550
#RESULTS
print 'Blade angle at inlet is given by = %.2f degrees'%(a1)
print ' Blade angle at inlet is given by = %.2f degrees'%(b)
print ' Water horse power = %.1f h.p'%(WHP)
# rounding off error
import math
#initialisation of variables
g= 32.2 #ft/sec**2
H= 100. #ft
a= 25. #degrees
a1= 20. #degrees
r1= 9./8
r2= 0.2
u= 6.63 #ft/sec
w= 62.4 #lb/ft**3
h1= 34. #ft
h2= 100. #ft
r= 0.1
#CALCULATIONS
f= math.sqrt(H*g/((r1*1/math.tan(math.radians(a))*1/math.tan(math.radians(a1)))+r1*0.5+(r1*0.5**2*0.2/(math.sin(math.radians(a)))**2)+0.1/(math.sin(math.radians(a1+10)))**2))
W= u*f**2/g
q= a*H*550/(10*W*w)
q1= q/w
A= q/f
dh= h1+h2-((1+r)*f**2/((math.sin(math.radians(a1)))**2*2*g))
#RESULTS
print 'f = %.1f ft/sec'%(f)
print ' Work Done = %.1f ft-lb/lb'%(W)
print ' Quantity flow = %.1f cusecs'%(q)
print ' Area form guides = %.3f ft**2'%(A)
print ' Pressure at entry of level = %.1f ft of water'%(dh)
#The answer is a bit different due to rounding off error in textbook
import math
#initialisation of variables
d= 8. #in
w= 2. #in
di= 12. #in
wi= 3. #in
a= 24. #degrees
p= 88. #per cent
a1= 85. #degrees
a2= 30. #degrees
p1= 94. #per cent
h= 180. #ft
d1= 18. #in
Cd= 0.92
g=32.2
n1= 111. #rpm
#calculations
r1= 1./math.tan(math.radians(a))
r2= (1./math.tan(math.radians(a1)))+r1
r3= 2*r2/3
r4= (1/math.tan(math.radians(a2)))-r3
a3= math.tan(math.radians(1/r4))
r5= math.sin(math.radians(a3))
f= math.sqrt(g*h*(p/100.)/(r1*r2+r3*r4+(r5**2/2)))
A= r2*f/(d/12)
N= (A*60/(2*math.pi))-n1
W= (r1*r2+r3*r4)*f**2/g
Q= math.pi*(d1/12)*(w/12)*Cd*f*62.08
whp= W*Q/550
bhp= p1*whp/100
#RESULTS
print 'Speed = %.f rpm'%(N)
print ' output horsepower = %.f hp'%(bhp)
# slightly change in r1,r2,r3 and that leads to some error in answer. Please check manually.
import math
#initialisation of variables
N= 428.6 #r.p.m
D= 5. #ft
w= 62.4 #lb/ft**3
hp= 16800. #hp
Qw= 435. #cuses
g= 32.2 #ft/sec**2
v= 32. #ft/sec
v1= 24. #f/sec
H= 200. #ft
lh1= 0.32 #ft lb/lb
#CALCULATIONS
u= math.pi*D*N/60
W= hp*550/(Qw*w)
w= W*g/u
a= math.radians(math.tan(v/w))
va= math.sqrt(w**2+v**2)
b= math.radians(math.tan(v/(u-w)))
B= 180-b
vew= va**2/(2*g)
ve1w= v1**2/(2*g)
LH= H+vew-ve1w-W+lh1
#RESULTS
print ' Absolute velocity at entry to runner = %.1f ft/sec'%(va)
print ' Loss of head in runner = %.2f ft lb/lb'%(LH)
import math
#initialisation of variables
A1= 25. #degrees
A2= 80. #degrees
H1= 100. #ft
H2= 13. #ft
g= 32.2 #ft/sec**2
v= 8. #ft/sec
d= 3.5 #in
de= 15.4 #in
b= 1.5 #in
w= 62.4 #lb/ft**3
#CALCULATIONS
W= H1-H2-(v**2/(2*g))
f= math.sqrt(W*g/(1/math.tan(math.radians(A1))*(1/math.tan(math.radians(A1))-1/math.tan(math.radians(A2)))))
u= f*(1/math.tan(math.radians(A1))-1/math.tan(math.radians(A2)))
V= d*u/7.7
r= math.degrees(math.atan(f/V))
N= 60*u*12/(math.pi*de)
Q= math.pi*de*f*b/144
HP= Q*w*W/550
Ns= N*math.sqrt(HP)/H1**1.25
di= math.sqrt(Q*4*144/(math.pi*f))
#RESULTS
print 'angle = %.f degrees'%(r)
print " Angular speed = %.1f rpm"%(Ns)
print ' inlet diameter to draft tube = %.2f in'%(di)
import math
#initialisation of variables
H= 82.1 #ft
h= 90. #ft
k= 0.00646
k1= 0.00454
vd= 11. #ft/sec
P= 0.53 #hp
#CALCULATIONS
Q= math.sqrt((1/k))*math.sqrt(h-H)
Qu= Q/math.sqrt(H)
Q1= math.sqrt(vd/k1)
hf= Q1**2*k
Qu1= Q1/math.sqrt(h-hf)
Pu= P*(h-hf)**1.5
#RESULTS
print 'Qu = %.2f cuses'%(Qu)
print ' Q = %.1f cuses'%(Q1)
print ' power Developed = %.f hp'%(Pu)
# rounding off error