summaryrefslogtreecommitdiff
path: root/1457/CH9/EX9.6/9_6.sce
blob: eda956d11c857bde5429600ef5a5b0588b659dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
clc
//Initialization of variables
P1=10 //psia
T1=460+40 //R
R=1715
k=1.4
V1=1400 //fps
//calculations
rho1=P1/(R*T1)
c1=sqrt(k*R*T1)
M1=V1/c1
P2= P1 * (2*k*M1^2  - (k-1))/(k+1)
V2 =V1*((k-1)*M1^2 +2)/((k+1)*M1^2) 
rho2=rho1*V1/V2
T2=P2/rho2/R
P22=122.5
V22=286
T22=328
//results
printf("Pressure at point 2 = %.1f psia and %.1f N/m^2",P2,P22)
printf("\n Velocity at point 2 = %d fps and %d m/s",V2,V22)
printf("\n Temperature at point 2 = %d R and %d K",T2,T22)
disp("Similarly it can be done for SI units")