summaryrefslogtreecommitdiff
path: root/557/CH2
diff options
context:
space:
mode:
Diffstat (limited to '557/CH2')
-rwxr-xr-x557/CH2/EX2.1/1.sce12
-rwxr-xr-x557/CH2/EX2.10/10.sce24
-rwxr-xr-x557/CH2/EX2.2/2.sce15
-rwxr-xr-x557/CH2/EX2.3/3.sce17
-rwxr-xr-x557/CH2/EX2.4/4.sce17
-rwxr-xr-x557/CH2/EX2.5/5.sce18
-rwxr-xr-x557/CH2/EX2.6/6.sce11
-rwxr-xr-x557/CH2/EX2.7/7.sce14
-rwxr-xr-x557/CH2/EX2.8/8.sce13
-rwxr-xr-x557/CH2/EX2.9/9.sce16
10 files changed, 157 insertions, 0 deletions
diff --git a/557/CH2/EX2.1/1.sce b/557/CH2/EX2.1/1.sce
new file mode 100755
index 000000000..7f6dedd8c
--- /dev/null
+++ b/557/CH2/EX2.1/1.sce
@@ -0,0 +1,12 @@
+clc ;funcprot(0);
+//Example 2.1
+
+//Initializing the variables
+z1 = 0; //Taking Ground as reference
+z2 = -30;//Depth
+rho = 1025;//Density
+g = 9.81;//Acceleration due to gravity
+
+//Calculation
+pressureIncrease = -rho*g*(z2-z1);
+disp(pressureIncrease/1000,"Increase in Pressure (KN/m2):"); \ No newline at end of file
diff --git a/557/CH2/EX2.10/10.sce b/557/CH2/EX2.10/10.sce
new file mode 100755
index 000000000..7756eae0d
--- /dev/null
+++ b/557/CH2/EX2.10/10.sce
@@ -0,0 +1,24 @@
+clc ;funcprot(0);
+//Example 2.10
+
+//Initializing the variables
+phi = 30; //30 degree
+h = 1.2 ; // Height of tank
+l = 2; // Length of tank
+
+//Calculations
+function[Theta]=SurfaceAngle(a,phi)
+ Theta = atand(-a*cosd(phi)/(g+a*sind(phi)));
+endfunction
+
+//case (a) a = 4
+disp(tand(SurfaceAngle(4,phi)),"Tan of Angle between surface of fluid and horizontal :");
+disp(180 + SurfaceAngle(4,phi),"ThetaA (degree):");
+
+//Case (b) a = - 4.5
+tanThetaR = tand(SurfaceAngle(-4.5,phi));
+disp(tanThetaR,"Tan of Angle between surface of fluid and horizontal :");
+disp(SurfaceAngle(-4.5,phi),"ThetaR (degree):");
+
+Depth = h - l*tanThetaR/2;
+disp(Depth,"Maximum Depth of tank (m):"); \ No newline at end of file
diff --git a/557/CH2/EX2.2/2.sce b/557/CH2/EX2.2/2.sce
new file mode 100755
index 000000000..863795a57
--- /dev/null
+++ b/557/CH2/EX2.2/2.sce
@@ -0,0 +1,15 @@
+clc ;funcprot(0);
+//Example 2.2
+
+//Initializing the variables
+p1 = 22.4*10^3;//Initial Pressure
+z1 = 11000;//Initial Height
+z2 = 15000;//final Height
+g = 9.81;//Acceleration due to gravity
+R = 287; //Gas Constant
+T = 273-56.6;//Temperature
+
+//Calculations
+p2 = p1*exp(-g*(z2-z1)/(R*T));
+rho2=p2/(R*T);
+disp(rho2,"Final Density (kg/m3) :",p2/1000,"Final Pressure (kN/m2):");
diff --git a/557/CH2/EX2.3/3.sce b/557/CH2/EX2.3/3.sce
new file mode 100755
index 000000000..d4dad5cba
--- /dev/null
+++ b/557/CH2/EX2.3/3.sce
@@ -0,0 +1,17 @@
+clc ;funcprot(0);
+//Example 2.3
+
+//Initializing the variables
+p1 = 101*10^3;//Initial Pressure
+z1 = 0;//Initial Height
+z2 = 1200;//Final Height
+T1 = 15+273;//Initial Temperature
+g = 9.81;//Acceleration due to gravity
+gamma = 1.4;//Heat capacity ratio
+R = 287;//Gas Constant
+
+//Calculations
+p2 = p1*(1-g*(z2-z1)*(gamma-1)/(gamma*R*T1))^(gamma/(gamma-1));
+dT_dZ = -(g/R)*((gamma-1)/gamma);
+T2 = T1 + dT_dZ*(z2-z1);
+disp(T2-273,"Density at 1200 m (in degree celcius) :",p2/1000,"Final Pressure(kN/m2) :");
diff --git a/557/CH2/EX2.4/4.sce b/557/CH2/EX2.4/4.sce
new file mode 100755
index 000000000..f744daeab
--- /dev/null
+++ b/557/CH2/EX2.4/4.sce
@@ -0,0 +1,17 @@
+clc ;funcprot(0);
+//Example 2.4
+
+//Initializing the variables
+p1 = 101*10^3;//Initial Pressure
+z1 = 0;//Initial Height
+z2 = 7000;//Final Height
+T1 = 15+273;//Initial Temperature
+g = 9.81;//Acceleration due to gravity
+R = 287;//Gas Constant
+dT = 6.5/1000;//Rate of Variation of Temperature
+
+//Calculations
+p2 = p1*(1-dT*(z2-z1)/T1)^(g/(R*dT));
+T2 = T1 - dT*(z2-z1);
+rho2 = p2/(R*T2);
+disp(rho2,"Final Density (kg/m3 ):",p2/1000,"Final Pressure (kN/m2) :");
diff --git a/557/CH2/EX2.5/5.sce b/557/CH2/EX2.5/5.sce
new file mode 100755
index 000000000..e20c9c94d
--- /dev/null
+++ b/557/CH2/EX2.5/5.sce
@@ -0,0 +1,18 @@
+clc ;funcprot(0);
+//Example 2.5
+
+//Initializing the variables
+p = 350*10^3; //Gauge Pressure
+pAtm = 101.3*10^3; //Atmospheric Pressure
+rhoW = 1000; //Density of Water
+sigma = 13.6; //Relative Density of Mercury
+g = 9.81;//Acceleration due to gravity
+
+//Calculations
+function[head]=Head(rho)
+ head = p/(rho*g);
+endfunction
+rhoM = sigma*rhoW;
+pAbs = p + pAtm;
+
+disp(pAbs/1000,"Absolute pressure(kN/m2)",Head(rhoM),"Equivalent head of water (m):","Part (b)",Head(rhoW),"Equivalent head of water (m) :","Part (a)" );
diff --git a/557/CH2/EX2.6/6.sce b/557/CH2/EX2.6/6.sce
new file mode 100755
index 000000000..cfd4e7b8c
--- /dev/null
+++ b/557/CH2/EX2.6/6.sce
@@ -0,0 +1,11 @@
+clc ;funcprot(0);
+//Example 2.6
+
+//Initializing the variables
+rho = 10^3; //Density of water
+h = 2; //Height
+g = 9.81; //Acceleration due to gravity
+
+//Calculations
+p=rho*h*g;
+disp(p/1000,"Gauge pressure (k/m2) :");
diff --git a/557/CH2/EX2.7/7.sce b/557/CH2/EX2.7/7.sce
new file mode 100755
index 000000000..2478e1ef7
--- /dev/null
+++ b/557/CH2/EX2.7/7.sce
@@ -0,0 +1,14 @@
+clc ;funcprot(0);
+//Example 2.7
+
+//Initializing the variables
+rho = 0.8*10^3; //Density of fluid
+rhoM = 13.6*10^3; //Density of manometer liquid
+g = 9.81;//Acceleration due to gravity
+
+//Calculations
+function[P]=fluidPressure(h1,h2)
+ P = rhoM*g*h2-rho*g*h1;
+endfunction
+
+disp(fluidPressure(0.1,-0.2)/1000,"Gauge pressure (kN/m2):","!-----Part (b)-----!",fluidPressure(0.5,0.9)/1000,"Gauge pressure (kN/m2):","!-----Part (a)-----!");
diff --git a/557/CH2/EX2.8/8.sce b/557/CH2/EX2.8/8.sce
new file mode 100755
index 000000000..559d1f94b
--- /dev/null
+++ b/557/CH2/EX2.8/8.sce
@@ -0,0 +1,13 @@
+clc ;funcprot(0);
+//Example 2.8
+
+//Initializing the variables
+rho = 10^3; //Density of fluid
+rhoM = 13.6*10^3; //Density of manometer liquid
+g = 9.81; //Acceleration due to gravity
+H = 0.3; // Differnce in height = b-a as in text
+h = 0.7;
+
+//Calculations
+result = rho*g*H + h*g*(rhoM-rho);
+disp( result/1000,"Pressure difference (kN/m2):");
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-----!");