4 ms·
> But honestly I am certain that it is something in particular and not something mysterious about conservation of energy/momentum which i have not come across y
by exDM69 9y ago
> But honestly I am certain that it is something in particular and not something mysterious about conservation of energy/momentum which i have not come across yet, because there is no formula in that gravity simulation which should be able to destroy momentum
It's a well established fact that numerical integration methods either gain or lose energy (in particular, the Runge-Kutta family is known to lose energy over time). For celestial mechanics simulations, a special class of numerical integration methods called "symplectic integrators" are used and their purpose is to conserve energy and angular momentum.
> but if you do any adjustments to correct it, that is a kind of fudge not based in true physics.
When you are numerically integrating differential equations that model physical phenomena, you're not doing "true physics" but an approximation thereof.
And an approximation that makes Earth drift 70 km per year or Saturn's moons drift out of orbit in a few hundred years is a very bad approximation by scientific standards.
The methods used for celestial mechanics calculations need to be precise over thousands to millions of years. And the way they work is to "fudge" with the numerical methods to preserve energy and angular momentum. It's a much better approximation of "true physics" than your toy simulation.
Your assumption that the issues are due to floating point errors is incorrect. 64 bit double precision is millimeter accurate to the orbit of Neptune. That's good enough for scientific applications.
If you're interested in this, you could take a look at this scientific grade N-body simulator and the methods it uses:
https://github.com/hannorein/rebound https://github.com/hannorein/rebound
- strainer 9y ago> Your assumption that the issues are due to floating point errors is incorrect. Its not as easy as declaring the resolution of absolute position. If you really want to spend the time on figuring it out, then examine the difference in scale between the bodies positions, velocities, accelerations given different model timestep values, what happens during the squaring summing and rooting, multiplying by G of those values and also even (because i have looked into this before) the subdivided timestep values involved in tempering this models data, so it becomes a perfectly stable quantised version of its anologe values (with no need for the kind of corrections Runge-Kutta is notable for) That link is very intresting to me thankyou. You can notice that it includes some quite simple integration schemes as 'symplectic' (basically means stable without need for gross correction)
- strainer 9y ago>64 bit double precision is millimeter accurate to the orbit of Neptune. It's a good point of order though, I got this mixed up last time I looked at issues in that system. I got fed up trying to explain, that the integration scheme used there is "symplectic" - it doesn't require gross adjustments, so the many bugs that have and will spring up shouldnt be patched with gross adjustments. If the model is gaining or loosing energy, i cant blame it on the integrator or on missing physics. So regardless of that, thanks for the correction, i had got it in my head 53bit mantissa was somewhat less than mm resolution at Neptune. Im still wary that the resolution could easily cause problems, but accept there is a fair chance these could be avoided with careful calculations.