ericagol / NbodyGradient.jl

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

Jumps in transit timing ephemerides #19

Closed ericagol closed 5 years ago

ericagol commented 5 years ago

In the routine stepsize_precision.jl in paper/figures, when the integration time is sufficiently long, there appear to be jumps in the ephemerides.

I tracked this down to a roundoff error in computing the integration time with small step sizes: when the stepsize is sufficiently small, then the rounding error is more severe. This causes jumps at the points that the rounding error for the total time reaches a large value of the rounding precision.

I'm going to write a routine to experiment with this: it either calls for computing the timing of the simulation at higher precision, or perhaps for compensated summation, ala Kahan.

ericagol commented 5 years ago

I found that using compensated summation to compute the integration time steps worked beautifully, and this gives as good precision as carrying out the time step computation in BigFloat, and converting back to Float64. So, I think this is the way to go, and it was easy to add to the code, and has fixed the problem with the kinks in the transit times at small time steps.