summaryrefslogtreecommitdiff
path: root/3720/CH12/EX12.12/Ex12_12.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3720/CH12/EX12.12/Ex12_12.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 '3720/CH12/EX12.12/Ex12_12.sce')
-rw-r--r--3720/CH12/EX12.12/Ex12_12.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/3720/CH12/EX12.12/Ex12_12.sce b/3720/CH12/EX12.12/Ex12_12.sce
new file mode 100644
index 000000000..1f2ce61eb
--- /dev/null
+++ b/3720/CH12/EX12.12/Ex12_12.sce
@@ -0,0 +1,23 @@
+// Example 12_12
+clc;clear;funcprot(0);
+//Given values
+Ma_1=2.0;// Mach number
+P_1=230;// kPa
+delta=10;// degree
+//Properties
+k=1.4//The specific heat ratio
+
+//Calculation
+theta=delta;
+v_1=(sqrt((k+1)/(k-1))*atand(sqrt(((k-1)*(Ma_1^2-1))/(k+1))))-atand(sqrt(Ma_1^2-1));// degree
+v_2=theta+v_1;// degree
+// Ma_2=y(1);
+function[X]=Machnumber(y);
+ X(1)=((sqrt((k+1)/(k-1))*atand(sqrt(((k-1)*(y(1)^2-1))/(k+1))))-atand(sqrt(y(1)^2-1))-v_2);
+endfunction
+y=[1];
+z=fsolve(y,Machnumber);
+printf('The downstream Mach number Ma_2=%0.3f\n',z(1));
+Ma_2=z(1);
+P_2=((((1+(((k-1)/2)*Ma_2^2)))^(-k/(k-1)))/(((1+(((k-1)/2)*Ma_1^2)))^(-k/(k-1))))*(P_1);
+printf('The downstream pressure,P_2=%0.0f kPa\n',P_2);