'Repa' performance for planetary simulation

て烟熏妆下的殇ゞ 提交于 2019-12-02 17:23:33

Most Euler numeric integration methods suffer from cumulative round-off error that will eventually cause the simulation to "blow up". You may want to investigate advanced numerical integration methods, such as 4th-order Runge-Kutta or predictor-corrector.

Another place where n-body problem simulations become sticky is when two bodies get very close, such as a moon with a very eccentric orbit about its planet. If one uses fixed time increments for the simulation, the error during large changes of angular velocity can lead to division-by-zero errors or division by very small values that result in the simulation blowing up. Use of a variable delta-t that depends on the angular velocity can be beneficial.

These suggestions are based on running many such simulations as a project for an undergraduate physics course I took in 1973, while testing various numerical integration methods. Runge-Kutta and predictor corrector methods have been around since the dawn of digital computing and a number of books are available. See, e.g., Numerical Recipes: The Art of Scientific Computing by William H. Press, Brian P. Flannery, Saul A. Teukolsky and William T. Vetterling. (Cambridge University Press, 1989)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!