4 ms·
So you have for each body position at time t, mass, charge, whatever. Then you calculate the forces, acceleration and speed and finally the position, mass, char
by toolslive 8y ago
So you have for each body position at time t, mass, charge, whatever. Then you calculate the forces, acceleration and speed and finally the position, mass, charge,.... at (t+1). Rince repeat?
The problem with this strategy is that you accumulate errors and the results are a function of the floating point representation. Your universe big bang simulation might give you a steady state for floats but implode for doubles aso.
Also, checkpointing your results and restarting from the persistent state might make the simulating go somewhere else (which is how Lorenz discovered chaotic systems iirc).
Anyway, proceed with caution.
- T-A 8y agohttps://en.wikipedia.org/wiki/Symplectic_integrator https://en.wikipedia.org/wiki/Symplectic_integrator
- toolslive 8y agoit's an improvement (iirc, it makes the error-growth linear), but does not 'fix' the problem.
- T-A 8y agoThe whole point of symplectic integrators is that they guarantee energy conservation (when applied to Hamiltonian systems). It takes some work (random example found by quick googling: [1]) which may not be deemed necessary if the drift produced by a naïve implementation is already small, but an insurmountable obstacle it is not. [1] https://arxiv.org/abs/1005.1930 https://arxiv.org/abs/1005.1930
- vbuwivbiu 8y agoiirc for a limit cycle the error will be + or - over different intervals of the cycle but the sum of the error around the cycle will be zero
- yoshikiohshima 8y agoThanks for a comment. One thing I would like to point out is that this is a programming language and does not dictate what integrator you use; you can write your own and experiment. The idea is to make that be opened up for users.