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
GlobalAdjointControlDetails
GlobalErrorEquation selects the companion ODE of
GlobalErrorEstimation():
DefectCorrectionintegrates the nonlinear correction equationeps' = f(P + eps, p, t) - P'(t),eps(t0) = 0, wherePis the dense interpolant of the numerical solution. It needs no Jacobian, only extra evaluations off(Zadunaisky 1976; Dormand, Duckers and Prince 1984).ErrorTransportintegrates the linearized error transport (first variational) equationeps' = J(P, p, t) eps + d(t)with the defectd(t) = f(P, p, t) - P'(t)andJ = df/duapplied as a Jacobian vector product (Shampine 1986; Berzins 1988), the first order linearization ofDefectCorrection.
GlobalErrorMode selects how the companion ODE is integrated:
InterpolatingModesolves 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.SimultaneousModedrives 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 withInterpolatingMode.
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 localabstolandreltoland solves again adaptively until the estimated endpoint error is at mostgtol.StepGridRefinementtightens the tolerances in the same way to find a step grid that meetsgtol, 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"