ericagol / NbodyGradient.jl

N-body integrator computes derivatives with respect to initial conditions for TTVs, RV, Photodynamics & more
MIT License
21 stars 9 forks source link

Integration with Octofitter and PlanetOrbits #103

Open sefffal opened 6 days ago

sefffal commented 6 days ago

Hi all, I have a long term goal to support N body modelling in Octofitter. Although not 100% necessary, gradient-based propagation would be a huge performance benefit, especially for high-dimensional models.

Currently Octofitter uses our PlanetOrbits.jl to propagate 2-body orbits using Kepler's laws (with various pluggable Kepler solvers). I wonder if there is a route forward to evolve PlanetOrbits to optionally use NBodyGradients as one of these backends.

We do have a CartesianOrbit basis already that represents the two bodies using (x,y,z,vx,vy,vz) coordinates: https://sefffal.github.io/PlanetOrbits.jl/dev/api/

Best, @sefffal.

ericagol commented 6 days ago

@langfzac has been developing much of the API for NbodyGradient recently. Would you need an output of the positions and velocities at pre-specified time steps (along with their derivatives)?

sefffal commented 6 days ago

@ericagol yes, that's the main goal. Then ideally we could express those derivatives as autodiff-rules so that Enzyme / ForwardDiff can continue to act as glue.

bmlindor commented 3 days ago

I've started to create a Orbits.jl module to perform the integrations and retrieve the positions and velocities. I can work with Zack to improve the API and deploy to the main branch

https://github.com/bmlindor/NbodyGradient/blob/master/src/Orbits.jl