Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 6
    $\begingroup$ I would add to this that Geometric Numerical Integration is a great reference on symplectic methods if you want to read more. $\endgroup$ Commented Nov 20, 2022 at 17:59
  • 1
    $\begingroup$ Also note that there are no symplectic explicit methods: scicomp.stackexchange.com/questions/32728/… - so if you symplecticity is important for you, you will have to switch to implicit methods. $\endgroup$ Commented Nov 21, 2022 at 7:27
  • 1
    $\begingroup$ An incorrect implementation would also have bad energy conservation properties... though it's certainly true that RK4 does suffer from these problems (maybe not to this degree). Proper convergence testing is much better at identifying whether the problem is really the implementation or something more fundamental with the chosen discretization. $\endgroup$ Commented Nov 21, 2022 at 8:16
  • 3
    $\begingroup$ @Daniel luckily N-body falls into the category of problems you can implement some explicit symplectic integrators. Though even without the symplectic property standard RK methods can have energy conservation on the order of 1e-12, which while not perfect or to floating point precision is usually good enough for modest time ranges. $\endgroup$ Commented Nov 21, 2022 at 8:20
  • 2
    $\begingroup$ @helloworld922 : Symplectic methods require a fixed step size to have their advantageous properties. And that also only as long as they stay far away from the singular points of the vector field. In contrast, to get good performance from RK methods they need to be variable-step, the step sizes adapted to an error tolerance. Then the conserved quantities will also be correct to this level, possibly a little bit better. $\endgroup$ Commented Nov 21, 2022 at 9:22