summaryrefslogtreecommitdiff
path: root/2126/CH5/EX5.15
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2126/CH5/EX5.15
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 '2126/CH5/EX5.15')
-rwxr-xr-x2126/CH5/EX5.15/15.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/2126/CH5/EX5.15/15.sce b/2126/CH5/EX5.15/15.sce
new file mode 100755
index 000000000..d30f0bb73
--- /dev/null
+++ b/2126/CH5/EX5.15/15.sce
@@ -0,0 +1,21 @@
+clc
+clear
+
+//Input data
+Px=16 //Pressure before the shock in kPa
+Poy=70 //Stagnation pressure after shock in kPa
+To=300+273 //Stagnation temperature in K
+k=1.4 //Adiabatic constant
+
+//Calculation
+p1=Poy/Px //Pressure ratio
+Mx=1.735 //Mach number upstream of shock
+My=0.631 //Mach number downstream of shock
+p2=0.84 //Ratio of stagnation pressures after and before shock from gas tables
+t1=1.483 //Temperature ratio after and before shock from gas tables
+Tx=To/(1+((k-1)/2)*Mx^2) //Temperature upstream of shock in K
+Ty=Tx*t1 //Temperature downstream of shock in K
+Pox=Poy/p2 //Stagnation pressure before shock in kPa
+
+//Output
+printf('(A)Mach number of the tunnal is Mx=%3.3f (My=%3.3f)\n (B)Upstream of the tube:\n Static temperature is %3i K\n Total pressure is %3.1f kPa\n (C)Downstream of the tube:\n Static temperature is %3i K\n Total pressure is %3i kPa',Mx,My,Tx,Pox,Ty,Poy)