Standard Atmosphere Function

by admin in , , , , on April 3, 2019

A standard atmosphere function based on the 1976 Standard Atmosphere returns density, speed of sound, temperature, pressure, and viscosity for a given altitude input up to 86 km. This atmospheric model is not recommended for use at altitudes above 86 km geometric height (84852 m/278386 ft geopotential) and returns NaN for altitudes above 90 km geopotential.

This function is designed to be useful for those designing and analyzing aircraft and has the following features that hitherto have not been combined in a single standard atmosphere function:

  • Input may be a scalar, vector, matrix, or n-dimensional array of altitudes. The function is vectorized and fast for computing atmospheric conditions at a large number of points simultaneously.
  • Temperature offset option for non-standard atmospheres, e.g analyzing hot day aircraft performance.
  • Input and output may independently be either SI or imperial units.
  • Units consistency can be enforced by using the DimensionedVariable class, 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.

STDATMO Find gas properties in earth’s atmosphere with the full form:

  • STDATMO by itself gives the atmospheric properties at sea level on a standard day.
  • STDATMO(H) returns the properties of the 1976 Standard Atmosphere at geopotential altitude H (meters), where H is a scalar, vector, matrix, or ND array.
  • STDATMO(H,dT) returns properties when the temperature is dT degrees offset from standand conditions. H and dT must be the same size or else one must be a scalar.
  • STDATMO(H,dT,Units) specifies units for the inputs outputs. Options are SI (default) or US (a.k.a. Imperial, English). For SI, set Units to [] or ‘SI’. For US, set Units to ‘US’. Input and output units may be different by passing a cell array of the form {Units_in Units_out}, e.g. {‘US’ ‘SI’}. Keep in mind that dT is an offset, so when converting between Celsius and Fahrenheit, use only the scaling factor (dC/dF = dK/dR = 5/9).

Units are as follows:

Input: SI (default)                                     US

  • H: Altitude  m                                   ft
  • dT: Temp. offset °C/°K                  °F/°R


  • rho: Density kg/m^3                      slug/ft^3
  • a: Speed of sound m/s                     ft/s
  • T: Temperature °K                          °R
  • P: Pressure Pa                                   lbf/ft^2
  • nu: Kinem. viscosity m^2/s           ft^2/s
  • ZorH: Height or altitude m            ft


  • STDATMO(H,dT,u), where u is a structure created by the UNITS function, accepts variables of the DimensionedVariable class as inputs. Outputs are of the DimensionedVariable class. If a DimensionedVariable is not provided for an input, STDATMO assumes SI input.
  • STDATMO(H,dT,Units,GeomFlag) with logical input GeomFlag returns properties at geometric altitude input H instead of the normal geopotential altitude.
  • [rho,a,T,P,nu]=STDATMO(H,dT,…) returns atmospheric properties the same size as H and/or dT (P does not vary with temperature offset and is always the size of H).
  • [rho,a,T,P,nu,ZorH]=STDATMO(H,…) returns either geometric height, Z, (GeomFlag not set) or geopotential height, H, (GeomFlag set).

Examples included in code help:

  • Create tables of atmospheric properties up to 30000 ft for a cold (-15°C), standard, and hot (+15°C) day with columns [h(ft) Z(ft) rho(slug/ft3) sigma a(ft/s) T(°R) P(psf) µ(slug/ft-s) nu(ft2/s)]  using 3-dimensional array inputs.
  • Find atmospheric properties at every 100m of geometric height for an off-standard atmosphere with temperature offset varying +/- 25 degC sinusoidally with a period of 4km.


1 Sale

Share Now!

Release Information

  • Price


  • Released

    April 3, 2019

  • Last Updated

    May 29, 2019

Share Your Valuable Opinions