diff options
Diffstat (limited to '557/CH17/EX17.1/1.sce')
-rwxr-xr-x | 557/CH17/EX17.1/1.sce | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/557/CH17/EX17.1/1.sce b/557/CH17/EX17.1/1.sce new file mode 100755 index 000000000..8081aa7e0 --- /dev/null +++ b/557/CH17/EX17.1/1.sce @@ -0,0 +1,27 @@ +clc; funcprot(0);//Example 17.1
+
+//Initializing the variables
+g = 9.81;
+rho = 1000;
+rhoHg = 13.6*rho;
+d1 = 0.075;
+d2 = 0.025;
+Pi = 0.250;
+Pt = 0.150;
+P_Hg = 0.760;
+rho1 = 1.6;
+gma = 1.4;
+
+//Calculations
+P1 = (Pi+P_Hg)*rhoHg*g;
+P2 = (Pt+P_Hg)*rhoHg*g;
+rho2 = rho1*(P2/P1)^(1/gma);
+
+function[f] = velocity(V)
+ f(1) = d2^2*V(2)*rho2-d1^2*V(1)*rho1;
+ f(2) = 0.5*(V(2)^2 - V(1)^2)*((gma-1)/gma)*(rho2*rho1/(rho2*P1-rho1*P2))-1;
+endfunction
+V = [0 0];
+Velo = fsolve(V,velocity);
+Flow = %pi*d1^2/4*Velo(1);
+disp(Flow, "Volume of flow (m3/s):");
\ No newline at end of file |