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 --- 1379/CH5/EX5.1.1/example5_1.sce | 25 ++++++++++++++++++ 1379/CH5/EX5.1.10/example5_10.sce | 25 ++++++++++++++++++ 1379/CH5/EX5.1.11/example5_11.sce | 53 +++++++++++++++++++++++++++++++++++++++ 1379/CH5/EX5.1.2/example5_2.sce | 19 ++++++++++++++ 1379/CH5/EX5.1.3/example5_3.sce | 16 ++++++++++++ 1379/CH5/EX5.1.4/example5_4.sce | 34 +++++++++++++++++++++++++ 1379/CH5/EX5.1.5/example5_5.sce | 31 +++++++++++++++++++++++ 1379/CH5/EX5.1.6/example5_6.sce | 26 +++++++++++++++++++ 1379/CH5/EX5.1.7/example5_7.sce | 19 ++++++++++++++ 1379/CH5/EX5.1.8/example5_8.sce | 29 +++++++++++++++++++++ 1379/CH5/EX5.1.9/example5_9.sce | 21 ++++++++++++++++ 11 files changed, 298 insertions(+) create mode 100755 1379/CH5/EX5.1.1/example5_1.sce create mode 100755 1379/CH5/EX5.1.10/example5_10.sce create mode 100755 1379/CH5/EX5.1.11/example5_11.sce create mode 100755 1379/CH5/EX5.1.2/example5_2.sce create mode 100755 1379/CH5/EX5.1.3/example5_3.sce create mode 100755 1379/CH5/EX5.1.4/example5_4.sce create mode 100755 1379/CH5/EX5.1.5/example5_5.sce create mode 100755 1379/CH5/EX5.1.6/example5_6.sce create mode 100755 1379/CH5/EX5.1.7/example5_7.sce create mode 100755 1379/CH5/EX5.1.8/example5_8.sce create mode 100755 1379/CH5/EX5.1.9/example5_9.sce (limited to '1379/CH5') diff --git a/1379/CH5/EX5.1.1/example5_1.sce b/1379/CH5/EX5.1.1/example5_1.sce new file mode 100755 index 000000000..ad93ab2c7 --- /dev/null +++ b/1379/CH5/EX5.1.1/example5_1.sce @@ -0,0 +1,25 @@ + + +//exapple 5.1 +clc; funcprot(0); +// Initialization of Variable +rho=999.7; +g=9.81; +mu=1.308/1000; +s=1/6950; +b=0.65; +h=32.6/100; +n=0.016; +//calculation +//part1 +A=b*h; +P=b+2*h; +m=A/P; +u=s^.5*m^(2/3)/n; +Q=A*u +disp(Q,"volumetric flow rate (m^3/s):"); +C=u/m^0.5/s^0.5; +disp(C,"chezy coefficient (m^0.5/s):"); +a=-m*rho*g*s/mu;//delu/dely +disp(a,"velocity gradient in the channel (s^-1):") + diff --git a/1379/CH5/EX5.1.10/example5_10.sce b/1379/CH5/EX5.1.10/example5_10.sce new file mode 100755 index 000000000..020a780f5 --- /dev/null +++ b/1379/CH5/EX5.1.10/example5_10.sce @@ -0,0 +1,25 @@ + + +//exapple 5.10 +clc; funcprot(0); +// Initialization of Variable +pi=3.14; +n=0.022; +B=5.75; +s=0.15*pi/180; +Q=16.8; +function[y]=normal(x) + y=Q-B*x/n*(B*x/(B+2*x))^(2/3)*s^0.5; +endfunction +x=fsolve(1.33,normal); +disp(x,"Normal depth in (m):"); +Dc=(Q^2/g/B^2)^(1/3); +disp(Dc,"Critical depth in (m):"); +delD=.1; +D=1.55:.1:2.35 +su=0; +for i=1:9 + delL=delD/s*(1-(Dc/D(i))^3)/(1-(x/D(i))^3.33); + su=su+delL +end +disp(su,"distance in (m) from upstream to that place:") diff --git a/1379/CH5/EX5.1.11/example5_11.sce b/1379/CH5/EX5.1.11/example5_11.sce new file mode 100755 index 000000000..4547250d2 --- /dev/null +++ b/1379/CH5/EX5.1.11/example5_11.sce @@ -0,0 +1,53 @@ + + +//exapple 5.11 +clc; funcprot(0); +// Initialization of Variable +g=9.81; +q=1.49; +pi=3.14; +//calculation +//part1 +Dc=(q^2/g)^.333; +disp(Dc,"critical depth in (m):"); +//part2 +n=0.021; +su=1.85*pi/180;//slope upstream +sd=0.035*pi/180;//slope downstream +Dnu=(n*q/sqrt(su))^(3/5); +Dnu=round(Dnu*1000)/1000; +disp(Dnu,"normal depth upstream in (m):"); +Dnd=(n*q/sqrt(sd))^(3/5); +disp(Dnd,"normal depth downstream in (m):"); +//part3 +D2u=-0.5*Dnu*(1-sqrt(1+8*q^2/g/Dnu^3)); +D2u=round(D2u*1000)/1000; +disp(D2u,"conjugate depth for upstream in (m):"); +D1d=-0.5*Dnd*(1-sqrt(1+8*q^2/g/Dnd^3)); +disp(D1d,"conjugate depth for downstream in (m):"); +//part4 +//accurate method +delD=.022; +D=0.987:.022:1.141 +dis=0; +for i=1:8 + delL=delD/su*(1-(Dc/D(i))^3)/(1-(Dnu/D(i))^3.33); + dis=dis+delL +end +disp(dis,"distance in (m) of occurence of jump by accurate method:"); +//not so accurate one +E1=D2u+q^2/2/g/D2u^2; +E2=Dnd+q^2/2/g/Dnd^2; +E2=round(E2*1000)/1000; +E1=round(E1*1000)/1000; +ahm=(D2u+Dnd)/2;//av. hydraulic mean +afv=.5*(q/D2u+q/Dnd);//av. fluid velocity +i=(afv*0.021/ahm^(2/3))^2; +l=(E2-E1)/(su-i+0.0002); +disp(l,"distance in (m) of occurence of jump by not so accurate method:") +//part5 +rho=998; +Eu=Dnu++q^2/2/g/Dnu^2; +Eu=round(Eu*1000)/1000; +P=rho*g*q*(Eu-E1); +disp(P/1000,"power loss in hydraulic jump per unit width in (kW):") diff --git a/1379/CH5/EX5.1.2/example5_2.sce b/1379/CH5/EX5.1.2/example5_2.sce new file mode 100755 index 000000000..107a6c361 --- /dev/null +++ b/1379/CH5/EX5.1.2/example5_2.sce @@ -0,0 +1,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):") diff --git a/1379/CH5/EX5.1.3/example5_3.sce b/1379/CH5/EX5.1.3/example5_3.sce new file mode 100755 index 000000000..04660eca2 --- /dev/null +++ b/1379/CH5/EX5.1.3/example5_3.sce @@ -0,0 +1,16 @@ + + +//exapple 5.3 +clc; funcprot(0); +// Initialization of Variable +n=0.011; +h=0.12; +Q=25/10000; +//calculation +deff('y=f(x)','y=1/x^2-1'); +x=fsolve(0.1,f); +theta=2*atan(x); +A=h*2*h/tan(theta/2)/2; +P=2*h*sqrt(2); +s=Q^2*n^2*P^(4/3)/A^(10/3); +disp(s,"the slope of channel in (radians):") diff --git a/1379/CH5/EX5.1.4/example5_4.sce b/1379/CH5/EX5.1.4/example5_4.sce new file mode 100755 index 000000000..f4ff5d23c --- /dev/null +++ b/1379/CH5/EX5.1.4/example5_4.sce @@ -0,0 +1,34 @@ + + +//exapple 5.4 +clc; funcprot(0); +// Initialization of Variable +//part1 +//maximizing eqution in theta & get a function +function[y]=theta(x) + y=(x-.5*sin(2*x))/2/x^2-(1-cos(2*x))/2/x; +endfunction +x=fsolve(2.2,theta); +x=round(x*1000)/1000; +a=(1-cos(x))/2; +printf("velocity will be maximum when stream depth in times of diameter is %.3f",a); +//part2 +//maximizing eqution in theta & get a function +function[y]=theta2(x) + y=3*(x-.5*sin(2*x))^2*(1-cos(2*x))/2/x-(x-.5*sin(2*x))^3/2/x^2 ; +endfunction +x1=fsolve(2.2,theta2); +x1=round(x1*1000)/1000; +a=(1-cos(x1))/2; +disp("") +printf("vlumetric flow will be maximum when stream depth in times of diameter is %.3f",a); +//part3 +r=1; +A=1*x-0.5*sin(2*x); +s=0.35*3.14/180; +P=2*x*r; +C=78.6; +u=C*(A/P)^0.5*s^0.5; +disp(u,"maximum velocity of obtained fluid (m/s):"); +//part4 +disp(x1,"maximum flow rate obtained at angle in (radians):") diff --git a/1379/CH5/EX5.1.5/example5_5.sce b/1379/CH5/EX5.1.5/example5_5.sce new file mode 100755 index 000000000..6621ed73a --- /dev/null +++ b/1379/CH5/EX5.1.5/example5_5.sce @@ -0,0 +1,31 @@ + + +//exapple 5.5 +clc; funcprot(0); +// Initialization of Variable +g=9.81; +h=28/100; +Cd=0.62; +B=46/100; +Q=0.355; +n=2;//from francis formula +//calcualtion +//part1 +u=sqrt(2*g*h); +disp(u,"velocity of fluid (m/s):"); +//part2a +H=(3*Q/2/Cd/B/(2*g)^0.5)^(2/3); +disp(H,"fluid depth over weir in (m):"); +//part2b +//using francis formula +function[y]=root(x) + y=Q-1.84*(B-0.1*n*x)*x^1.5; +endfunction +x=fsolve(0.2,root); +disp(x,"fluid depth over weir in if SI units uesd in (m):"); +//part3 +H=18.5/100; +Q=22/1000; +a=15*Q/8/Cd/(2*g)^0.5/H^2.5; +theta=2*atan(a); +disp(theta*180/3.14,"base angle of the notch of weir (degrees)") diff --git a/1379/CH5/EX5.1.6/example5_6.sce b/1379/CH5/EX5.1.6/example5_6.sce new file mode 100755 index 000000000..62dbacf5b --- /dev/null +++ b/1379/CH5/EX5.1.6/example5_6.sce @@ -0,0 +1,26 @@ + + +//exapple 5.6 +clc; funcprot(0); +// Initialization of Variable +Q=0.675; +B=1.65; +D=19.5/100; +g=9.81; +//caculation +u=Q/B/D; +u=round(u*1000)/1000; +E=D+u^2/2/g; +y=poly([8.53/1000 0 -E 1],'x','coeff'); +x=roots(y); +disp(x(1),"alternative depth in (m)"); +disp("It is shooting flow"); +Dc=2/3*E; +Qmax=B*(g*Dc^3)^0.5; +disp(Qmax,"maximum volumetric flow (m^3/s)"); +Fr=u/sqrt(g*D); +disp(Fr,"Froude no."); +a=(E-D)/E; +disp(a*100,"% of kinetic energy in initial system"); +b=(E-x(1))/E; +disp(b*100,"% of kinetic energy in final system"); diff --git a/1379/CH5/EX5.1.7/example5_7.sce b/1379/CH5/EX5.1.7/example5_7.sce new file mode 100755 index 000000000..507f6308d --- /dev/null +++ b/1379/CH5/EX5.1.7/example5_7.sce @@ -0,0 +1,19 @@ + + +//exapple 5.7 +clc; funcprot(0); +// Initialization of Variable +G=338;//mass flow rate +rho=998; +q=G/rho; +E=0.48; +n=0.015; +g=9.81; +B=0.4; +y=poly([5.85/1000 0 -E 1],'x','coeff'); +x=roots(y); +disp(x(1),x(2),"alternate depths (m):"); +s=(G*n/rho/x(2)/(B*x(2)/(B+2*x(2)))^(2/3))^2 +disp(s,"slode when depth is 12.9cm"); +s=(G*n/rho/x(1)/(B*x(1)/(B+2*x(1)))^(2/3))^2 +disp(s,"slode when depth is 45.1cm"); diff --git a/1379/CH5/EX5.1.8/example5_8.sce b/1379/CH5/EX5.1.8/example5_8.sce new file mode 100755 index 000000000..47945281f --- /dev/null +++ b/1379/CH5/EX5.1.8/example5_8.sce @@ -0,0 +1,29 @@ + + +//exapple 5.8 +clc; funcprot(0); +// Initialization of Variable +pi=3.14; +theta=pi/3; +h=1/tan(theta); +B=0.845; +E=0.375; +g=9.81; +//calculation +//part1 +//deducing a polynomial(quadratic) in Dc +a=5*h; +b=3*B-4*h*E; +c=-2*E*B; +y=poly([c b a],'x','coeff'); +x=roots(y); +disp(x(2),"critical depth in (m):"); +//part2 +Ac=x(2)*(B+x(2)*tan(theta/2)); +Btc=B+x(2)*tan(theta/2)*2; +Dcbar=Ac/Btc; +uc=sqrt(g*Dcbar); +disp(uc,"critical velocity (m/s):"); +//part3 +Qc=Ac*uc; +disp(Qc,"Critical volumetric flow (m^3/s):"); diff --git a/1379/CH5/EX5.1.9/example5_9.sce b/1379/CH5/EX5.1.9/example5_9.sce new file mode 100755 index 000000000..119d8f7c6 --- /dev/null +++ b/1379/CH5/EX5.1.9/example5_9.sce @@ -0,0 +1,21 @@ + + +//exapple 5.9 +clc; funcprot(0); +// Initialization of Variable +B2=1.60;//breadth at 2 +D2=(1-0.047)*1.27;//depth at 2 +g=9.81; +B1=2.95;//breadth at 1 +D1=1.27;//depth at 1 +Z=0; +//calculation +Q=B2*D2*(2*g*(D1-D2-Z)/(1-(B2*D2/B1/D1)^2))^0.5; +disp(Q,"volumetric flow rate over flat topped weir over rectangular section in non uniform width(m^3/s)"); +//next part +B2=12.8; +D1=2.58; +Z=1.25; +Q=1.705*B2*(D1-Z)^1.5; +disp(Q,"volumetric flow rate over flat topped weir over rectangular section in uniform width (m^3/s):") + -- cgit