import math
#initialisation of variables
W= 5000 #lb
vr= 6
e= 0.95
ep = 0.75
d= 9 #in
D= 45 #ft
t= 2 #min
v= 4.5 #ft/sec
#CALCULATIONS
L= W*vr/(e*ep)
Pr= L/(math.pi*d**2/4)
s= D/vr
V= s*math.pi*ep**2/(4*t*60)
T= D/v
V1= s*math.pi*ep**2/4
V2= V*T
V3= V1-V2
#RESULTS
print 'Pressure on ram = %.f ln/in**2 '%(Pr)
print ' Pump duty = %.4f cusec'%(V)
print ' Minimum capacity if accumulator = %.3f ft**3 '%(round(V3))
# rounding off error
import math
#initialisation of variables
P1= 1100. #lb/in**2
P2= 85. #lb/in**2
f= 0.01
g= 32.2 #ft/sec**2
l= 1600. #ft
r= 1./8
W= 2500. #lb
d= 6. #in
#CALCULATIONS
L= W*d
P= L*2.31/(math.pi*(d/2)**2)
s1= P1*2540/1100
s2= P2*196/85
vp= math.sqrt((s1-s2-P)/(4*f*l/(2*g*r)))
V= vp/16
Vl= V*d
Vp= math.sqrt((s1/3)/(4*f*l/(2*g*r)))
vl= Vp*d/16
Hr= s1-(s1/3)-s2
Lr= Hr*math.pi*(d/2)**2/(2.31*d)
#RESULTS
print "In case 1 velocity of load = %.2f ft/sec"%(Vl)
print " In case 2 velocity of load = %.2f ft/sec"%(vl)
print ' Load to be lifted = %d lb '%(Lr)
# note : roundin off error
import math
#initialisation of variables
bhp= 1500 #h.p
e= 0.86
h1= 300 #ft
h2= 15 #ft
w= 62.4 #lb/ft**3
t= 30 #days
t1= 10 #hr
t2= 3 #months
f= 0.005
l= 1000 #ft
#CALCULATIONS
WHP= bhp/e
Ha= h1-h2
W= WHP*550
Q= W/(Ha*w)
Qt= Q*36009*t1*t*t2
Qp= Qt/(3600*t*45)
d= (f*l*(Q/2)**2/(t1*h2))**(1./5)
#RESULTS
print "Minimum size of basin required = %.1e cusecs"%Qt
print "Pump Discharge : %.f cusecs"%(Qp/10)
print 'Diameter = %.2f ft '%(d)
import math
#initialisation of variables
l= 140 #ft
P= 70 #percent
V= 3*10**8 #ft**3
w= 62.4 #lb/ft**3
SBD= 4.9*10**8 #ft**3
Q= 162 #cuses
s= 12.2*10**6 #ft**3/day
#CALCULATIONS
O= Q*w*l*(P/1000.)/550.
#RESULTS
print 'Size of reservoir= %.2e ft**3'%(SBD)
print ' output = %.f h.p '%(O)
print ' output = %d h.p '%(Q)
# rounding off error
import math
#initialisation of variables
Q= 140 #cuses
w= 62.4 #lb/ft**3
l= 140 #ft
P= 70 #percent
k= 1.6
v= 3*10**8
#CALCULATIONS
rv= k*v
HP= Q*l*w*(P/1000.)/550.
#RESULTS
print 'Required size of reservoir = %.1e ft**3 '%(rv)
print ' horsepower = %.f h.p '%(HP)
import math
#initialisation of variables
P= 10. #lb/in**2
r1= 0.5 #ft
r= 0.25 #ft
f= 42.3 #ft/sec
b= 1./40
Tt= 1400. #lb
#CALCULATIONS
Q= 2*math.pi*r*b*f
p1= 34+P
Fu= p1*math.pi*(r-(r/4))*144/2.3
Fr= Fu-Tt
#RESULTS
print 'Quantity = %.2f cusecs '%(Q)
print ' Resultant force on the plate = %.f lb '%(round(Fr,-1))
import math
#initialisation of variables
r= 0.5 #ft
N= 300
w= 62.4 #lb/ft**3
g= 32.2 #ft/sec**2
#CALCULATIONS
A= N*2*math.pi/60
Ft= math.pi*A**2*r**4*w/(4*g)
#RESULTS
print 'total force = %.1f lb '%(Ft)
import math
#initialisation of variables
d= 4. #in
h= 12. #in
h1= 9. #in
g= 32. #ft/sec**2
#CALCULATIONS
H= 2*(1-(h1/h))
A= math.sqrt((H*2*g/((d/24)**2)))
A1= math.sqrt((H*2*g*2/((d/24)**2)))
#RESULTS
print 'speed when the axial is zero = %.f radn/sec '%(A)
print ' speed when the axial is zero = %.f radn/sec '%(A1)
import math
#initialisation of variables
P= 14.7 #lb/in**2
T= 15. #C
v= 350. #ft/sec
R= 0.714
#CALCULATIONS
P1= P*144
r= 3091*(273+T)
d1= P1/r
r1= r+(v**2/7)
P2= (r1*d1/(P1**R))**(1/(1-R))/144
dP= P2-P
T2= r1/3091
dT= T2-(273+T)
#RESULTS
print 'rise in pressure = %.f lb/in**2 '%(dP)
print ' rise in temperature = %.1f C '%(dT)
# rounding off error
import math
#initialisation of variables
T= 27. #C
P = 33. #lb/in**2
p1= 14.7 #lb/in**2
w= 250. #lb
g= 32.2 #ft/sec**2
Cd= 0.99
r= 1.4
#CALCULATIONS
w1= P*144/(96*(273+T))
d= p1*144/(96*(273+T))
W= d*w/60
d= math.sqrt(W*4/(Cd*math.pi*math.sqrt(2*g*P*144*(r/(r-1))*w1*(0.528**(2/1.4)-0.528**(2.4/1.4)))))*12
#RESULTS
print 'Diameter = %.3f in '%(d)
import math
#initialisation of variables
sp= 13.6
hm= 800. #mm
d= 3. #in
r= 1.4
R= 1385. #ft-lb/lb/C
w= 62.4 #lb/ft**3
T= 15. #C
hm1= 765. #mm
r1= 9.
g= 32.2 #ft/sec**2
#CALCULATIONS
p1= hm*sp*w/304.8
r2= (273+T)*R
w1= p1/r2
k= hm/hm1
v1= math.sqrt((2*g*r*r2*(1-k**0.286))/((1-r)*(r1**2*k**1.43-1)))
W= v1*w1*3600*(math.pi/64)
#RESULTS
print 'Weight flowing = %.f lb/hr '%(W)
#The answer is a bit different due to rounding off error in textbook
import math
#initialisation of variables
p= 160. #lb/in**2
d= 1./3 #ft
T= 15. #C
R= 96.
V= 120. #ft**3
f= 0.004
a= 60*math.pi
l= 10560. #ft
g= 32.2 #ft/sec**2
#CALCULATIONS
p1= p*144
w1= p*144/(R*(273+T))
v1= V*36/a
p2= math.sqrt(p1**2-((2*4*f*p1*w1*v1**2*l)/(2*g*d)))/144
v2= p*v1/p2
#RESULTS
print ' pressure = %.1f lb/in**2 '%(p2)
print ' velocity = %.1f ft/sec '%(v2)
#The answer is a bit different due to rounding off error in textbook