blob: 58da30975bc7ce9ac6c326df74b985c91366cf4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
clc; funcprot(0); //Example 16.3
//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*sqrt(Dn*s);
q = QbyB;
Dc = (q^2/g)^(1/3);
m = 2.4:-0.15:1.35;
total = 0;Dm = 0; N = 0; D = 0; Lm = 0;
for(i=1:length(m)-1)
Dm(i)= (m(i)+m(i+1))/2;
N(i) = 1 - (Dc/Dm(i))^3 ; // Numerator
D(i) = 1 - (Dn/Dm(i))^3; // Denominator
Lm(i) = 150*(N(i)/D(i));
total = total +Lm(i);
end
result = [Dm N D Lm];
disp(total,"distance upstream covered (approx in m):",result,"Mean Depth(Dm) Numerator Denominaotor L(m)");
|