import math
#design irrigation channel on Kennedy's theory
#Given
Q = 45; #discharge
N = 0.0225; #rogosity coefficient
m = 1.05; #critical velocity ratio
S = 1./5000; #bed slope
D = 2; #assume
Vo = 0.55*m*D**0.64;
A = Q/Vo;
#for a trapezoidal section
B = (A-0.5*D**2)/2;
P = B+D*5**0.5;
R = A/P;
C = (23+1/N+0.00155/S)*(R*S)**0.5/(1+(23+0.00155/S)*N/R**0.5);
V = C*(R*S)**0.5;
#Vo<V
#assume D = 2.2
D = 2.2;
Vo = 0.55*m*D**0.64;
A = Q/Vo;
B = (A-0.5*D**2)/D;
P = B+D*5**0.5;
R = A/P;
C = (23+1/N+0.00155/S)*(R*S)**0.5/(1+(23+0.00155/S)*N/R**0.5);
V = C*(R*S)**0.5;
#ratio of V and Vo is almost equal to 1
# Results
B = round(B*10)/10;
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
from numpy import roots
#design an irrigation canal for given data
#Given
Q = 14; #discharge
m = 1; #critical velocity ratio
r = 5.7; #B/D
D = (Q/(0.55*6.2))**(1/2.64);
B = D*r;
R = (B*D+D**2/2)/(B+D*5**0.5);
Vo = 0.55*m*D**0.64;
#applying kutters formula; V = C(RS)**0.5
#where C = (23+1/N+0.00155/S)*(R*S)**0.5/(1+(23+0.00155/S)*N/R**0.5);
#assuming S**0.5 = y
#y = poly1d([-1.98D-5,1.55D-3,-0.954,67.5],'x','c');
#roots(y);
#taking real values of y
S = 0.0139906**2;
B = round(B*100)/100;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
#design a channel on Kennedy's theory
#Given
Q = 45.; #discharge
m = 1.05; #critical velocity ratio
N = 0.025; #rugosity coefficient
S = 1./5000; #bed slope
# Calculations
l = S*Q**0.02/(N**2*m**2.02);
#from fig.14.3 we get r = 10
#solving the equation by trial and error method we get
r = 9.7;
D = (1.818*Q/(m*(r+0.5)))**(1/2.64);
B = r*D;
V = Q/(D**2*(r+0.5));
Vo = 0.55*D**0.64*m;
B = round(B);
D = round(D*100)/100;
V = round(V*1000)/1000;
Vo = round(Vo*1000)/1000;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Velocity through the channel section = %.2f m/s."%(V);
print "Vo = %.2f m/s.Hence Safe"%(Vo);
import math
#design channel umath.sing method of curve fitting based onKennedy's theory
#Given
Q = 45.; #discharge
N = 0.0225; #rugosity coefficient
m = 1.05; #critical velocity ratio
S = 1./5000; #Bed slope
r = (1.607*S**1.63*Q**0.033/(N**3.26*m**3.293)-0.258)**(-0.915);
D = (1.818*Q/(m*(r+0.5)))**(1/2.64);
B = r*D;
B = round(B);
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
#design channel umath.sing curve of CWPC for B/D ratio
#Given
Q = 45.; #discharge
N = 0.0225; #rugosity coefficient
m = 1.05; #critical velocity ratio
r = (15+6.44*Q)**0.382;
S = (N**2/1.338*Q**0.02)*(0.258+(15+6.44*Q)**(-0.417))**0.6135;
D = (1.818*Q/(m*(r+0.5)))**(1/2.64);
B = r*D;
B = round(B);
D = round(D*100)/100;
# Results
print "Bed slope = %.2e."%(S);
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
#design the channel section umath.sing the following data and calculate math.logitudnal section
#Given
Q = 30.; #discharge
f = 1.; #silt factor
s = 1./2; #side slope
V = (Q*f/140)**(1./6);
A = Q/V;
P = 4.75*Q**0.5;
D = (P-(P**2-6.944*A)**0.5)/3.472;
B = P-2.236*D;
R = 5*V**2/(2*f);
S = f**(5./3)/(3340*Q**(1./6));
B = round(B*100)/100;
D = round(D*100)/100;
# Results
print "Bed slope = %.2e."%(S);
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
from numpy import roots
#design a channel in alluvial soil umath.sing tractive force approach
#Given
Q = 45.; #discharge
S = 1./4800; #bed slope
N = 0.0225; #rogosity coefficient
sigma = 0.0035; #permissible tractive stress
s = 1./2; #side slope
gamma_w = 9.81; #unit weigth of water
# Calculations
R = sigma/(gamma_w*S);
V = R**(2./3)*S**0.5/N;
A = Q/V;
P = A/R;
#y = poly1d([-49,28.61,-1.736],'x','c');
y = [-1.736,28.61,-49]
D = roots(y)[1];
#we get D = 14.539034 and 1.9413812
#taking D = 1.9413812
B = 28.61-2.23*D;
B = round(B*100)/100;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
from numpy import roots
#designa channel section by Kennedy theory
#Given
Q = 28.; #discharge
m = 1.; #critical velocity ratio
r = 7.6; #B/D
D = (Q/4.46)**(1/2.64);
B = r*D;
R = 0.823*D;
V = 0.55*(D)**0.64;
#applying kutters formula; V = C(RS)**0.5
#where C = (23+1/N+0.00155/S)*(R*S)**0.5/(1+(23+0.00155/S)*N/R**0.5);
#we get equation in S
#assuming S**0.5 = y
#y = poly([-1.42D-5,1.55D-3,-0.885,67.4],'x','c');
y = [67.4,-0.885,1.55e-3,-1.42e-5]
d = roots(y)[0];
#taking real values of y
S = d.real**2;
B = round(B*10)/10;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
#design the channel section and calculate discharge
#Given
r = 5.7; #B/D
S = 1./5000; #bed slope
N = 0.0225; #rogosity coefficient
m = 1; #critical velocity ratio(assumed)
#applying kutters formula; V = C(RS)**0.5
#where C = (23+1/N+0.00155/S)*(R*S)**0.5/(1+(23+0.00155/S)*N/R**0.5);
#we get equation in d as
#38.88*D**0.64-66.5*D**0.5+30.37*D**0.14 = 0
#solving it by trial and error method
#we get D = 1.7 m.
D = 1.7;
B = r*D;
V = 0.55*m*(D)**0.64;
A = B*D+D**2/2;
Q = A*V;
Q = round(Q*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print " Discharge = %.2f cumecs."%(Q);
import math
from numpy import roots
#design irrigation channel according to Laecy silt theory
#Given
Q = 15.; #discharge
f = 1.; #laecy silt factor
s = 1./2; #channel side slope
V = (Q*f**2/140);
A = Q/V;
R = 5*V**2/(2*f);
#umath.sing the value of A in equations we get,
#equation in D as
y = [-1.73,18.336,-21.765]
D = roots(y)[1];
#we get D = 9.2368003 and 1.3620436.
#taking
D = 1.3620436;
B = 18.336-D*2.23;
P = 4.75*Q**0.5;
S = 1/(3340*Q**(1./6));
B = round(B*10)/10;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
from numpy import roots
#find channel section and discharge
#Given
S = 1./5000; #bed slope
s = 1./2; #side slope
f = 0.9; #laecy silt factor
Q = (f**(5./3)/(3340*S))**6;
R = f**3/(4980*S)**2;
P = 4.75*Q**0.5;
A = P*R;
#umath.sing the value of A and P in equations we get,
#equation in D as
y = [-1.73,9.41,-6.961]
D = roots(y)[1];
#we get D = 4.5561754 and 0.8831309.
#taking D = 0.8831309;
B = 9.41-D*2.23;
B = round(B*100)*100;
D = round(D*100)/100;
Q = round(Q*1000)/1000;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print " Discharge = %.2f cumecs."%(Q);
import math
#Given
gamma_w = 9.81; #unit weigth of water
D = 3.; #depth of channel
d = 0.3; #grain size
k = 1.5; #size of roughness of channel bed
S = 1./4400; #bed slope
G = 2.65; #specific gravity
# Calculations
tau_b = gamma_w*D*S;
N1 = d**(1./6)/24;
N = k**(1./6)/24;
gamma_s = gamma_w*G;
tau_c = 0.047*(gamma_s-gamma_w)*d/1000;
r = (N1/N)**1.5;
q = 47450*(tau_b*r-tau_c)**1.5;
q = round(q*100)/100;
# Results
print "quantity of bed load moved = %.2f kN/m/hr."%(q);
import math
#Given
gamma_w = 9.81; #unit weigth of water
D = 3.; #depth of channel
d = 0.3; #grain size
k = 1.5; #size of roughness of channel bed
S = 1./4400; #bed slope
G = 2.65; #specific gravity
# Calculations
N1 = d**(1./6)/24;
N = k**(1./6)/24;
r = (N1/N)**1.5;
R1 = 3*r;
si = (G-1)*d/(1000*R1*S);
#hence we get
fi = 7;
q = 3600*fi*G*gamma_w*(G-1)**0.5*(gamma_w)**0.5*(d/1000)**1.5;
q = round(q*10)/10;
# Results
print "quantity of bed load moved = %.2f kN/m/hr."%(q);
import math
#Given
gamma_w = 9.81; #unit weigth of water
D = 3.; #depth of channel
d = 0.3; #grain size
k = 1.5; #size of roughness of channel bed
S = 1./4400; #bed slope
G = 2.65; #specific gravity
V = 0.03; #fall velocity
c_ = 400; #concentration at 0.3 m above bed
a = 0.3;
y = 1.;
k_ = 0.4; #van karman's consmath.tant
# Calculations
N1 = d**(1./6)/24;
N = k**(1./6)/24;
r = (N1/N)**1.5;
R1 = 3*r;
V_ = (gamma_w*R1*S)**0.5;
c = c_*((a/y)*(D-y)/(D-a))**(V/(V_*k_));
c = round(c*10)/10;
# Results
print "concentration of suspended load = %.2f ppm."%(c);
import math
from numpy import roots
#design an irrigation channel by Meyer peter equation
#Given
Q = 45; #discharge
c = 55; #bed load concentraion
d = 0.3; #average grain diameter
gamma_w = 9.81; #unit weigth of water
G = 2.67;
f = 0.964;
c = c*Q*gamma_w*3600/1000000;
P = 4.75*Q**0.5;
#taking channel width as B = 28 m(slightly less than P)
B = 28.;
qs = c/B;
#assuming effective grain diameter k = 0.4 mm
ks = 0.4e-3;
N1 = ks**(1./6)/24;
sf = 1.76*d**0.5;
N = 0.0225*sf**0.25;
r = N1/N;
tau_c = 0.047*gamma_w*(G-1)*d/1000;
tau_b = r**1.5*((qs/47450)**(2./3)+tau_c);
#from Manning's formula we get on simplification
R = (0.000992*1000/0.525)**(3./7);
S = 0.525/(1000*R);
#solving equation of R for trapezoidal section of side slope 1/2 we get
y = [0.5,25.06,-36.792]
D = roots(y)[1];
#we get D = -51.547499 and 1.4274989
#taking D = 1.4274989;
D = round(D*100)/100;
# Results
print "Width of channel section = %i m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
from numpy import roots
#design an irrigation channel by Einstein equation
#Given
Q = 45.; #discharge
c = 55.; #bed load concentraion
d = 0.3; #average grain diameter
gamma_w = 9.81; #unit weigth of water
G = 2.67; #specific gravity of soil
f = 0.964; #silt factor
#taking channel width as B = 28 m(slightly less than P)
B = 28.;
qs = c/B;
fi = (qs/(gamma_w*G))*(1/(G-1))**0.5*(1000000000/(gamma_w*d**3))**0.5;
#from fig. 14.6 we get value of sci
#umath.sing the sci equation and Manning formula and on simplifications we get
R = (2.4296)**(3./7);
S = 0.4083/(1000*1.463);
#solving equation of R for trapezoidal section of side slope 1/2 we get
y = [0.5,24.73,-40.96]
D = roots(y)[1];
#we get D = -51.064253 and 1.6042534
#taking D = 1.6042534;
D = round(D*10)/10;
# Results
print "Width of channel section = %i m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
from numpy import roots
#design a channel for non-alluvial deposites
#Given
Q = 45.; #discharge
S = 1./4000; #bed slope
v = 0.9; #permissible velocity
N = 0.025; #rogosity coefficient
# Calculations
A = Q/v;
R = (v*N/S**0.5)**1.5;
P = A/R;
#let us provide a trapezoidal section
#from equation of Area and Perimeter of trapezoid
y = [1.828,-29.45,50]
D = roots(y)[1];
#from which we get D = 14.181815 and 1.9286881
#taking D = 1.9286881;
B = P-2*1.41*D;
D = round(D*100)/100;
# Results
print "Width of channel section = %i m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
#design non-allvial channel umath.sing Bazin's formula
#Given
Q = 15.; #discharge
V = 0.75; #mean velocity
s = 1.; #side slope
K = 1.3; #bazin's coefficient
#width is five times its depth
# Calculations
A = Q/V;
D = (A/6)**0.5;
B = 5*D;
P = B+2*D*1.41;
R = A/P;
C = 87/(1+K/(R)**0.5);
S = (V/C)**2/R;
B = round(B*10)/10;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
#determine dimension of channel umath.sing chezy's equation
#Given
Q = 21.5; #discharge
S = 1./2500; #slope of bottom
C = 70;
r = 1/1.73;
#taking R = 0.5*D
# Calculations and Results
#and keeping it in Q = V*A;where V = C(RS)**0.5 and A = D**2(2*(4/3)**0.5-1/3**0.5);
D = (21.5/1.7146)**(1/2.5);
B = 2*D*((4./3)**0.5-(1./3)**0.5);
B = round(B*100)/100;
D = round(D*100)/100;
print "side slope = %.2f."%(r);
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
R = 0.5*D;
V = C*(R*S)**0.5;
n = R**(2./3)*S**0.5/V;
n = round(n*1000)/1000;
print "value of manning n = %.2f."%(n);
import math
#design a regime channel
#Given
Q = 100; #discharge
f = 1.1; #silt factor
s = 1./2; #side slope
# Calculations
V = (Q*f**2/140)**(1./6);
A = Q/V;
P = 4.75*Q**0.5;
D = (P-(P**2-6.944*A)**0.5)/3.472;
B = P-2.236*D;
R = 5*V**2/(2*f);
S = f**(5./3)/(3340*Q**(1./6));
B = round(B*10)/10;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
from numpy import poly1d,roots
#design a channel umath.sing Laecy theory
#Given
Q = 40.; #discharge
s = 1.; #side slope
md = 0.8; #average size of base material
# Calculations
f = 1.76*(md)**0.5;
V = (Q*f**2/140)**(1./6);
A = Q/V;
P = 4.75*Q**0.5;
#from equations of Area and perimeter of trapezoidal section;we get
y = poly1d([42.41,-30.04,1.828],'x','c');
D = roots(y)[0];
#we get D = 14.873416 and 1.5598447
#taking
D = 1.5598447;
B = A/D-D;
R = 5*V**2/(2*f);
S = f**(5./3)/(3340*Q**(1./6));
B = round(B*100)/100;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
#Given
Q = 30.; #discharge
V = 1.; #velocity of flow
# Calculations
A = Q/V;
#perimeter of section = 30/D-D/2
#taking its derivative w.r.t to D
D = 1/((1.914/30)**0.5);
#from equation of area
B = 30/D-D/2;
B = round(B*10)/10;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
#determine whether flow is critical or sub-critical
#Given
Q = 17.; #discharge
B = 6.; #base of channel
s = 1./2; #side slope
D = 1.5; #depth of channel
# Calculations
A = D*((B+B/s)/2);
V = Q/A;
P = B+2*((D/s)**2+D**2)**0.5;
R = A/P;
F = V/(9.81*R)**0.5; #froud number
F = round(F*100)/100;
# Results
#math.since F<1;
print "Froud number = %.2f.F<1.Flow is sub-critical"%(F);
import math
#Given
B = 3.5; #bottom width of channel
n = 0.016; #manning n
S = 2.6/10000; #bed slope
Q = 8; #discharge
lfs = 1; #left side slope
rhs = 1.5; #rigth side slope
gamma_w = 9.81; #unit weigth of water
# Calculations
#umath.sing the equation of area and perimeter of trapezoidal section;Manning's formula and V = Q/A we get D as
#Manning formula: V = R**(2/3)*S**0.5/n
#(D*(3.5+1.25*D))**2.5 = 78.281+71.951*D
#solving it by trial and error method;we get
D = 1.5;
R = (D*(3.5+1.25*D))/(3.5+3.217*D);
tau = gamma_w*R*S*1000;
tau = round(tau*100)/100;
# Results
print "Depth of section = %.2f m."%(D);
print "Average shear stress at channel bed = %.2f N/square-mm."%(tau);
import math
#Given
S = 1./5000; #bed slope
B = 40.; #width of channel
D = 2.6; #depth of channel
d = 0.38; #mean diameter of bed material
n = 0.021; #Manning n
D65 = 0.64e-3; #bed material size(m)
w = 1000.; #density of water
# Calculations
#B/D as large tau_c = 0.075*d;
tau_c = 0.075*d;
tau_b = w*D*S;
N1 = (D65)**(1./6)/24;
r = N1/n;
qs = 4700*24*(tau_b*r**1.5-tau_c)**1.5/1000;
qs40 = qs*40;
# Results
print "bed load transported by the channel = %i t/m/day."%(qs40);
import math
#Given
Q = 5.; #discharge
S = 0.2/1000; #bed slope
m = 0.8; #critical velocity ratio
s = 1./2; #side slope of chanel
C = 30.;
#assuming
# Calculations
D = 1.;
Vo = 0.55*m*D**0.64;
A = Q/Vo;
B = A/D-(s*D);
P = B+2.43*D;
R = A/P;
V = C*(R*S)**0.5;
#Vo>V
#hence take second trial
D = 0.8; #assume
Vo = 0.55*m*D**0.64;
A = Q/Vo;
B = A/D-(s*D);
P = B+2.43*D;
R = A/P;
V = C*(R*S)**0.5;
#again Vo>V
#hence we take third trial
D = 0.7;
Vo = 0.55*m*D**0.64;
A = Q/Vo;
B = A/D+(s*D);
P = B+2.43*D;
R = A/P;
V = C*(R*S)**0.5;
B = round(B*100)/100;
#Vo is almost equal to V;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
#design irrigation channel by Kennedy method
#Given
Q = 50.; #discharge
r = 2.5; #B/D ratio
m = 1.1; #critical velocity ratio
N = 0.025; #rogosity coefficient
s = 0.5; #side slope of channel
# Calculations
#umath.sing the equation of Vo and Q = A*V;we get
D = (Q/1.815)**(1/2.64);
B = r*D;
R = (B*D+0.5*D**2)/(B+2.236*D);
Vo = 0.55*m*D**0.64;
#applying kutters formula; V = C(RS)**0.5
#where C = (23+1/N+0.00155/S)*(R*S)**0.5/(1+(23+0.00155/S)*N/R**0.5);
#assuming S**0.5 = y
#taking real values of y
S = 0.0196171 **2;
B = round(B*100)/100;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
#design a regime channel umath.sing Laecy's theory
#Given
Q = 35; #discharge
f = 0.9; #silt factor
s = 1./2; #side slope
# Calculations
V = (Q*f/140)**(1./6);
A = Q/V;
P = 4.75*Q**0.5;
D = (P-(P**2-6.944*A)**0.5)/3.472;
B = P-2.236*D;
R = 5*V**2/(2*f);
S = f**(5./3)/(3340*Q**(1./6));
D = round(D*100)/100;
# Results
print "Bed slope = %.2e."%(S);
print "Width of channel section = %i m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
from numpy import roots
#design an irrigation canal for given data
#Given
Q = 15.; #discharge
m = 1.; #critical velocity ratio
r = 5.7; #B/D
D = (Q/(0.55*6.2))**(1/2.64);
B = D*r;
R = (B*D+D**2/2)/(B+D*5**0.5);
Vo = 0.55*m*D**0.64;
#applying kutters formula; V = C(RS)**0.5
#where C = (23+1/N+0.00155/S)*(R*S)**0.5/(1+(23+0.00155/S)*N/R**0.5);
#assuming S**0.5 = y
y = [67.5,-0.968,1.55e-3,-2e-5]
d = roots(y)[0];
#taking real values of y
S = d.real**2;
B = round(B*100)/100;
D = round(D*100)/100;
# Results
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
#Design a section of unlined canal in a loomy soil
#Given
Q = 50.; #discharge
V = 1.; #permissible velocity
s = 2.; #side slope
r = 6.; #B/D ratio
N = 0.0225; #rogosity coefficient
# Calculations
A = Q/V;
D = (A/(r+2))**0.5;
B = r*D;
P = B+2*(5*D**2)**0.5;
R = A/P;
S = (V*N/R**(2/3))**2;
# Results
print "Width of channel section = %i m."%(B);
print "Depth of channel section = %.2f m."%(D);
print "Bed slope = %.2e."%(S);
import math
#Given
gamma_w = 9.81; #unit weigth of water
D = 5.; #depth of channel
d = 0.3; #grain size
k = 1.5; #size of roughness of channel bed
S = 1./4000; #bed slope
G = 2.65; #specific gravity
V = 0.02; #fall velocity
c_ = 1000.; #concentration at 0.3 m above bed
a = 0.3;
y = 2.5;
k_ = 0.4; #van karman's consmath.tant
# Calculations
R = 5; #R = D for wide channel
V_ = (gamma_w*R*S)**0.5;
c = c_*((a/y)*(D-y)/(D-a))**(V/(V_*k_));
# Results
print "concentration of suspended load = %i ppm."%(c);
import math
#Given
Q = 40.; #discharge
f = 1.; #silt factor
# Calculations and Results
#Laecey's theory
V = (Q*f/140)**(1./6);
A = Q/V;
P = 4.75*Q**0.5;
D = (P-(P**2-6.944*A)**0.5)/3.472;
B = P-2.236*D;
R = 5*V**2/(2*f);
S = f**(5./3)/(3340*Q**(1./6));
B = round(B);
D = round(D*100)/100;
print "By Laecey theory:";
print "Bed slope = %.2e."%(S);
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
#Kennedy's theory
r = B/D;
m = 1.; #critical velocity ratio
N = 0.0225; #rogosity coefficient
#umath.sing equation of area of trapezoidal section;Vo = 0.55mD**0.64 and Q = A*Vo
D = (Q/8.058)**(1/2.64);
B = r*D;
B = round(B);
D = round(D*100)/100;
print "By Kennedy theory:";
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
#design Laecey regime channel
#Given
A = 100000.; #culturable area(hectare)
IR = 0.4; #intensity of irrigation in kharif season
IK = 0.3; #intensity of irrigation in rabi season
OR = 1800.; #outlet discharge factor in kharif season
OK = 800.; #outlet discharge factor in kharif season
l = 0.1; #conveyance loss
md = 0.328; #average diameter of material
# Calculations
AR = A*IR; #area under rabi
AK = A*IK; #area under kharif
Qr = AR/OR;
Qk = AK/OK;
Q = 1.1*Qk;
f = 1.76*(md)**0.5;
V = (Q*f**2/144)**(1./6);
A = Q/V;
P = 4.75*(Q)**0.5;
D = (P-(P**2-6.944*A)**0.5)/3.472;
B = P-2.236*D;
S = f**(5/3)/(3340*Q**(1./6));
B = round(B*10)/10;
D = round(D*100)/100;
# Results
print "Bed slope = %.2e."%(S);
print "Width of channel section = %.2f m."%(B);
print "Depth of channel section = %.2f m."%(D);
import math
#Given
D = 2.8; #depth of flow
c_ = 700; #concentration at 30 cm below water surface
y = 0.1;
a = D-0.3;
e = 0.4; #exponent in rouse equation;
# Calculations
c = c_*(a*(D-y)/(y*(D-a)))**e;
# Results
print "concentration at point 10 cm above the bed = %i ppm."%(c);
import math
#design the distributory umath.sing Laecey theory
#Given
f = 0.85; #silt factor
AR = 3600.; #area for rabi
AK = 1400.; #area for kharif
delta_r = 0.135; #kor depth for rabi
delta_k = 0.19; #kor depth for kharif
tr = 4.; #kor period for rabi
tk = 2.5; #kor period for kharif
# Calculations
Du_r = 8.64*tr*7/delta_r; #duty for rabi
Du_k = 8.64*tk*7/delta_k; #duty for kharif
q_r = AR/Du_r; #discharge for rabi
q_k = AK/Du_k; #discharge for kharif
Q = q_r; #math.since q_r>q_k
V = (Q*f**2/144)**(1./6);
A = Q/V;
P = 4.75*(Q)**0.5;
D = (P-(P**2-6.944*A)**0.5)/3.472;
S = f**(5./3)/(3340*Q**(1./6));
P = round(P*100)/100;
D = round(D*100)/100;
# Results
print "Bed slope = %.2e."%(S);
print "Perimeter of channel section = %.2f m."%(P);
print "Depth of channel section = %.2f m."%(D);