ADCS.orbits.density_model module¶
- class ADCS.orbits.density_model.DensityModel(altitude_range=array([0., 100., 150., 175., 200., 225., 250., 275., 300., 325., 350., 375., 400., 450., 500., 550., 600., 650., 700., 750., 800., 850., 900., 950., 1000.]), rho_range=array([1.20e+00, 5.69e-07, 2.02e-09, 7.66e-10, 2.90e-10, 1.46e-10, 7.30e-11, 4.10e-11, 2.30e-11, 1.38e-11, 8.33e-12, 5.24e-12, 3.29e-12, 1.39e-12, 6.15e-13, 2.84e-13, 1.37e-13, 6.87e-14, 3.63e-14, 2.02e-14, 1.21e-14, 7.69e-15, 5.24e-15, 3.78e-15, 2.86e-15]))[source]¶
Bases:
objectSimple atmospheric density interpolation model.
This class implements a lightweight empirical atmospheric density model based on tabulated altitude–density reference data. The density \(\rho(h)\) is obtained by one–dimensional linear interpolation between known data points, making the model suitable for preliminary orbital dynamics and drag analyses.
The model is conceptually equivalent to a simplified version of standard atmospheric models (e.g. SMAD – Space Mission Analysis and Design), where density is assumed to be a deterministic and monotonically decreasing function of altitude.
Mathematical Model¶
Given a discrete set of altitude–density pairs
\[\{(h_i, \rho_i)\}_{i=0}^{N-1},\]the density at an arbitrary altitude \(h\) is computed via linear interpolation:
\[\rho(h) = \rho_i + \frac{\rho_{i+1} - \rho_i}{h_{i+1} - h_i} \left(h - h_i\right), \quad h_i \le h \le h_{i+1}.\]This density model is commonly used in aerodynamic drag formulations:
\[F_D = \frac{1}{2} C_D A \rho(h) v^2,\]where \(C_D\) is the drag coefficient, \(A\) is the reference area, and \(v\) is the relative velocity magnitude.
- param altitude_range:
Reference altitude samples \(h_i\) in kilometers (km). Values must be non-negative and strictly ordered.
- type altitude_range:
numpy.typing.NDArray[numpy.float64]
- param rho_range:
Atmospheric density samples \(\rho_i\) in kg/m³ corresponding to
altitude_range. All values must be strictly positive.- type rho_range:
numpy.typing.NDArray[numpy.float64]
- raises ValueError:
If the altitude and density arrays have mismatched shapes, contain negative altitudes, or contain non-positive density values.
Note
This model does not account for temporal, solar, geomagnetic, or latitudinal variations in atmospheric density. It is intended for simplified analyses and educational use.
- interpolate(altitude_km)[source]¶
Interpolate atmospheric density at a given altitude.
This method evaluates the atmospheric density \(\rho(h)\) at a specified altitude using linear interpolation over the stored reference data.
Mathematically, for an altitude \(h\) between two reference points \(h_i\) and \(h_{i+1}\), the density is given by
\[\rho(h) = \rho_i + \frac{\rho_{i+1} - \rho_i}{h_{i+1} - h_i} (h - h_i).\]The atmosphere is approximately exponential in altitude, so the interpolation is performed log-linearly (linear in \(\ln\rho\) vs. altitude); plain linear-in-altitude interpolation over a sparse table is wrong by orders of magnitude between samples (e.g. ~600x at 50 km). Above the top reference altitude the density continues to decay exponentially using the scale height of the last table interval (so e.g. GEO does not retain a spurious LEO-tail density); below the lowest reference altitude the density is clamped to the lowest sample (sub-surface / decayed-orbit guard).
- Parameters:
altitude_km (float) – Altitude above Earth’s mean radius in kilometers (km).
- Returns:
Interpolated atmospheric density \(\rho(h)\) in kg/m³.
- Return type:
float
- Parameters:
altitude_range (ndarray[tuple[int, ...], dtype[float64]])
rho_range (ndarray[tuple[int, ...], dtype[float64]])