You are on page 1of 4

%%Tanuja Datar.

%%Roll no. - 2171042 (MITU17BTAE0007)


%%Name of exp. - Standard atmosphere
function[]=stdatm_42
h1=11 ; h2=20 ; h3=32; mol=28.965 ; R0=8.324;
T0=288.1; a0=-6.5e-5 ; a2=1e-3 ;R=R0/(mol*1e-3); g=9.81;
T0=288.15; P0=1.01325e5; Rho0=1.2250; T10=T0+a0*h1*1e3;
P1=P0*((T10/T0)^(-g/a0/R)); Rho1=Rho0*((T10/T0)^(-g/a0/R-1));
P2=P1*exp(-g/R/T10*(h2-h1)*1e3); Rho2=Rho1*exp(-g/R/T10*(h2-h1)*1e3);
for i=1:1:33
h(i,1)=i-1;

if i<=h1+1
T(i,1)=T0+a0*h(i,1)*1e3;
P(i,1)=P0*(T(i,1)/T0).^(-g/a0/R);
Rho(i,1)=Rho0*(T(i,1)/T0).^(-g/a0/R-1);

elseif i<=h2+1
T(i,1)=T10;
P(i,1)=P1*exp(-g/R/T10*(h(i,1)-h1)*1e3);
Rho(i,1)=Rho1*exp(-g/R/T10*(h(i,1)-h1)*1e3);

elseif i<=h3+1
T(i,1)=T10+a2*(h(i,1)-h2)*1e3;
P(i,1)=P2*(T(i,1)/T10).^(-g/a2/R);
Rho(i,1)=Rho2*(T(i,1)/T10).^(-g/a2/R-1);
else
disp('No data');
end
end

%%STANDARD ATMOSPHERE TABLE


table(h,T,P,Rho)
figure(1)
plot(T,h)
xlabel('Temperature in K');
ylabel('Altitude in Km');
title('Temperature vs Altitude');
grid on
figure(2)
plot(Rho,h)
xlabel('Density in kg/m^3');
ylabel('Altitude in Km');
title('Density vs Altitude');
grid on
figure(3)
plot(P,h)
xlabel('pressure in pascals');
ylabel('Altitude in Km');
title('Pressure vs Altitude');

ans =

1
33×4 table

h T P Rho
__ ______ __________ ________

0 288.15 1.0133e+05 1.225


1 288.08 90004 1.0884
2 288.02 79946 0.96697
3 287.95 71010 0.85908
4 287.89 63071 0.7632
5 287.82 56018 0.67801
6 287.76 49752 0.60231
7 287.69 44187 0.53505
8 287.63 39242 0.47529
9 287.56 34850 0.42219
10 287.5 30949 0.37501
11 287.44 27484 0.3331
12 287.44 24406 0.2958
13 287.44 21673 0.26268
14 287.44 19246 0.23326
15 287.44 17091 0.20714
16 287.44 15177 0.18395
17 287.44 13478 0.16335
18 287.44 11968 0.14506
19 287.44 10628 0.12881
20 287.44 9438.1 0.11439
21 288.44 8382.9 0.10125
22 289.44 7448.8 0.089655
23 290.44 6621.5 0.079423
24 291.44 5888.4 0.070387
25 292.44 5238.6 0.062406
26 293.44 4662.4 0.055352
27 294.44 4151.2 0.049116
28 295.44 3697.5 0.0436
29 296.44 3294.7 0.038719
30 297.44 2936.9 0.034398
31 298.44 2618.9 0.030571
32 299.44 2336.3 0.027181

2
3
Published with MATLAB® R2018a

You might also like