From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 557/CH16/EX16.3/3.sce | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 557/CH16/EX16.3/3.sce (limited to '557/CH16/EX16.3') diff --git a/557/CH16/EX16.3/3.sce b/557/CH16/EX16.3/3.sce new file mode 100755 index 000000000..58da30975 --- /dev/null +++ b/557/CH16/EX16.3/3.sce @@ -0,0 +1,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)"); -- cgit