Skip to content
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

Use a symplectic integrator. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

idontgetoutmuch
Copy link

This preserves the Hamiltonian / Energy but it is O(h) so you may wish to stick with rk4/5 which is O(h^4) for demonstration purposes (I'd recommend pointing out to users that it does not preserve the system). On the other hand, Stan (http://mc-stan.org) uses leapfrog which is O(h^2) and no more difficult to implement than symplectic Euler so maybe it would be worth implementing that for now? Ideally one should write a symplectic order 4 integrator but I don't have time to do that at the moment.

@mstksg
Copy link
Owner

mstksg commented Dec 10, 2016

Thanks for this! I saw the demonstrations in the comment to the blog post and it's pretty awesome. I'm impressed that we can preserve energy pretty much perfectly.

I'm wondering what the best route here is...maybe to offer multiple integrators (as an input enumerable, maybe) so people can decide?

@idontgetoutmuch
Copy link
Author

Maybe but it's not a trivial undertaking. I found Ernst Hairer's implementation: https://www.unige.ch/~hairer/software.html and a Julia implementation: https://github.com/DDMGNI/GeometricIntegrators.jl. I certainly would need to refresh my knowledge by ploughing through Iserles' book and also through Hairer's book. It is certainly an interesting project but I need to finish other things before starting on yet something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants