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

odesolver in BVPSOL #14

Open
ChrisRackauckas opened this issue Jul 26, 2017 · 6 comments
Open

odesolver in BVPSOL #14

ChrisRackauckas opened this issue Jul 26, 2017 · 6 comments

Comments

@ChrisRackauckas
Copy link

For the DiffEq wrapper of BVPSOL, I am hoping that we can allow any common interface method for the odesolver in BVPSOL. How exactly would I set that up? More specifically, what is it looking for in the odesolver argument? A function with a specific signature?

@luchr
Copy link
Owner

luchr commented Jul 27, 2017

If odesolver≠nothing then odesolver (the IVP-solver) must be a (julia) function with input:
(rhs::Function, t0::Real, T::Real,x0::Vector, opt::AbstractOptionsODE) and output
(t,x,retcode,stats). That's the form of all the ODE-Solvers in ODEInterface.

Important:

  • The IVP-solver options (opt above) are a modified version of the OPT_IVPOPT, because BVPSOL gives the following (additional) values there: OPT_RTOL, OPT_MAXSS, OPT_INITIALSS.
  • The IVP-solver must return a stats["step_predict"] field. This step-size prediction is needed by `BVPSOL´.

@ChrisRackauckas
Copy link
Author

The IVP-solver options (opt above) are a modified version of the OPT_IVPOPT, because BVPSOL gives the following (additional) values there: OPT_RTOL, OPT_MAXSS, OPT_INITIALSS.

So it's essentially the same as the options that you pass in, but with these three fields changed? The last two make sense, but why is the relative tolerance modified?

The IVP-solver must return a stats["step_predict"] field. This step-size prediction is needed by `BVPSOL´.

What is step_predict? My guess would've been the initial dt prediction, but that's probably wrong because that value is OPT_INITIALSS.

@luchr
Copy link
Owner

luchr commented Jul 28, 2017

So it's essentially the same as the options that you pass in, but with these three fields changed? The last two make sense, but why is the relative tolerance modified?

Yes. The rel. tol. may be changed by BVPSOL in the cases, where BVPSOL does numerical differentiation.

What is step_predict? My guess would've been the initial dt prediction, but that's probably wrong because that value is OPT_INITIALSS.

step_predict is the prediction of the initial-value solver for the next time-step (if one would integrate past the given end-time). A analogon description is: "the last predicted step size of the last accepted step of the IVP-solver)"

@ChrisRackauckas
Copy link
Author

next time-step (if one would integrate past the given end-time)

Thanks. Out of curiosity, do you know how it uses this?

@luchr
Copy link
Owner

luchr commented Jul 31, 2017

BVPSOL is a boundary value problem solver working with the multiple-shooting principle.

Here is a picture (the black dashed line is the initial guess given by the user). The shooting is done from right to left in this example, because at (0,0) there is a singularity. The (initial) grid consists of 5 intervals (colors: blue, orange, green, red, purple). BVPSOL solves the 5 IVP (with the guess as initial values) and get trajectories. They are shown in the picture after the first step of BVPSOL. Now a Newton-Method is used to change the 5 initial values to get one continuous solution (the last result, after the convergence is also plotted). During this, a lot of IVP need to be solved and now to your question:

The blue IVP-solver has a step size prediction for its last step. Hence this is a (very) good initial step size to begin the numerical solution for the orange IVP-solver [especially if the Newton-method is converging and the gaps/jumps between different trajectories are getting smaller and smaller].

multipleshootingexample

@ChrisRackauckas
Copy link
Author

oh, so it's just using step_predict to set OPT_INITIALSS? Interesting. Thanks.

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

2 participants