from __future__ import division
import math
#Initializing the variables
B = [1.4 ,0.9];
D = [0.6 ,0.32];
g = 9.81;
h = 0.03;
Z = 0.25;
#Calculations
Q1 = B[1]*D[1]*(2*g*h/(1-(B[1]*D[1]/B[0]*D[0])**2))**0.5
E = D[0]-Z;
Q2 = 1.705*B[1]*E**1.5;
print "Volume flow rate (m3/s) :",round(Q2,4)
from __future__ import division
import math
#Initializing the variables
a =0.5;
b = 0.5;
Dn = 1.2;
s = 1/1000;
C = 55;
g = 9.81;
#Calculations
c = (1+a)/b;
QbyB = Dn*C*(Dn*s)**0.5;
q = QbyB;
Dc = (q**2/g)**(1/3);
header = "Mean Depth(Dm) Numenator Denominator\t L"
unit = " (m) \t \t \t \t(m)"
m=[]
Dm=[]
N=[]
D=[]
Lm=[]
total=0
for c in range(7):
m.append(2.4-0.15*c);
Dm.append((m[c]+m[c]-0.15)/2);
N.append(1 - (Dc/Dm[c])**3) ; # Numerator
D.append(1 - (Dn/Dm[c])**3); # Denominator
Lm.append(150*(N[c]/D[c]));
total = total +Lm[c];
print header
print unit
for c in range(7):
mm=str(Dm[c])+'\t '+str(round(N[c],4))+' '+str(round(D[c],4))+' \t'+str(round(Lm[c],2))
print mm
print "\ndistance upstream covered (approx in m):",round(total)