Skip to contents

Enumerations that select how GlobalErrorEstimation() and GlobalAdjoint() work, as in GlobalDiffEq.jl. Each enumeration is a list of its instances (GlobalErrorMode$SimultaneousMode), and each instance is also exported by name.

Usage

DefectCorrection

ErrorTransport

GlobalErrorEquation

InterpolatingMode

SimultaneousMode

GlobalErrorMode

EndpointError

TrajectoryError

GlobalAdjointScope

ToleranceRefinement

StepGridRefinement

GlobalAdjointControl

Format

Enumeration instances (classed character strings) and lists of them.

Details

GlobalErrorEquation selects the companion ODE of GlobalErrorEstimation():

  • DefectCorrection integrates the nonlinear correction equation eps' = f(P + eps, p, t) - P'(t), eps(t0) = 0, where P is the dense interpolant of the numerical solution. It needs no Jacobian, only extra evaluations of f (Zadunaisky 1976; Dormand, Duckers and Prince 1984).

  • ErrorTransport integrates the linearized error transport (first variational) equation eps' = J(P, p, t) eps + d(t) with the defect d(t) = f(P, p, t) - P'(t) and J = df/du applied as a Jacobian vector product (Shampine 1986; Berzins 1988), the first order linearization of DefectCorrection.

GlobalErrorMode selects how the companion ODE is integrated:

  • InterpolatingMode solves the problem densely, saving every step, and integrates the companion against that interpolant in a second solve. It works with any dense solver but stores the whole solution.

  • SimultaneousMode drives the forward integrator one accepted step at a time and advances the companion across each step with that step's dense output: no stored solution and no second solve. Its estimate closely agrees with InterpolatingMode.

GlobalAdjointScope selects what GlobalAdjoint() estimates and reports in sol$global_error:

  • EndpointError (the default): the global error 2-norm at the final time only; sol$global_error[n] holds it and the earlier entries are zero. One adjoint solve per sample.

  • TrajectoryError: the global error 2-norm at every saved time (sol$global_error[1] is 0). One adjoint solve per saved time per sample; the returned solution is dense and saved at every step.

GlobalAdjointControl selects how GlobalAdjoint() meets gtol:

  • ToleranceRefinement (the default) tightens the local abstol and reltol and solves again adaptively until the estimated endpoint error is at most gtol.

  • StepGridRefinement tightens the tolerances in the same way to find a step grid that meets gtol, then returns the solution of a fixed step solve on exactly that grid (adaptive = FALSE), a reproducible fixed step schedule.

References

P. E. Zadunaisky, On the estimation of errors propagated in the numerical integration of ordinary differential equations, Numerische Mathematik 27, 1976. L. F. Shampine, Global error estimation with one-step methods, Computers and Mathematics with Applications 12A, 1986.

Examples

GlobalErrorEquation$ErrorTransport
#> ErrorTransport::GlobalErrorEquation = 1
identical(GlobalAdjoint(Tsit5())$scope, EndpointError)
#> [1] TRUE
names(GlobalAdjointControl)
#> [1] "ToleranceRefinement" "StepGridRefinement"