Skip to contents

GlobalRichardson(alg) wraps an ODE (or DAE) algorithm with global Richardson extrapolation, as GlobalDiffEq.jl: the problem is solved with fixed steps dt, dt / 2, dt / 4, ... and the solutions at the times tstops (default seq(t0, tf, by = dt)) are extrapolated to zero step size with a Neville tableau until the estimated error is below max(reltol * norm, abstol) (or stops decreasing). As in Julia the returned solution is the last (finest) of these fixed step solves; the extrapolated values at tstops and their error estimate are attached as sol$extrapolated (one column per time) and sol$extrapolation_error.

Usage

GlobalRichardson(alg)

Arguments

alg

The algorithm of the fixed step solves.

Value

An algorithm object; solve() needs dt.

Examples

prob <- ODEProblem(function(u, p, t) -u, 1, c(0, 1))
sol <- solve(prob, GlobalRichardson(Tsit5()), dt = 0.25, reltol = 1e-8)
length(sol$t)
#> [1] 9
sol$extrapolated[, 5] - exp(-1)
#> [1] -4.044692e-08