1

I am currently implementing a n-body-simulation (gravity/3D) for big n (depending on how things go > 1Mio. particles) and am wondering, what integration-method to use. I guess it should have variable step-size to minimize errors.

I'm using the barnes-hut-algorithm and boost/odeint, but will probably write my own integrator to reduce overhead (which boost probably has because it's general purpose). I'm not sure yet, if I will use other methods than barnes-hut to improve performance further.

Since the evaluation of an ODE-function with that many particles is very expensive, I guess an integrator that uses as little function-evaluations as possible would be best. But I couldn't find any good information about integrators (especially for n-body-simulations with big n). Performance would be more important to me than accuracy (as long as accuracy is reasonabe).

So can anybody tell me what would be a good integrator for this type of problem? Right now I'm using runge-kutta dormand-prince (4/5th order) and sometimes switch to fehlberg (7/8)...

Lutz Lehmann
  • 25,219
  • 2
  • 22
  • 51
Paul Aner
  • 361
  • 1
  • 8
  • 2
    In the reviews I read, for simulations for space exploration usually methods around 8th order are sufficient. For long-term simulations also 10th to 12th order symplectic methods (with many stages, but large step sizes) or similarly high-order explicit RK methods are used. More important would be a (dynamically) hierarchical and correctly truncated interaction model. Algorithm design is sightly off-topic here, in other places you find, e.g., https://scicomp.stackexchange.com/questions/25581. Space.SE and astronomy.SE might also be relevant, but do not have easily found similar topics. – Lutz Lehmann Feb 09 '22 at 08:34

0 Answers0