-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Some ideas #68
Comments
The biggest issue, the reason for the two integrators, is because during the iterations it will need to be disconnected so that way you're building the new interval solution while using the old interpolation, and iteratively contracting based on full interval interpolations. I don't think that you can refine that step-by-step since otherwise the interpolation may oscillate. |
Yes, that's clearly the biggest issue, and maybe one has to adapt or change some of the ideas. Maybe this would work:
|
That could be done by allowing a choice of indices for which the It sounds like we're heading down the same path we did before. I cannot say I enjoy the current code at all (this an MultiScaleArrays.jl are what I consider my nightmare ideas, but since they give so many nice features I can't get rid of them), but it's difficult to do much more. However, I would like to give the "integrator as parameters" approach a try, and it's one of the reasons for allowing that option. But it will take a significant refactor of the OrdinaryDiffEq.jl code to allow for it, and I will want to do it in StochasticDiffEq.jl as well if we can (and that will give us SDDEs!). |
If we wanted, we can make |
I hope I can put together a PR in the next days/week (this feature has to be added to OrdinaryDiffEq though, it seems).
Yes, the revised idea is more similar to the current approach but it is still not the same. In my opinion, it would have some advantages, the biggest being that it avoids these multiple layers of closures and prevents any abuse of fields or side-effects that are currently possible within the interpolating
Sure, so far this was just me dreaming about a more pleasant setup. I noticed that you mentioned this idea some time ago but that it's not implemented yet. At which level should one decide whether to call
Instead of something like
Wouldn't this be quite some overhead if the history function is built during every function evaluation? |
Yeah, it would have to go there first.
Maybe. Depends on compiler optimizations.
I was just going to go into every |
In my opinion, DelayDiffEq is a lot more complicated than it should be, which also makes analysis and fixes more difficult. Hence I started to think about how the current situation could be improved.
Status quo
Currently, when initializing a new
DDEIntegrator
anODEIntegrator
is created (but not initialized) whose function, however, can never be evaluated since it has the wrong number of arguments. Hence in a quite confusing way it is wrapped, together with its solution, in aHistoryFunction
, which itself is wrapped in a new differential equation of the form needed forOrdinaryDiffEq
. Based on this, aDDEIntegrator
is defined that duplicates all fields of anODEIntegrator
and uses this closure for function evaluations; henceOrdinaryDiffEq
can be used for integration; in a quite advanced way the initialODEIntegrator
is updated to ensure a correct history function. Moreover, to reduce memory the caches of thisODEIntegrator
are transferred to theDDEIntegrator
, and the solution of the integrator is shortened already during integration if possible.Ideas
ODEIntegrator
: This is currently not possible since the DDE function depends on argumenth
as well which itself depends on the interpolation of theODEIntegrator
that does not exist yet; possible solution:h
in aHistoryFunction
that can be called as(::HistoryFunction)(integrator, t, ::Val{deriv}; idxs = nothing)
(and so on):integrator
instead of parametersp
during integration as it was discussed already when the breaking changes were introduced in Januaryintegrator
to the wrapper would still allow to only passintegrator.p
to the wrapped initial functionh
f
and thisHistoryFunction
(probably together with analytic solution, gradient, Jacobian etc.) in aDDEFunction <: AbstractDiffEqFunction
(::DDEFunction)(du, u, integrator, t)
(and so on), as required byOrdinaryDiffEq
integrator
instead of parametersp
integrator.p
tof
f
andh
that belong together (e.g. usually the analytic solution depends on both)DDEIntegrator
which contains no duplicate fields:ODEIntegrator
breaksDDEIntegrator
ODEIntegrator
for integration andDDEIntegrator
mostly for its control, i.e. for resets and fixed-point iteration:The text was updated successfully, but these errors were encountered: