summaryrefslogtreecommitdiff
path: root/2126/CH1/EX1.6/6.sce
blob: 32c4b266fb84f36e24ad55ef37a06b381d668ee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
clc
clear

//Input data
P=200 //Pressure in kPa
C=50 //Velocity of air in m/s
d=2.9 //Density in kg/m^3
Mol=32 //Molecular weight of oxygen in kg/mol
k=1.4 //Adiabatic constant
Ri=8314 //Ideal gas constant in J/mol-K

//Calculator
R=Ri/Mol //Specific gas constant in J/kg-K
T=P*10^3/(R*d) //Temperature in K
a=sqrt(k*R*T) //Velocity of sound in m/s 
M=C/a //Mach number 

//Output
printf('Mach number is %3.2f',M)