# Is there any formula that directly relate density to altitude for a wide range of altitude?

I am working on a code to simulate a vehicle trajectory based on forces act on it in different altitudes, I need a formula that gives density in an altitude range between 0 and 40 km to obtain lift and drag in different altitudes. Is there a formula that gives it to me even with a reasonable error?

• Without knowing air temperature? – Ron Beyer Feb 6 at 7:02
• Taking into account the standard air temperature at any altitude – Ramin.A Feb 6 at 16:13

## 1 Answer

There are the right way and the easy way.

1. Rigorous way would be to use the ICAO Standard Atmosphere (Doc 7488-CD in 1993) a link for document Then your code looks for temperature gradient (Table D) and uses eq.12 or 13 for pressure calculation. It depends on the temperature gradient. Then you can easily compute the density eq.14.

2. Easy way would be calculate density for few altitudes and fit the result with some proper function.

Cheers Robert