SciML / DiffEqBase.jl

The lightweight Base library for shared types and functionality for defining differential equation and scientific machine learning (SciML) problems
Other
315 stars 113 forks source link

Accessing time in residual function of TwoPointBoundaryProblems #81

Closed BeastyBlacksmith closed 6 years ago

BeastyBlacksmith commented 6 years ago

I find it very restrictive to pass only u[1] and u[end] to the residual function of TwoPointBVProblem therefore one cannot access the tspan.

One possibility is to pass solution types that only hold u[1] and u[end] as u. The other possibility I see is to explicitly pass tspan.

ChrisRackauckas commented 6 years ago

Yeah, I was thinking about this when doing the change. It seems that BVP boundaries are now the only thing that don't follow the u,p,t pattern. Wrapping the u in a tuple before sending is essentially free, so that's an option. Basically it would (res,u,p,t) where u is the u[1] and u[end] tuple, while t[1] and t[end] correspond to that. We can put t on the end for the other BVP as well for consistency.

BeastyBlacksmith commented 6 years ago

I like that choice

ChrisRackauckas commented 6 years ago

Great. I'll implement it as the last changes of the v4.0.0 upgrade. This will make it easy to wrap other multi-point BVP solvers like those in ODEInterface.jl too, so I'll get on that.