summaryrefslogtreecommitdiff
path: root/51/DEPENDENCIES/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/DEPENDENCIES/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/DEPENDENCIES/8_13.sce')
-rwxr-xr-x51/DEPENDENCIES/8_13.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/51/DEPENDENCIES/8_13.sce b/51/DEPENDENCIES/8_13.sce
new file mode 100755
index 000000000..fcbbf8036
--- /dev/null
+++ b/51/DEPENDENCIES/8_13.sce
@@ -0,0 +1,27 @@
+clc;
+clear;
+exec("C:\Program Files\scilab-5.3.0\bin\TCP\8_13data.sci");
+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")