import math
#initialisation of variables
Cd= 0.98 # velocity
g= 32.2 #ft/sec**2
H= 2. #ft
#CALCULATIONS
v= math.sqrt(2*g*H)
t= H/v
h= 0.5*g*t**2
#RESULTS
print 'Vertical distance fallen in this ttime = %.3f ft'%(h)
#Note : The answer given in textbook is wrong.
import math
#initialisation of variables
r= 53.4
T= 60. #F pressure of air
h= 29.7 #in of mercury
sm= 13.6
w= 62.4 #lb/ft**3
d= 1.5 #in diameter
Qin= 2. #cuses air
g=32.2 #ft/s**2
#CALCULATIONS
W= h*sm*w/(r*(460+T)*12)
dP= 0.75*w/(12*W)
Q= math.sqrt(2*g*dP)*math.pi*d**2/(4*144)
W= Q*W*60
Cd= Qin/W
#RESULTS
print 'coefficient of discharge = %.2f '%(Cd)
import math
#initialisation of variables
H1= 34. #ft height
H2= 8. #ft head
H3= 7. #ft pressure head
g= 32.2 #ft/sec**2
d= 1.5 #in
#CALCULATIONS
v2= math.sqrt(2*g*(H1+H2-H3))
Q= v2*math.pi*d**2/(4*144)
v3= (2*v2+math.sqrt(4*v2**2-4*6*(v2**2-H2*2*5*g)))/12
dr= math.sqrt(v2/v3)
#RESULTS
print 'ratio of diameteres = %.1f '%(dr)
print " Maximum discharge = %.3f cusec"%(Q)
import math
#initialisation of variables
Q1= 8./15 #cuses
Q2= 2./15 #cuses
#CALCULATIONS
A= math.degrees(math.atan(Q2/Q1))
#RESULTS
print 'Angle of inclination = %.2f degrees'%(A)
# rounding off error
import math
#initialisation of variables
g= 32.2 #ft/sec**2
#CALCULATIONS
r= g**2/((math.sqrt(2))**2*g**2)
#RESULTS
print 'coefficient of contraction = %.1f '%(r)
import math
#initialisation of variables
B= 3. #ft long
H= 2. #ft depth of water
H1= 3.75 #ft
w= 4. #ft wide
g= 32.2 #ft/sec**2
#CALCULATIONS
Q= 3.33*(B-(H1/5))*H**1.5
v= Q/(H*w)
kh= v**2/(2*g)
Q1= 3.33*(B-(H1/5)-kh)*(((H1/5)+kh)**1.5-kh**1.5)
#RESULTS
print 'Discharge = %.2f cuses'%(Q1)
# NOte : ANSWER IN THE TEXTBOOK IS WRONG