tpt-sci-astro
Orbital-mechanics and coordinate-frame primitives for the tpt-science pillar,
built entirely from scratch on top of the in-house tpt-math-linalg dense
linear algebra (no external astrodynamics or geometry wrappers).
The crate implements the classical two-body problem in an Earth-Centered Inertial (ECI) reference frame:
- Classical (Keplerian)
OrbitalElements, validated on construction. - Conversion between Keplerian elements and ECI Cartesian state vectors
(
OrbitalElements::state_vectorandOrbitalElements::from_state). - Time propagation via Kepler's equation
(
state -> mean anomaly -> advance -> solve -> true anomaly) inOrbitalElements::propagate. - First-order J2 (oblateness) perturbation:
OrbitalElements::propagate_j2propagates elements including secular nodal-regression / apsidal-precession drift, andOrbitalElements::j2_secular_ratesreturns the raw rates. ConstantsEARTH_MU,EARTH_J2,EARTH_RADIUS_EQare provided for Earth. - Combined J2 + J4 zonal-harmonic secular perturbation:
OrbitalElements::propagate_j4/OrbitalElements::j4_secular_ratesextend the J2 model with the next zonal term (EARTH_J4). - Atmospheric drag:
atmospheric_density(single-band exponential Earth atmosphere model) plusOrbitalElements::drag_da_dt/OrbitalElements::propagate_dragfor the secular along-track decay of the semi-major axis (Vallado's standard averaged decay-rate formula). - Simplified third-body perturbation:
OrbitalElements::third_body_secular_rates/OrbitalElements::propagate_third_bodygive the leading secular (Kozai-Lidov, quadrupole-order) node/apsis/inclination/eccentricity drift from a Sun- or Moon-like perturber (SUN_MU,MOON_MU,ASTRONOMICAL_UNIT_KM,MOON_DISTANCE_KM), restricted to a perturber on a circular orbit lying in the reference plane. - Solar radiation pressure:
srp_acceleration/OrbitalElements::srp_acceleration_vectorimplement a cannonball SRP model (F = P_srp · Cr · A/m), automatically zeroed by the cylindrical Earth-shadow eclipse testin_earth_shadow.
All angles are in radians. The model assumes an ideal point-mass central body for the pure two-body propagation, with each perturbation above modeled as an independent first-order secular add-on (they are not combined into a single integrated force model, and none captures short-periodic oscillations). The third-body model is restricted to a circular, coplanar perturber; the SRP model is a simple cannonball (no attitude-dependent area or self-shadowing); the atmosphere is a single exponential band, not a full reference atmosphere; and only J2/J4 are modeled, not the full zonal harmonic series or tesseral/sectoral terms.
Depends on tpt-math-linalg (published).
Example
use ;
use OrbitalElements;
// A unit circular orbit about a unit-mass body.
let el = new.unwrap;
let = el.state_vector;
assert!;
License
Licensed under either of MIT or Apache-2.0 at your option.