Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Want to contribute changes? Fork the repo and open a pull request, or ping 
[your name] ping for collaborator access.




  • Temperature: piecewise-linear function of altitude — the atmosphere is split into 8 layers (troposphere, stratosphere, mesosphere, etc.), each with its own fixed lapse rate (rate of temperature change with altitude). Model builds this layer table anchored to ground T instead of 288.15 K.
  • Pressure: solved from the hydrostatic equation within each layer — either an exponential decay (in isothermal layers) or a power-law relation (in layers where temperature changes linearly), again anchored to ground P.
  • Density: derived from the ideal gas law, ρ = P/(R·T), using the T and P already computed.
  • Speed of sound: a = √(γRT) — depends only on temperature.
  • Viscosity: Sutherland's Law, a semi-empirical formula for how air viscosity increases with temperature.
  • Gravity: inverse-square falloff with altitude using Earth's radius, g = g₀(Rₑ/(Rₑ+h))².