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

controlled adams stepper #175

Open
wds15 opened this issue Oct 7, 2015 · 11 comments
Open

controlled adams stepper #175

wds15 opened this issue Oct 7, 2015 · 11 comments

Comments

@wds15
Copy link

wds15 commented Oct 7, 2015

The Adams* family of steppers is supposed to do evaluate less frequently the system function which is of great benefit if the system function is expensive. However, at the moment there seems to be no way to control absolute and relative error. This would be very useful to have in order to perform adaptive integration.

@mariomulansky
Copy link
Collaborator

The current implementation (which is the standard way) relies on the fact that all steps are done with the same step size. So including step size control is not possible. However, there is a formulation of the adams-bashforth that allows for step size control [1] and indeed this would be a good addition to odeint. I will look into this but I can't promise quick progress with this right now.

[1] Hairer Norsett Wannier "Solving ODES I" Chapter III.3 (p. 397)

@wds15
Copy link
Author

wds15 commented Oct 7, 2015

Yes, this would be a great addition. Just to add here: CVODE implements a variable order Adams method. Maybe this is worthwhile to look into (I can't give you a reference here, maybe it is possibly even based on the same reference you are referring to).

@mariomulansky
Copy link
Collaborator

Variable order or adaptive step size? These are very different things!

@wds15
Copy link
Author

wds15 commented Oct 7, 2015

Sorry, I am only the user here and all I would like to have is Adams type algorithm which guarantees me an abs+rel error tolerance. CVODE uses variable order Adams, but also ensures abs+rel tolerance to be right. Ultimately, the integrator would be better from my perspective if less calls to the system functor are needed (whatever that takes).

@mariomulansky
Copy link
Collaborator

Sure, I understand. I was asking in case you happened to know how this is implemented in CVODE. Anyhow, I found the description in the CVODE docs. Apparently, CVODE does both, step size control and order adaption. Again, I will try to get something similar into odeint.

For the time being you might want to look into the Bulirsch-Stoer steppers, they also offer step size control, order adaption and additionally dense output. They are not multistep methods, but should be an improvement over dopri5.

@wds15
Copy link
Author

wds15 commented Oct 7, 2015

Great. Many thanks!

Bulirsch-Stoer are supposed to be good for "high" precision; what does high mean? 1e-6 rel+abs?

@mariomulansky
Copy link
Collaborator

Hrm hard to say, but my feeling is that its strength comes into play only for higher precision like 1e-10...1e-14

@markusgft
Copy link

Dear all,
I have just come across this conversation since I'm very interested in using a variable-step adams_bashforth/adams_bashforth_moulton or adams_moulton integrator.
I am wondering if there are any news on this issue?
Any hints are highly appreciated, and thanks a lot in advance!

@GregorDeCillia
Copy link
Contributor

If anyone wants to implement a variable step adams-bashforth-moulton stepper in odeint, here is some mathematical bakground: http://www.aip.de/groups/soe/local/numres/bookcpdf/c16-7.pdf.
An implementation of a controlled 4th order adams-moulton method and a controlled 4th order adams-bashforth method can be derived from the formulas given there. There is also some discussion about varying orders on page 5.

@vhartman
Copy link
Contributor

Dear all,
I am currently in the process of writing a controlled adams bashforth moulton stepper (and as a byproduct an adaptive adams bashforth stepper). What's the process of integrating it into odeint respectively boost?
Best regards

@headmyshoulder
Copy link
Owner

Hi @vhartman, can you open a pull request with the controlled adams bashforth stepper? We will review the code and merge it into the master branch. Thank you for your constribution.

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

No branches or pull requests

6 participants