Main Content

atmoslapse

Use Lapse Rate Atmosphere model

Description

[T,a,P,rho] = atmoslapse(height,g,heatRatio,characteristicGasConstant,lapseRate,heightTroposphere,heightTropopause,density0,pressure0,temperature0) implements the mathematical representation of the lapse rate atmospheric equations for ambient temperature, speed of sound, pressure, and density for the input geopotential altitude. To customize this atmospheric model, specify the atmospheric properties in the function input.

[T,a,P,rho] = atmoslapse(height,g,heatRatio,characteristicGasConstant,lapseRate,heightTroposphere,heightTropopause,density0,pressure0,temperature0,height0) indicates that the values for ambient temperature, speed of sound, pressure, and density are for below mean sea level geopotential altitudes.

The function holds temperature and pressure values below the geopotential altitude of height0 and above the geopotential altitude of the tropopause. The function calculates the density and speed of sound using a perfect gas relationship.

example

[T,a,P,rho,nu,mu] = atmoslapse(height,g,heatRatio,characteristicGasConstant,lapseRate,heightTroposphere,heightTropopause,density0,pressure0,temperature0,height0,Name=Value) implements the mathematical representation of the lapse rate atmospheric equations for ambient temperature, speed of sound, pressure, density, kinematic viscosity, and dynamic viscosity for the input geopotential altitude. Density and speed of sound are calculated using a perfect gas relationship. Viscosity is computed using Sutherland's formula for ideal gas.

Examples

collapse all

Calculate the atmosphere at 1000 m with the International Standard Atmosphere input values.

[T, a, P, rho] = atmoslapse(1000, 9.80665, 1.4, 287.0531, 0.0065, ...
    11000, 20000, 1.225, 101325, 288.15 )
T = 
281.6500
a = 
336.4341
P = 
8.9875e+04
rho = 
1.1116

Input Arguments

collapse all

Geopotential heights, specified as an m-by-n array in meters.

Data Types: double

Acceleration due to gravity, specified as a scalar in meters per second squared.

Data Types: double

Heat ratio, specified as a scalar.

Data Types: double

Characteristic gas constant, specified as a scalar in joules per kilogram-kelvin.

Data Types: double

Lapse rate, specified as a scalar in Kelvin per meter.

Data Types: double

Height of troposphere, specified as a scalar in meters.

Data Types: double

Height of tropopause, specified as a scalar in meters.

Data Types: double

Density at mean sea level (MSL), specified as a scalar in kilograms per meter cubed.

Data Types: double

Static pressure at MSL, specified as a scalar in Pascals.

Data Types: double

Absolute temperature at MSL, specified as a scalar in Kelvin.

Data Types: double

Minimum sea level altitude, specified as a scalar in meters.

Data Types: double

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: action,'Error' will cause atmoslapse to result in error if viscosity outputs are to be computed but you do not provide the arguments required for the computation.

Sutherland temperature in Kelvin, specified as a scalar.

Reference temperature in Kelvin, specified as a scalar.

Reference dynamic viscosity in kilograms per meter second, specified as a scalar.

Function behavior when inputs are out of range, specified as one of these values.

ValueDescription
'None'Does not display warning or error. The missing arguments, if any, are replaced by the default values corresponding to air.
'Warning'Warning in the MATLAB® Command Window indicating that the missing arguments are replaced by default values corresponding to air.
'Error'MATLAB displays error and indicates that the required input arguments have not been provided.

Output Arguments

collapse all

Temperatures, returned as an m-by-n array in Kelvin.

Speeds of sound, returned as an m-by-n array in meters per second squared. The function calculates speed of sound using a perfect gas relationship.

Pressures, returned as an m-by-n array in Pascals.

Densities, specified as an m-by-n array kilograms per meter cubed. The function calculates density using a perfect gas relationship.

Kinematic viscosity, returned as an m-by-n array, in m2/s.

Dynamic viscosity, returned as an m-by-n array, in kilograms per meter second.

References

[1] U.S. Standard Atmosphere. Washington, DC: US Government Printing Office, 1976.

Version History

Introduced in R2006b

expand all