Why is my astronomy simulation inaccurate?

余生颓废 提交于 2019-12-06 07:45:36
Monkey

The integration method is very important. You are using Euler explicit method, which is of low order precision, too low for proper physics simulation. Now, you get choices

  • General behaviour matters most : Verlet method, or Beeman method (Verlet with more precision), which have very good energy conservation but lesser precision for position and speed.
  • Precise positions matters most : Runge-Kutta order 4 or more. Energy won't be conserved, so your simulated system will act as if energy increases.

Furthermore, time = time + dt will have increasing loss of precisions for large number of steps. Consider time = epoch * dt where epoch is an integer, would make the precision of the time variable independent from the number of steps.

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