A differentiable N-body code for transit timing and dynamical modeling. I. Algorithm and derivatives

Eric Agol, David M. Hernandez, Zachary Langford
6/4/2021
11 citations
astro-ph.EPastro-ph.IMastro-ph.SR

Official code: ericagol/NbodyGradient.jl (30 stars, Julia, MIT, last commit 2026-10-09).

Abstract

When fitting N-body models to astronomical data - including transit times, radial velocity, and astrometric positions at observed times - the derivatives of the model outputs with respect to the initial conditions can help with model optimization and posterior sampling. Here we describe a general-purpose symplectic integrator for arbitrary orbital architectures, including those with close encounters, which we have recast to maintain numerical stability and precision for small step sizes.

Show full abstract

We compute the derivatives of the N-body coordinates and velocities as a function of time with respect to the initial conditions and masses by propagating the Jacobian along with the N-body integration. For the first time we obtain the derivatives of the transit times with respect to the initial conditions and masses using the chain rule, which is quicker and more accurate than using finite differences or automatic differentiation. We implement this algorithm in an open source package, NbodyGradient.jl, written in the Julia language, which has been used in the optimization and error analysis of transit-timing variations in the TRAPPIST-1 system. We present tests of the accuracy and precision of the code, and show that it compares favorably in speed to other integrators which are written in C.

View on arXivView PDF

Code Implementations(1)

MIT

N-body integrator computes derivatives with respect to initial conditions for TTVs, RV, Photodynamics & more

3010Julia, Rich Text FormatDec 5, 20171 months agoMIT

Similar Papers

Cite this paper

@article{agol2021differentiable,
  title  = {A differentiable N-body code for transit timing and dynamical modeling. I. Algorithm and derivatives},
  author = {Eric Agol and David M. Hernandez and Zachary Langford},
  year   = {2021},
  eprint = {2106.02188},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.02188}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.02188.svg)](https://codeofpaper.com/paper/2106.02188)

Discussion