This repository was archived by the owner on Sep 9, 2024. It is now read-only.
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
API for ODE solvers #20
Closed
Description
This is a summary of the discussions in #7 and #4 and intended to reflect the latest decisions about the API.
Each (adaptive) solver accepts 3 arguments (PR in #14 )
F
: the RHS of the ODEdy/dt = F(t,y)
, which is a function oft
andy(t)
and returnsdy/dt::typeof(y)
y0
: initial value (no type specified -> duck typing)tspan
: an array of points at which the solution is requested (length(tspan)>=2
), the elements can be ordered ascending or descending (see ode45 should support stepping from high to low and support a vector of steps #2)
Moreover, the following keywords are supported
norm
: user-supplied norm for determining the errorE
(defaultBase.norm
)abstol
and/orreltol
: an integration step is accepted ifE <= abstol || E <= reltol*abs(y)
(ideally we want both criteria for all solvers, done in Use keyword arguments to set the tolerance #13)points=:all | :specified | :final
: controls the type of output according topoints==:all
(default) output is given for each value intspan
as well as for each intermediate point the solver used.points==:specified
output is given only for each value intspan
.points==:final
output is given only for the last value intspan
, i.e. at the end of integration (speculative).
maxstep
,minstep
andinitstep
: determine the maximal, minimal and initial integration step.
The solver returns two arrays (PR in #14)
tout
: points at which solutions were obtained (also see keywordpoints
)yout
: solutions at timestout
; ifpoints=:all | :specified
is used,yout::Vector{typeof(y0)}
. For
points==:final
the solution at the end of the integrationyout::typeof(y0)
is returned (speculative).
If we we decide to support non-adaptive solvers (see #9), those should have the same arguments and return values.