gurutva/dop853-nbody.js
Sovereign DOP853 (8th Order Prince-Dormand Explicit Runge-Kutta) N-Body Integrator.
854 lines · 19 exports
The header, as the file states it
What it loads
- frames/earth-orientation.cjs.js
What it exports
propagateevalRhsSTANDARD_GMBODY_NAMESAU_KMDAY_SmodelJ2_EARTHR_EARTH_AUJ2_MOONC22_MOONR_MOON_AULUNAR_POLET_TIDE_MOONNDOT_MOON_RAD_DAY2K2_EARTHI_MOON_EQphysicalLibrationsetEarthOrientationSS verses named in the header
none in the registry
The channels it runs in
Every function, what it calls, who calls it
13 top-level functions read from the source; the doc line is the comment above each; calls and callers are resolved across the registry’s modules by name. Line numbers are the file’s at engine 3f94072.
Oblateness acceleration of a body at relative position r (from the oblate body) about pole ẑ: a = −(3/2)·GM·J2·R²/r⁴ · [ (1 − 5s²) r̂ + 2s ẑ ], s = r̂·ẑ
The Moon's forced physical libration (Eckhardt's theory, its principal terms, deg): τ in longitude (the long axis turns by +τ; its annual 91″ and 273-yr 14″ terms drive the C22 along-track force), ρ in the equator's inclination, σ in its node. Arguments: the Delaunay set (mean anomalies M of the Sun, M′ of the Moon, F, D, Ω) and the planetary arguments K1 (Venus, 273 yr) and K2. ρ enters as I − ρ,
the IAU 2006/2000B functions: the engine's src/frames/earth-orientation.cjs, or any module with the same interface handed in by setEarthOrientation() (the offline app's copy of this file has no frames/ directory beside it)
per TDB day: M = GCRS → mean ecliptic & equinox of date (row-major, 9), pole = true celestial pole (GCRS)
linear interpolation between the day nodes (precession and nutation are smooth on a day)
the Moon's body axes (x long axis, y, z spin) in GCRS at TDB jd, from FRAME_M (call framesAt first)
zonal field (J2..J4) of a body of GM, radius R about the unit pole, at relative position r: acceleration
the Moon's degree-2 field (J2m, C22m) in its body frame MOON_AXES, at relative position r (from the Moon)
Cross product helper [a x b]
Evaluate full sovereign state derivative dY/dt = [V, A(P, V, t)].
Authentic DOP853 (8th Order Explicit Runge-Kutta Prince-Dormand 12-stage) Step.
Propagate Sovereign N-body system over requested times. @param {Array<Array<number>>} initialPositions - Nx3 array of positions (AU) @param {Array<Array<number>>} initialVelocities - Nx3 array of velocities (AU/day) @param {Array<number>} evalDays - Array of evaluation days relative to initial epoch @param {Object} options - Integration options { rtol, atol, maxStep, relativistic }