-
-
Notifications
You must be signed in to change notification settings - Fork 49
WIP: symplectic solver based on velocity verlet #10
base: master
Are you sure you want to change the base?
Conversation
@jiahao : Thanks for the comments. I will fix the typos in the next iteration. The indentation issue is odd, because locally I have four spaces. Is there any git(hub) magic one should know? |
@acroy, it's nothing to do with github, it's just that you're using tab characters instead of spaces. In official Julia projects, the standard is to use 4 spaces instead of tab characters. Most IDEs/editors can be set up to do this automatically. Cheers! |
@kmsquire : Thanks! Indentation fixed in last commit. |
Haven't had time to kick the tires, really, but this seems good. An adaptive AND symplectic method really does add value to the suite. I'll get back with more input when I have the time =) |
@tlycken : that would be great. I should add that from reading a bit about adaptive symplectic methods, I got the impression that methods based on rescaling time (like here) actually seem to be preferred... |
Another reference is Hairer, Wanner & Lubich, 2002, chapter VIII. |
Is there actually a reason this was never merged? |
Good question ;-) I guess there might be two reasons: 1) Although the On Mon, 31 Oct 2016 at 10:37, Mauro [email protected] wrote:
|
Thanks for the clarification. Leave open or close? |
This PR adds two functions,
verlet_fixed
andverlet_hh2
, which implement the velocity Verlet method with fixed and adaptive time-steps, respectively. The latter uses an estimate of the error based on comparing a full step with two half-steps. This function is exported asverlet
.The interface is largely compatible with the proposal in #7. The main difference is, that "velocity" and "position" are
specified (and returned) separately, instead of having one solution vector. Moreover, the acceleration (or force) currently only depends on time and position.
There are still some other things to do (absolute and relative tolerances, intermediate steps in
tspan
, ...), which partly depend on the outcome of #7.Examples can be found here: harmonic oscillator and pendulum
Comments and suggestions are very welcome.