Forecasting N-Body Dynamics: A Comparative Study of Neural Ordinary Differential Equations and Universal Differential Equations

Suriya R S, Prathamesh Dinesh Joshi, Rajat Dandekar, Sreedath PanatXAI4Science @ AAAI 2026

TL;DR

This paper compares two Scientific Machine Learning (SciML) approaches, Neural Ordinary Differential Equations (Neural ODEs) and Universal Differential Equations (UDEs), for forecasting the complex dynamics of the N-body problem. UDEs, which incorporate known physics, demonstrate significantly better data efficiency and robustness to noise compared to purely data-driven Neural ODEs, achieving accurate forecasts with as little as 20% of the data.

What Problem Does This Paper Address?

The N-body problem, a cornerstone of astrophysics, describes the motion of multiple celestial bodies under mutual gravitational influence. While analytical solutions exist for two bodies, systems with three or more become incredibly complex, traditionally relying on numerical integration. However, these solvers assume perfect knowledge of physical laws and struggle with unmodeled physics or noisy observational data. This paper addresses the challenge of accurately and robustly forecasting N-body system trajectories, especially in scenarios with limited data and inherent noise, by comparing two SciML frameworks: Neural ODEs, which learn dynamics solely from data, and UDEs, which integrate known physical laws with neural networks to learn only the unknown parts of the dynamics.

Methods

The study employs two primary SciML frameworks:

  • Neural Ordinary Differential Equations (Neural ODEs): This approach treats the entire system's dynamics as a black box, represented by a neural network. The network learns to map the system's state (positions and velocities) to its rate of change, effectively learning the governing differential equations directly from the data.
  • Universal Differential Equations (UDEs): UDEs offer a hybrid approach. They retain known physical laws (in this case, the general form of gravitational interaction and the summation of pairwise forces) and replace only the specific, potentially unknown or incomplete, interaction term with a neural network. This allows the neural network to discover the precise nature of the gravitational interaction from the data, guided by the known physics.

Both models were implemented using Julia's SciML ecosystem. The core of the analysis involves determining the "forecasting breakdown point" – the minimum amount of training data required for accurate predictions.

Datasets

The study uses synthetically generated data for a 3-body system. This data is created by simulating the system using a Runge-Kutta integrator and then introducing varying levels of Gaussian noise:

  • Noise-free: Ideal data from the simulation.
  • Moderate noise: Gaussian noise with a standard deviation of 7% of the data range.
  • High noise: Gaussian noise with a standard deviation of 35% of the data range.

These datasets are used to train and evaluate the models, with different training-forecasting splits (e.g., 90%-10%, 80%-20%, 40%-60%, 20%-80%) to assess performance under data scarcity.

Key Insights and Ideas

  • Physics-Informed Models Shine in Data Scarcity: The most striking insight is the superior data efficiency of UDEs. By incorporating known physics, UDEs can generalize effectively from much smaller datasets than purely data-driven Neural ODEs. This highlights the power of "hardcoding" physical priors.
  • Robustness to Noise: UDEs also demonstrate greater resilience to noise in the training data. While Neural ODEs can struggle to filter out significant noise, UDEs, guided by physical principles, tend to produce smoother and more physically plausible trajectories even with corrupted data.
  • Forecasting Breakdown Point: The concept of a "forecasting breakdown point" is crucial. It quantifies the minimum data requirement for reliable long-term predictions, revealing a significant gap between the two approaches. Neural ODEs require a substantial amount of data (around 90%) to avoid forecasting failure, whereas UDEs can achieve accurate forecasts with as little as 20% of the data.
  • Interpretability Advantage: While not the primary focus, the paper hints at the increased interpretability of UDEs, as the learned neural components can be investigated to understand discrepancies or unmodeled effects within the known physical framework.

Key Results

  • Data Efficiency: UDEs achieved accurate forecasts using only 20% of the training data, while Neural ODEs required approximately 90% of the data for comparable performance in noise-free scenarios.
  • Noise Handling: In high-noise conditions, UDEs consistently produced more stable and physically coherent forecasts compared to Neural ODEs, which often degenerated into physically unreasonable trajectories.
  • Generalization: UDEs showed remarkable generalization capabilities, maintaining accurate predictions far into the forecast horizon even with limited training data, a feat that Neural ODEs struggled with.

Limitations and Future Work

  • Short-Term Focus: The current study primarily focuses on short-term forecasting and proof-of-concept recovery, not long-horizon stability.
  • Single Initial Condition: The analysis was conducted using a single set of initial conditions, and the models' scalability to different initial conditions remains an open question.
  • 3-Body System: The study is confined to a 3-body system, and its scalability to systems with a larger number of bodies needs further investigation.
  • Future Directions: The authors suggest extending the work to long-term forecasting, generalizing the framework to more complex gravity systems (including non-gravity forces or relativistic effects), and applying these SciML models to real observational data.

Summary updated

BibTeX
@inproceedings{s2026forecasting,
  author = {Suriya R S and Prathamesh Dinesh Joshi and Rajat Dandekar and Raj Dandekar and Sreedath Panat},
  title = {{Forecasting N-Body Dynamics: A Comparative Study of Neural Ordinary Differential Equations and Universal Differential Equations}},
  booktitle = {XAI4Science @ AAAI},
  year = {2026},
  url = {https://openreview.net/forum?id=nTCbEqff7e},
}
Figure