Air density calculation 2007

Version 1.0.0 (4.36 KB) by Randy
Calculates moist air density according to the paper "Revised formula for the density of moist air (CIPM-2007)".
4 Downloads
Updated 14 Jul 2025

View License

This function calculates the air density for moist air, as a function of temperature, pressure, humidity level, and carbon dioxide level. Calculations are, by default, based on the equations given in Ref. 2, dated from 2008. Ref. 2 is an update to a previous version of that study (Ref. 1), dated from 1992.
By default, predictions are based on Ref. 2 values. However, by changing the string Source in the code, results can be given using Ref. 1 values. Results can also be given under an ideal gas assumption, or when using the updated SI molar gas constant from 2019.
Any or all inputs may be vectors of equal length.
This function is very similar to the submittal "Air density calculation" that is based on Ref. 1 values, but includes a term for the current CO2 concentration. The submittal "Calculation of air properties" is based on Ref. 2 (and other) resutlts, and also includes the ability to calculate many more properties of air.

Cite As

Randy C. Van Vranken (2025). air_density_2007 (https://www.mathworks.com/matlabcentral/fileexchange/<...>), MATLAB Central File Exchange. Retrieved July 14, 2025.

Ref. 1: https://www.nist.gov/system/files/documents/calibrations/metv29i1p67-2.pdf, "Equation for the Determination of the Density of Moist Air (1981/91)"

Ref. 2: https://www.nist.gov/system/files/documents/calibrations/CIPM-2007.pdf, "Revised formula for the density of moist air (CIPM-2007)"

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0