The US Standard model 1976 for the atmospheric temperature a
The U.S. Standard model (1976) for the atmospheric temperature and pressure as a function of altitude consists of two types of regions: one in which the temperature varies linearly with altitude, with a non-zero lapse rate (lambda notequalto 0) and the other where the temperature is a constant with a zero lapse rate (lambda = 0). The temperature, pressure, density, and speed of sound relations are defined respectively as follows: where z = the altitude; zt = the altitude at the beginning of the region of interest; (pi, Ti)=the pressure and temperature at the beginning of the region of interest; lambda = the lapse rate of region; gt= the gravitational constant, which varies slightly with altitude; p= air density; c= speed of sound; y = 1.4 (specific heat capacity ratio); R = 287 J/kg.K (the air gas constant).
Solution
PROGRAM TO GET T ,P, RHO FOR ANY VALUE OF Z ;
public getaltitude()
{ return altitude;
}
if( altitude>=0 &&<=11)
{ zi= 0; Ti= 288.15 ; Pi= 101325 ; lambda=0.0065; gi=9.81;
}
elseif( altitude>11 &&<=20)
{ zi= 11; Ti= 216.65 ; Pi= 22632.05 ; lambda=0.0065; gi=9.776;
}
elseif( altitude>20 &&<=32)
{ zi= 0; Ti= 216.65 ; Pi= 5474.88 ; lambda=-1; gi=9.749;
}
// function for calculating T p rho first for lambda zero then for non zero
public Standard_atmiflambdazero ( )
{
T=Ti;
p=pi* exp(- gi(z-zi)/(R*Ti)
rho=p/RT
}
if (lambda== 0)
{
Standard_atmiflambdazero ();
}
else {
Standard_atmiflambdanonzero ( );
}
public Standard_atmiflambdanonzero ( )
{
T=Ti- lambda*(z-zi);
p=pi* exp((1- lambda * (z-zi)/(Ti))^(gi/lambda*R)
rho=p/RT
}

