Residual

High-throughput orbital propagation with symbolic correction through a grounded Keplerian Physics-Informed Neural Network.

GitHub Repository: https://github.com/atlasshiny/Residual


Inspiration

When tracking complex spacecraft trajectories like Artemis/Orion, traditional numerical models inevitably diverge from reality due to unmodeled forces and perturbations. Residual bridges the gap between hard physics (CUDA-accelerated n-body propagation) and advanced machine learning (Physics-Informed Neural Networks and SINDy for symbolic corrections) to accurately correct and predict space flight data in real time.

What it does

Residual is a comprehensive system that:

  • Propagates Orbits: Replays high-fidelity Artemis/Orion trajectories using a high-performance CUDA/C++ n-body propagator.
  • Calculates Residuals: Quantifies where baseline physics models diverge from reference/Horizons ephemeris data, with active burn windows dynamically masked.
  • Generates Symbolic Corrections: Employs PINN and SINDy frameworks to output readable, closed-form correction equations.
  • Visualizes Everything: Features an interactive Tauri and Three.js frontend displaying live orbital viewports, correction equations, and error metrics.

How we built it

  • Core Propagator: Engineered in CUDA/C++ for high-performance FP64 Earth/Moon n-body propagation.
  • Machine Learning & Symbolic Branch: Processes residual time series to extract pruned symbolic expressions, benchmarking performance against baselines like MLPs and SINDy.
  • User Interface: A high-performance Tauri and Three.js desktop client providing a seamless interactive experience to explore predicted vs. actual paths and error metrics.

Frontier Technologies Used

  • NVIDIA Blackwell B200s: Leveraged for ultra-high-throughput FP64 numerical calculations and high-speed tensor operations driving the physics-informed training loops.
  • CUDA Tile Programming: Utilized for custom low-level memory and thread-block optimization across GPU streaming multiprocessors to maximize propagation performance.
  • NVIDIA Cosmos 3 Super: Explored during initial prototyping as a generative visual validation layer before pivoting entirely to deterministic numerical and symbolic rigor to maintain deep-space scientific accuracy.
  • Physics-Informed Neural Networks (PINNs) & SINDy: Embedded physical conservation laws directly into the neural loss landscape to output interpretable, closed-form correction equations.
  • NASA Horizons & SPICE Data: Ingested high-precision ephemeris and state vector data for the Moon's orbit and the Artemis I and II mission profiles as authoritative baseline truth.

Mathematical & Physics Foundation

As a team comprised of a Mathematics major and a Physics major, both double majoring as Computer Engineers, it was important to us to ensure that our mathematical representations of the physics being modeled were accurate. Below is the list of physics equations we used and some of the numerical methods we used to efficiently and accurately solve them.

1. Earth-Moon Circular Barycentric Ephemeris

$$\mu_{\rm tot} = \mu_E + \mu_M, \qquad \omega = \sqrt{\frac{\mu_{\rm tot}}{D^3}}, \qquad \theta(t)=\phi + \omega t$$

$$f_M = \frac{\mu_M}{\mu_{\rm tot}}$$

$$\mathbf r_E(t) = -D f_M \begin{bmatrix} \cos\theta \ \sin\theta \ 0 \end{bmatrix}, \qquad \mathbf r_M(t) = D(1-f_M) \begin{bmatrix} \cos\theta \ \sin\theta \ 0 \end{bmatrix}$$

2. Softened Point-Mass Acceleration

$$\mathbf a(\mathbf r,t) = -\frac{\mu_E(\mathbf r-\mathbf r_E)}{(|\mathbf r-\mathbf r_E|^2+\epsilon^2)^{3/2}} -\frac{\mu_M(\mathbf r-\mathbf r_M)}{(|\mathbf r-\mathbf r_M|^2+\epsilon^2)^{3/2}} + \mathbf a_{J2}(\mathbf r-\mathbf r_E) + \mathbf a_{\odot,\rm tidal}$$

$$\epsilon = \text{softening (m)}, \qquad \mathbf a_{\rm body} = -\frac{\mu\,\mathbf d}{(|\mathbf d|^2+\epsilon^2)^{3/2}}$$

