Remix.run Logo
nhatcher 8 hours ago

This is amazing! Nicely done!

I did something similar, mostly 2D here:

https://www.nhatcher.com/three-body-periodic/

(Mine is just unfinished)

jgchaos 7 hours ago | parent | next [-]

Thank you! Your 2D version is great, I love seeing how different people approach this stuff. As for integrators, I currently only have Velocity Verlet and RK4 (can change in the advanced settings). I started with just Verlet, but to get some of the presets to behave properly I ended up needing RK4 as well. I’ve been thinking about adding adaptive methods next, but I'll take a look at the methods you've got listed too. Everything is still running in plain JS for now. I started moving some of the work into web workers but haven’t finished that part yet.

saboot 4 hours ago | parent [-]

Symplectic integrators are the approach I used for some old galaxy simulations. Page 5 on the attached paper was my main reference, eq 22 https://arxiv.org/pdf/cond-mat/0110585 I believe this is used in several academic codes for long term N-body calculations.

nhatcher 8 hours ago | parent | prev [-]

I would be very curious to compare notes on the integrators you used. How good do they perform in general?

In the avobed shared you can go to the settings a pick an integrator. I did the integrators in wasm although I suspect js is just as fast.

Color me impressed! I love the ammount of settings you can play with. I still need to understand what happens whe yu add more bodies though.