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

Speeding up series computations #42

Closed ericagol closed 3 years ago

ericagol commented 3 years ago

Right now the G_3 and H_1-H_8 functions are evaluated with series expansions when \gamma is small. These take a significant fraction of the time in the kepler+drift solver. Currently each of these functions is computed separately, and the coefficients are computed every time they are evaluated. We can greatly speed this up as follows:

Some nuances:

ericagol commented 3 years ago

Well, after creating a function to pre-compute the coefficients (in the branch GHcoeff), store them in a structure, and then evaluate these three functions simultaneously, the end result is that it's faster to compute these directly! Not sure why... But closing this for now.