4 ms·
IIRC I was calculating forces for every pair, which is ok for small N (e.g. a solar system, rather than a galaxy).
by hermitcrab 3y ago
IIRC I was calculating forces for every pair, which is ok for small N (e.g. a solar system, rather than a galaxy).
- 4gotunameagain 3y agoIntegrating physics simulations like that is very inefficient and inaccurate, as it does not conserve momentum. I get it, it was a toy, but if you're really interested look up adaptive step symplectic integrators.
- hermitcrab 3y agoI was just messing doing a bit of recreational programming, with my son. It was good enough for my purposes!
- 4gotunameagain 3y agoTotally get it ! Just thought of suggesting it in case you wanted to dig in deeper :)