3. J2 Oblateness Term

$$\mathbf d = \mathbf r-\mathbf r_E, \qquad r=|\mathbf d|, \qquad \hat{\mathbf s}\cdot\mathbf d = s_x d_x+s_y d_y+s_z d_z$$

$$\cos^2\theta_{\rm spin} = \frac{(\hat{\mathbf s}\cdot\mathbf d)^2}{r^2}$$

$$\mathbf a_{J2} = -\frac{3}{2}\frac{J_2\mu_E R_E^2}{r^5} \left[(1-5\cos^2\theta_{\rm spin})\mathbf d + 2(\hat{\mathbf s}\cdot\mathbf d)\hat{\mathbf s}\right]$$

4. Solar Tidal Term

$$\mathbf a_{\odot,\rm tidal} = -\frac{\mu_\odot(\mathbf r-\mathbf r_\odot)}{|\mathbf r-\mathbf r_\odot|^3} + \frac{\mu_\odot\,\mathbf r_\odot}{|\mathbf r_\odot|^3}$$

5. Numerical Integration & Maneuvers

  • Velocity Verlet (Kick-Drift-Kick): $$\mathbf v_{n+\frac12}=\mathbf v_n+\frac{\Delta t}{2}\mathbf a(\mathbf r_n,t_n), \quad \mathbf r_{n+1}=\mathbf r_n+\Delta t\,\mathbf v_{n+\frac12}, \quad \mathbf v_{n+1}=\mathbf v_{n+\frac12}+\frac{\Delta t}{2}\mathbf a(\mathbf r_{n+1},t_n+\Delta t)$$

  • Impulsive Burns: $$\mathbf v \leftarrow \mathbf v+\Delta\mathbf v_b \quad\text{if}\quad |t-t_b|<\frac{\Delta t}{2}$$

  • Adaptive Dormand-Prince Step: $$\mathbf k_i=\mathbf f\left(\mathbf y_n+\Delta t\sum_j a_{ij}\mathbf k_j,\;t_n+c_i\Delta t\right), \quad \mathbf y_{n+1}=\mathbf y_n+\Delta t\sum_i b_i\mathbf k_i, \quad \mathbf e=\Delta t\sum_i (b_i-b_i^*)\mathbf k_i$$ $$h_{\rm new}=h\,S\left(\frac{\mathrm{rtol}}{|\mathbf e|}\right)^{1/5}, \quad h_{\rm new}\in[h_{\min},h_{\max}]$$

6. Trajectory Validation Invariants

$$E = \frac{1}{2}|\mathbf v|^2-\frac{\mu}{|\mathbf r|}, \qquad \mathbf L = \mathbf r\times\mathbf v$$

Challenges we ran into

  • Generative Video & Scaling Limitations: We initially explored using cutting-edge video models as a render-and-validate layer. However, we found that generative image and video models were fundamentally too inaccurate and unreliable for deep-space scales—even with explicit guide videos—prompting us to drop them to maintain strict scientific precision.
  • Preserving Physics Authority: Ensuring that machine learning models and visual layers never compromise or pollute authoritative numerical ephemeris data.

Accomplishments that we're proud of

  • Building a high-performance CUDA/C++ orbital propagator integrated with PINNs and SINDy for clean, interpretable symbolic correction equations.
  • Creating a robust, end-to-end data pipeline spanning raw ephemeris ingestion, residual calculation, and high-framerate 3D spatial visualization.

What we learned

  • Physics Beats Generative Hype: We learned firsthand that generative video models fall short when forced into deep-space scales and strict orbital mechanics. This reinforced our commitment to authoritative mathematical grounding rather than forcing visual AI where it doesn't belong.
  • Bridging Disparate Domains: Combining high-performance CUDA/C++ numerical propagation with modern machine learning and symbolic regression taught us how to effectively merge traditional aerospace engineering with automated discovery.

What's next for Residual

  • Refining symbolic regression pruning routines for tighter error bounds.
  • Extending support for universal spacecraft and multi-body mission schemas.

Built With

Share this project:

Updates

Submission history