It's pretty good except it runs a lot slower than it has to.
The default step size is too small for most cases so you have to wait a long time for the planets to move around.
When I tried increasing the step size with the slider I'd inevitably increase it too much and the planets would fly away.
Personally I always use RK4 and similar algorithms with adaptive step size, mostly because it is a pain to tune the step size by hand
https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods#Ad...
also if planets are passing close to each other you may need a shorter step when you are close and a longer step when you are far away.
RK4 or RK5 with adaptive timesteps will make your demo much better with very little work.
There are methods that use higher order derivatives and other tricks to take large steps, for instance I like this method
https://github.com/alexrudy/bsint
If you were integrating the solar system for millions of years you would want a symplectic integrator.
https://en.wikipedia.org/wiki/Symplectic_integrator
this might not be more accurate than another integrator but it will preserve phase space area which makes it possible that the long-term dynamics will "look like" the real long-term dynamics. (Otherwise it certainly won't!)
If it were me in cases where there is a central large mass I would integrate in spherical or cylindrical coordinates, probably I would use a predictor-corrector method.
Many thanks for your feedback! Implementing an integrator with an adaptive time step is on my bucket list of features that I intend to implement, as tweaking the time step manually, especially with the freaking slider, is somewhat of a pain in the neck. Another reason for why I want to implement an adaptive time step is that collisions don't really work with a fixed one as sometimes a mass will travel farther in one time step than the radius (I use a simple radius check for collisions since it doesn't require that much computing power) of the body it is smacking into, and as such the hit won't get registered, which looks kind of shoddy (implemented collisions but removed them for this reason).I've had an eye on the RK45 method, but I'm definitely going to give implementing the Bulirsch-Stoer Integrator a go as I want the user to be able to select the integrator they want to run a scenario with (right now I've just implemented Euler and RK4). As for using spherical or cylindrical coordinates, the thing is that the intention is for the user to be able to, for instance, add another sun to our solar system to marvel at all the cosmic shenanigans that would take place, so while a lot of the scenarios start out with a single large mass, that might not be the case for long if the user has a penchant for destruction.
https://landgreen.github.io/physics/notes/electromagnetism/p...