File Exchange

image thumbnail

Standard Atmosphere Functions

version (9.89 KB) by Sky Sartorius
Standard atmosphere gas properties. Support for n-dim inputs, non-standard atmospheres, units, etc.


Updated 13 Apr 2018

GitHub view license on GitHub

Standard atmosphere functions based on the 1976 Standard Atmosphere. Returns density, speed of sound, temperature, pressure, and viscosity for a given altitude input up to 86 km.

Functions are designed to be useful for those designing and analyzing aircraft and have the following features:

•Inputs may be scalar, vector, matrix, or n-dimensional arrays. Functions are vectorized and fast for computing conditions at a large number of points simultaneously. Especially for n-dimensional problems, it is faster than the built-in atmosisa that comes with the aerospace toolbox.

•Temperature offset option for non-standard atmospheres, e.g analyzing hot day aircraft performance.

•Absolute temperature option for non-standard atmospheres, e.g for when OAT is known.

•Either SI or imperial units (and easy to set your preferred default).

•Units consistency can be enforced by using the Physical Units Toolbox, reducing errors and making code clearer.

•Returns everything needed to easily determine important parameters such as dynamic pressure, Mach number, Reynolds number, stagnation temperature, etc.

•Option for geometric instead of geopotential altitude input.

•Density altitude function allows reverse lookup of altitude based on gas properties.

•Stripped-down, troposphere-only function included for when computation speed is a priority.

References: ESDU 77022;

Cite As

Sky Sartorius (2020). Standard Atmosphere Functions (, GitHub. Retrieved .

Comments and Ratings (8)

liang he

jean dufour

it looks great but do you know how you could include it in MATLAB function block?



with a good help!!!!
good job!!!!!!!!!!



Right now STDATMO expects the temperature offset to be in degrees Kelvin/Celsius regardless of which length unit is used for altitude input. Keep in mind that dT is an offset, so when converting between Celsius and Fahrenheit, use only the scaling factor (offset C/F = K/R = 5/9).

It was originally thought that non-standard atmospheres would rarely be based on temperature offsets in degrees Fahrenheit, but I would greatly appreciate user feedback: Should the temperature offset for altitude input in meters be in degrees C/K and in degrees F/R for altitude input in feet?

very clean code with a good help. Haven't yet been able to check the correctness, but it seems OK. The code seems to be implemented way better than the "Complete 1976 Standard Atmosphere" implementation.
Great job


Merged with densityalt (39325) and moved to GitHub. Absolute temperature capability added.

stdatmo superseded by atmos (stdatmo still included in package because of slightly different input syntax).
atmos has a more elegant coding scheme all around
Super-quick, troposphere-only tropos included in the package.


capabilities of stdatmodim integrated into main function; documentation and example

Added STDATMODIM wrapper function and updated documentation.

tiny changes to help and input handling; improved vectorization; tested in 2012b

Imperial unit temperature offset now in F/R instead of C/K

fixed error that occurred when using 5 output arguments

Minor changes. Tested in R2010a. Added another example to help.

A bit quicker for troposphere only problems; fixed small units bug.

Added a section such that troposphere-only simple function calls are a bit faster

Final output, Hgeop, changed to ZorH, and is geometric altitude for geopotential input, and geopotential for geometric input. Code made a bit more succinct.

Now substantially faster than earlier versions and ATMOSISA. Cleaned up help and setup for Example 1.

Changed handling of units to be more intuitive and added feature to allow different units for input and output. Earlier version syntax works as before.
Two examples added to help.

Update to references and improved input handling

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux