-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accumulate gravitational interactions in DoublePrecision #1351
Comments
Tried this, and it doesn't help, the system remains sensitive to the order. |
It turns out that using compensated summation ( Using full double precision fixes the problem, but we probably don't want to pay the cost of 10 additions/subtractions instead of 1 in the inner loop of the force computation. For a stable solar system these inaccuracies have no effect whatsoever. |
Code pushed to pleroy/1351. |
Would either pairwise summation, or Kahan summation help this? |
See the reference to "compensated summation" in the comment above, which is another name for "Kahan summation". Kahan summation can yield large relative errors for ill-conditioned sums. That's one of these cases. |
And pairwise isn't helping enough? |
Pairwise is less precise than Kahan and has the same conditioning properties. The numerical analysis above was mostly done to check that the sensitivity to order doesn't hide a bug. It doesn't. Done. The problem of accurately predicting the Kerbin system over long periods of time is spectacularly uninteresting as that system is extremely unstable (on a scale of months in the stock game). |
Different behaviour due to non-associativity being amplified by the uncorrected stock system's terrible Ляпунов exponent is expected, but Aardvark being stabler than Kerbol which is stabler than Sun points to a systematic error due to cancellation.
The text was updated successfully, but these errors were encountered: