[ATI 2024] Nii-body: Beyond Keplerian Models with Bayesian N-body Inference
Nii-body: Bayesian Inference of Multiplanet Dynamics via N-body Simulations
The paper introduces Nii-body, an open-source Bayesian inference framework that couples N-body gravitational simulations with an automated parallel tempering MCMC algorithm. It achieves SOTA-level precision in retrieving orbital parameters for compact multiplanet systems, specifically outperforming traditional Keplerian models in resonant configurations like the Kepler-9 system.
TL;DR
Researchers have unveiled Nii-body, a high-performance C-based tool designed to solve one of the most persistent headaches in exoplanetary science: accurately fitting the orbits of multiplanet systems where the planets are "tugging" on each other. By replacing simplified Keplerian math with full N-body simulations and a sophisticated MCMC engine, Nii-body can recover the true physical parameters of complex systems—like the resonant Kepler-9—where previous methods failed.
Context: When Planets Stop Behaving
For decades, astronomers have relied on the "Keplerian superposition" approximation. This assumes that if a star has multiple planets, you can simply add up their individual orbits as if they don't interact.
While this works for "lonely" planets, it falls apart in resonant systems (like those in a 2:1 mean motion resonance). In these cases, the gravitational exchange between planets causes long-term drifts in Radial Velocity (RV) and Astrometry. As we move into the era of microarcsecond precision with missions like CHES and THEIA, these "ignored" perturbations become the signal itself.
Methodology: The Nii-body Architecture
Nii-body is built on two pillars: Numerical Precision and Statistical Robustness.
1. The RKF78 Integrator
Instead of assuming an elliptical path, Nii-body solves the standard Newtonian equations of motion:
eq i} m _ {j} \frac {\boldsymbol {r} _ {j} - \boldsymbol {r} _ {i}}{| \boldsymbol {r} _ {j} - \boldsymbol {r} _ {i} | ^ {3}}$$ The authors use an adaptive Runge–Kutta–Fehlberg 7(8) (RKF78) solver. This ensures that even during close planetary encounters, the step size adjusts to keep errors within $10^{-14}$—effectively machine precision.  *Fig 1: Schematic of the coordinate system used to project 3D N-body motion into observable Right Ascension and Declination offsets.* ### 2. Automated Parallel Tempering MCMC Fitting 15+ parameters (masses, eccentrically, inclinations, etc.) creates a "rugged" likelihood landscape. Standard MCMC often gets stuck in "local traps." Nii-body utilizes **Parallel Tempering**, where multiple "chains" at different "temperatures" explore the space. High-temperature chains leap across the landscape to find global peaks, while "cold" chains refine the local details. ## Experimental Validation: The Kepler-9 Test The team tested Nii-body on a synthetic version of the **Kepler-9 system**, which features two massive planets in a 2:1 resonance. ### The Failure of Simplicity As shown below, the difference between the "Self-consistent N-body" model and the "Keplerian Superposition" is not just noise—it is a systematic drift.  *Fig 2: The residuals (N-body minus Keplerian) clearly show that the interaction signal is significant over a 5-year span.* ### Results of the Blind Search * **Convergence**: On a standard laptop (i7-12650H), the code found the global solution in ~24 hours starting from zero prior knowledge. * **Accuracy**: In 75% of runs, the MCMC posterior means matched the input truth for all 15 parameters. * **Contrast**: When the same data was fed to a traditional Keplerian model, it **failed to converge in 0% of cases**, highlighting that N-body modeling isn't just "better"—it is **mandatory** for resonant systems.  *Fig 3: The corner plot post-MCMC shows the tight constraints achieved on mass and orbital elements.* ## Critical Insight: Why This Matters The value of Nii-body lies in its **efficiency**. Traditionally, N-body MCMC was considered too slow for "blind searches" (where you don't already know the approximate orbit). The authors have proved that by optimizing the code in **C** and using **Adaptive MCMC**, we can perform exhaustive Bayesian inference on consumer hardware. ### Limitations & Future Work - **Physical Complexity**: The current version treats stars/planets as point masses and neglects proper motion/parallax in the synthetic model. - **Stability Constraints**: Future versions should include a "stability filter" to automatically discard orbital solutions that would result in planets crashing into each other over millions of years. ## Conclusion Nii-body represents a transitional step from *discovery-driven* exoplanetary science to *characterization-driven* science. As mission concepts like CHES begin to look for Earth-like worlds in multiplanet systems, the ability to account for every gravitational "tug" will be the difference between a false positive and a historic discovery.