blob: 107a6c361fc55a14fbdf5a94b2f14f786fb47992 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
//exapple 5.2
clc; funcprot(0);
// Initialization of Variable
Q=0.885;
pi=3.1428;
s=1/960;
s=round(s*1000000)/1000000;
b=1.36;
n=0.014;
theta=55*pi/180;
//calculation
function[y]=flow(x);
a=(x*(b+x/tan(theta)))/(b+2*x/sin(theta));
y=a^(2/3)*s^(1/2)*(x*(b+x/tan(theta)))/n-Q;
endfunction
x=fsolve(0.1,flow);
disp(x,"depth of water in (m):")
|