summaryrefslogtreecommitdiff
path: root/51/CH8/EX8.13/8_13.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /51/CH8/EX8.13/8_13.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '51/CH8/EX8.13/8_13.sce')
-rwxr-xr-x51/CH8/EX8.13/8_13.sce33
1 files changed, 33 insertions, 0 deletions
diff --git a/51/CH8/EX8.13/8_13.sce b/51/CH8/EX8.13/8_13.sce
new file mode 100755
index 000000000..50ff1dbad
--- /dev/null
+++ b/51/CH8/EX8.13/8_13.sce
@@ -0,0 +1,33 @@
+clc;
+clear;
+T=60;//degree F
+kvis=1.28*(10^(-5));//(ft^2)/sec
+l=1700;//ft
+roughness=0.0005;//ft
+Q=26;//(ft^3)/sec
+n=4;//number of flanged 45 degree elbows
+z1=44;//ft
+x=Q/(%pi/4);//where x=V*(D^2)
+KLentrance=0.5;
+KLelbow=0.2;
+KLexit=1;
+//Finding f from Re, roughness and moody's chart
+f=0.01528;
+sumKL=(n*KLelbow)+KLentrance+KLexit;
+y=f*l;
+//V^2 = (x^2)/(D^4)
+//energy equation with p1=p2pV1=V2=z2=0
+z=(2*32.2*z1)/((x^2)*l);
+k=sumKL/l;
+fn=poly([(-f) (-k) 0 0 0 z],'D','c');
+r=roots(fn);
+disp("ft",r(1),"The diameter=")
+count=1;
+len=400:2000;
+for i=400:2000
+ root=roots(poly([(-f) (-(sumKL/i)) 0 0 0 ((2*32.2*z1)/((x^2)*i))],'a','c'));
+ dia(count)=root(1);
+ count=count+1;
+end
+plot2d(len,dia,rect=[0,0,2000,1.8])
+xtitle("D vs l","l, ft","D, ft")