Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

WIP: symplectic solver based on velocity verlet #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

acroy
Copy link
Contributor

@acroy acroy commented Jan 27, 2014

This PR adds two functions, verlet_fixed and verlet_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 as verlet.

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.

@acroy
Copy link
Contributor Author

acroy commented Jan 27, 2014

cc: @tlycken, @stevengj, @pao

@acroy
Copy link
Contributor Author

acroy commented Jan 27, 2014

@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?

@kmsquire
Copy link

@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!

@acroy
Copy link
Contributor Author

acroy commented Jan 27, 2014

@kmsquire : Thanks! Indentation fixed in last commit.

@acroy acroy mentioned this pull request Jan 28, 2014
@tomasaschan
Copy link
Contributor

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 =)

@acroy
Copy link
Contributor Author

acroy commented Jan 29, 2014

@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...

@acroy acroy mentioned this pull request Mar 5, 2014
@mauro3
Copy link
Contributor

mauro3 commented Dec 30, 2015

Another reference is Hairer, Wanner & Lubich, 2002, chapter VIII.

@PerezHz PerezHz mentioned this pull request Mar 10, 2016
@mauro3
Copy link
Contributor

mauro3 commented Oct 31, 2016

Is there actually a reason this was never merged?

@acroy
Copy link
Contributor Author

acroy commented Oct 31, 2016

Good question ;-) I guess there might be two reasons: 1) Although the
method works it is very crude IMO and 2) We never settled the API - for
example, the current version doesn't use "the right-hand side" of the ODEs,
but rather the force...

On Mon, 31 Oct 2016 at 10:37, Mauro [email protected] wrote:

Is there actually a reason this was never merged?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#10 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF4onbpKZT0GjuDAWYAa36gWdMGXGAfxks5q5bbrgaJpZM4BcwFy
.

@mauro3
Copy link
Contributor

mauro3 commented Oct 31, 2016

Thanks for the clarification. Leave open or close?

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

Successfully merging this pull request may close these issues.

4 participants