import math
#initialisation of variables
L = 6. #ft
H = 15. #in
Cd = 0.62
g = 32.2 #ft/sec**2
#CALCULAIONS
Q = 2*Cd*L*math.sqrt(2*g)*(H/12)**1.5/3
#RESULTS
print 'Total Discharge = %.1f cuses'%(Q)
import math
#initialisation of variables
o = 90. #degrees
H = 15.5 #in
Cd = 0.6
g = 32.2 #ft/sec**2
#CALCULATIONS
Q = 8*Cd*math.tan(math.radians(o/2))*math.sqrt(2*g)*(H/12)**2.5/15
#RESULTS
print 'Total Discharge = %.2f cuses'%(Q)
import math
#initialisation of variables
Cd = 0.62
L = 4. #ft
g = 32.2 #ft/sec**2
H = 6. #in
o = 90. #degrees
#CALCULATIONS
Q = Cd*L*math.sqrt(2*g)*(H/12)**1.5*(2./3)
H1 = (Q*15/(8*Cd*math.tan(math.radians(o/2))*math.sqrt(2*g)))**(2./5)
#RESULTS
print 'depth of water = %.2f ft'%(H1)
import math
#initialisation of variables
Cd = 0.62
L = 3. #ft
g = 32.2 #ft/sec**2
H = 1. #ft
L1 = 2. #ft
h = 0.5 #ft
L2 = 1. #ft
h1 = 0.25 #ft
#CALCULATIONS
Q = 2*Cd*L*math.sqrt(2*g)*H**1.5/3
Q1 =2*Cd*L1*math.sqrt(2*g)*((H+h)**1.5- H**1.5)/3
Q2 = 2*Cd*L2*math.sqrt(2*g)*((H+h+h1)**1.5- (H+h)**1.5)/3
Q3 = Q1+Q2+Q
#RESULTS
print 'Total Discharge = %.2f cuses'%(Q3)
import math
#initialisation of variables
h = 9. #in
l = 6. #ft
g = 32.2 #ft/sec**2
#CALCULATIONS
H = h/12
Q = math.sqrt(2*g)*l*(H/12)**1.5*(0.405+(0.00984/0.75))
Q1 = 3.33*l*H**1.5
#RESULTS
print 'Discharge by francis formula = %.2f cuses'%(Q1)
#initialisation of variables
l = 24. #ft
n = 5. #parts
h = 2. #ft
w = 1. #ft
n1 = 4.
c = 10.
#CALCULATIONS
Q = 3.33*((l-n1)-0.1*c*h)*h**1.5
#RESULTS
print 'Discharge = %.1f cuses'%(Q)
#initialisation of variables
A = 25. #miles**2
t = 24. #hr
p = 50. #per cent
l = 3. #in
h = 4. #ft
#CALCULATIONS
A1 = 5280**2*A
V = A1*l/12
V1 = V/(t*60*60)
V2 = V1/2
L = (V2/(3.33*h*2))+0.2*4
#RESULTS
print 'length of weir = %.1f ft'%(L)
#initialisation of variables
h = 4. #ft
w = 5. #ft
l = 2. #ft
Q1 = 1008.5 #cuses
n = 8. #piers
#CALCULATIONS
Q = 3.33*(w-0.2*h)*h**1.5
n1 = Q1/Q
L = n*l+w*n1
#RESULTS
print 'length of weir = %.f ft'%(L)
import math
#initialisation of variables
k = 3.33
l = 10. #ft
x = 2. #ft
A = 30. #ft**2
g = 32.2 #ft/sec**2
#CALCULATIONS
Q = k*(l-0.2*x)*x**1.5
V = Q/A
h = V**2/(2*g)
Q1 = k*(l-0.2*(x+h))*((x+h)**1.5-h**1.5)
va = Q1/A
ha = va**2/(2*g)
Q2 = k*(l-0.2*(x+ha))*((x+ha)**1.5-ha**1.5)
#RESULTS
#RESULTS
print 'Discharge in franccis formula = %.2f cusecs'%(Q1)
print ' Discharge in corrected franccis formula = %.2f cusecs'%(Q2)
import math
#initialisation of variables
Cd = 0.6
g = 32.2 #ft/sec**2
o = 90. #degrees
H = 2. #ft
A = 15.2 #ft**2
#CALCULATIONS
Q = 8*Cd*math.sqrt(2*g)*math.tan(math.radians(o/2))*H**2.5/15
va = Q/A
ha = va**2/(2*g)
Q1 = 8*Cd*math.sqrt(2*g)*((H+ha)**2.5-ha**2.5)/15
#RESULTS
print 'Discharge of stream = %.1f cuses'%(Q1)
#initialisation of variables
va = 4. #ft/sec
g = 32.2 #ft/sec**2
H = 1.25
l = 10. #ft
w = 62.4 #lbs/ft**3
p = 60. #per cent
l1 = 90. #ft
#CALCULATIONS
ha = va**2/(2*g)
Q = 3.333*(l-0.1*2*(H+ha))*((H+ha)**1.5-ha**1.5)*w
E = Q*l1
HP = E*60/(100*550)
#RESULTS
print 'H.P available = %.1f H.P'%(HP)
import math
#initialisation of variables
L = 8. #ft
d = 9. #in
h = 3. #in
Cd1 = 0.62
Cd2 = 0.62
g = 32.2 #ft/sec**2
#CALCULATIONS
Q1 = (2./3)*Cd1*L*math.sqrt(2*g)*(h/12)**1.5
Q2 = Cd2*L*d*math.sqrt(2*g*h/12)/12
Q = Q1+Q2
#RESULTS
print 'Discharge = %.2f cuses'%(Q)
import math
#initialisation of variables
L = 50. #ft
d = 2. #ft
h = 4. #ft
Cd1 = 0.58
Cd2 = 0.8
g = 32.2 #ft/sec**2
#CALCULATIONS
ha = h/(2*g)
Q1 = (2./3)*Cd1*L*math.sqrt(2*g)*((h+ha)**1.5-ha**1.5)
Q2 = Cd2*L*d*math.sqrt(2*g*(h+ha))
Q = Q1+Q2
#RESULTS
print 'Discharge = %d cuses'%(Q)
# note : value of ha is calculated wrongly. please check.
import math
#initialisation of variables
M = 60.
k = 500.
v = 8. #ft/sec
w = 100. #ft
h1 = 5. #ft
g = 32.2 #ft/sec**2
x = 1.95 #ft
#CALCULATIONS
Q = k*M**(2./3)
A = Q/v
md = A/w
h = md-h1
ha = v**2/(2*g)
H = h+x**2-1+h1-1
#RESULTS
print 'height above the crest of the air = %.2f ft of water'%(H)
import math
#initialisation of variables
H2 = 1.5 #ft
H1 = 1. #ft
A = 100. #yards**2
Cd = 0.6
g = 32.2 #ft/sec**2
#CALCULATIONS
A1 = A*9
T = (1.25*A1/(Cd*math.sqrt(2*g)))*(H1-(1/H2)**1.5)
#RESULTS
print 'time of lowering the surface = %.1f sec'%(T)