Expand description
3D N-Body Symplectic Gravitational and Relativistic Orbital Solver.
Provides a zero-heap Velocity-Verlet / symplectic leapfrog integrator with Newtonian pairwise gravitational acceleration and optional 1st Post-Newtonian (1PN) Einstein-Infeld-Hoffmann perihelion precession corrections.
Reference: AGENTS.md Workstream W5 (§5.4).
Structs§
- Celestial
Body3D - A celestial mass in 3D Cartesian coordinates.
Constants§
- GRAVITATIONAL_
CONSTANT - Gravitational constant $G$ in $\text{m}^3 \cdot \text{kg}^{-1} \cdot \text{s}^{-2}$.
- MAX_
STACK_ BODIES - Maximum number of bodies supported in zero-heap stack buffer allocations.
- SPEED_
OF_ LIGHT - Speed of light in vacuum $c$ in $\text{m} \cdot \text{s}^{-1}$.
Functions§
- step_
nbody_ 3d_ verlet - Advances an N-body system by
dt_sseconds using a symplectic Velocity-Verlet step. - total_
angular_ momentum - Evaluates total 3D angular momentum vector $[L_x, L_y, L_z]$ of the system ($\text{kg} \cdot \text{m}^2 \cdot \text{s}^{-1}$).
- total_
mechanical_ energy - Evaluates total mechanical energy (kinetic + gravitational potential) of the system in Joules.