import math
#Initialization of variables
Ns = 500. #minimum practical specific speed
h = 900. #ft
Q = 1600. #gpm
#calculations
ne = Ns*h**(3./4) /math.sqrt(Q)
#Results
print "Minimum rotative speed = %d rpm"%(round(ne,-1))
#Initialization of variables
ne = 600.
gpm = 1600.
Ns = 500.
Head = 900. #ft
#calculations
h = (ne*math.sqrt(gpm) /Ns)**(4./3)
n = Head/h
#Results
print "No. of stages = ",round(n,3)
import math
#Initialization of variables
ne = 600.
gpm = 2000.
h = 150.
num = 2.
#calculations
ns = ne*math.sqrt(gpm) /h**(3./4)
gpm2 = num*gpm
h2 = num**2 *h
Ns = 2*ne*math.sqrt(gpm2) /h2**(3./4)
Ne2 = Ns*(h/2)**(3./4) /math.sqrt(gpm)
#Results
print "Specific speed in case1 = %d "%(ns)
print "Flow rate in case 2 = %d gpm"%(gpm2)
print " Head in case 2 = %d ft"%(h2)
print " Specific speed in case 2 = %d "%(Ns)
print " required operating speed in case 2 = %.f rpm"%(Ne2)
import math
#Initialization of variables
ne = 600./2
gpm = 1450.
h = 140.
NPSH = 10.4
#calculations
Ns = gpm*math.sqrt(ne) /h**(3./4)
sigmac = NPSH/h
zsmax = -3 #ft
#Results
print "Sigma C for the pump = %.4f"%(sigmac)
print " Position of pump = %d ft"%(zsmax)
import math
#Initialization of variables
ne = 600.
gpm = 84500.
h = 225.
f = 0.95
phie = 1.1
g = 32.2
#calculations
Ns = ne*math.sqrt(gpm) /h**(3./4)
u2 = phie*math.sqrt(2*g*h)
D = 153.2*phie*math.sqrt(h) /ne
D0 = 1.06*D*12 #in
B = 0.155*D0*12 #in
De = 0.6*D0
u0 = 1.06*u2
Vm2 = 0.15*u0
Area = 0.95*math.pi*D/144 *B
Q = Area*Vm2
#Results
print "Specific speed = %d "%(round(Ns,-1))
print " Flow rate = %d cfs"%(Q)
print " Eye diameter = %.1f in"%(De)
# rounding off error