summaryrefslogtreecommitdiff
path: root/557/CH2/EX2.9
diff options
context:
space:
mode:
Diffstat (limited to '557/CH2/EX2.9')
-rwxr-xr-x557/CH2/EX2.9/9.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/557/CH2/EX2.9/9.sce b/557/CH2/EX2.9/9.sce
new file mode 100755
index 000000000..e2a3d60a2
--- /dev/null
+++ b/557/CH2/EX2.9/9.sce
@@ -0,0 +1,16 @@
+clc ;funcprot(0);
+//Example 2.9
+
+//Initializing the variables
+rho = 10^3; //Density of fluid
+rhoM = 0.8*10^3; //Density of manometer liquid
+g = 9.81; //Acceleration due to gravity
+a = 0.25;
+b = 0.15;
+h = 0.3;
+//Calculations
+function[P]=PressureDiff(a,b,h,rho,rhoM)
+ P = rho*g*(b-a) + h*g*(rho-rhoM);
+endfunction
+
+disp(PressureDiff(a,b,h,rho,rhoM),"Pressure Differnece(N/m2):","!-----Part (b)-----!",PressureDiff(a,b,h,rho,0)/1000,"Pressure Differnece(kN/m2):","!-----Part (a): rhoM is negligible assuming zero-----!");