summaryrefslogtreecommitdiff
path: root/689/CH2/EX2.2/2.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /689/CH2/EX2.2/2.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '689/CH2/EX2.2/2.sce')
-rw-r--r--689/CH2/EX2.2/2.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/689/CH2/EX2.2/2.sce b/689/CH2/EX2.2/2.sce
new file mode 100644
index 000000000..0da671cc4
--- /dev/null
+++ b/689/CH2/EX2.2/2.sce
@@ -0,0 +1,23 @@
+//Example 2.2 On Bernoulli's Equation
+
+// Initialisation of variables
+D1 = 8;
+P1 = 20*144; //Gage Pressure in lb per square feet
+q = 1000; //Rate of flow in gallon per minute.
+D2 = 4;
+Patm = 2116.2;
+rho = 62.4;
+
+// Calculations
+q = q*231/(1728*60); //Rate of flow in ft^3/sec
+A1 = %pi*(D1/12/2)^2; // Area in ft^2
+A2 = %pi*(D2/12/2)^2;
+V1 = q/A1;
+V2 = q/A2;
+P1_abs = P1 + Patm;
+P2_abs = P1_abs + (1/2)*rho*(V1^2 - V2^2)/32.2; // Bernoulli's Equation
+P2 = (P2_abs - Patm)/144;
+
+//Results
+disp(P2, "The gage pressure in pipe at D = 4 inch (lb per sq in) :");
+