Skip to contents

Multistep methods for stiff problems, as in OrdinaryDiffEqBDF. ABDF2() is the adaptive second order backward differentiation formula (started with one implicit Euler step); QNDF1() and QNDF2() are the first and second order numerical differentiation formulas (NDF) with a quasi constant step size, and QNDF() the variable order (1 to 5) NDF of MATLAB's ode15s with the order and step size controller of Alberdi Celaya, Anza Aguirrezabala and Chatzipantelidis. QBDF1(), QBDF2() and QBDF() are the same methods with kappa = 0, i.e. the backward differentiation formulas. MEBDF2() is the fixed step modified extended BDF of order 2. Each step is solved by a modified Newton iteration (see ImplicitEuler()); problems with a mass matrix are supported.

Usage

ABDF2(extrapolant = "linear", step_limiter = NULL, autodiff = NULL)

QNDF1(kappa = -37/200, step_limiter = NULL, autodiff = NULL)

QNDF2(kappa = -1/9, step_limiter = NULL, autodiff = NULL)

QBDF1(step_limiter = NULL, autodiff = NULL)

QBDF2(step_limiter = NULL, autodiff = NULL)

QNDF(
  max_order = 5L,
  kappa = c(-37/200, -1/9, -823/10000, -83/2000, 0),
  qmax = 10,
  qsteady_min = 1,
  qsteady_max = 2,
  step_limiter = NULL,
  autodiff = NULL
)

QBDF(
  max_order = 5L,
  qmax = 10,
  qsteady_min = 1,
  qsteady_max = 2,
  step_limiter = NULL,
  autodiff = NULL
)

MEBDF2(extrapolant = "constant", autodiff = NULL)

Arguments

extrapolant

The initial guess of the Newton iteration: "linear" (the explicit Euler predictor) or "constant" (the previous state).

step_limiter

A function limiter(u, integ, p, t) returning the state after each accepted step.

autodiff

As for ImplicitEuler().

kappa

The NDF coefficient: one number for QNDF1() and QNDF2(), one per order for QNDF(). Julia's defaults are the Rationals -37/200, -1/9, -823/10000, -83/2000 and 0; a value that is the double nearest to a fraction with denominator up to 10^6 is treated as that fraction (exact arithmetic, as Julia's Rationals).

max_order

Maximum order of QNDF() (1 to 5).

qmax, qsteady_min, qsteady_max

Largest step growth factor and the range of step ratios that keep the step size (QNDF()).

Value

An algorithm object.

Examples

prob <- ODEProblem(function(u, p, t) -50 * (u - t * t), 1, c(0, 1))
sol <- solve(prob, QNDF(), reltol = 1e-6)
sol(1)
#> [1] 0.9608
solve(prob, ABDF2())$retcode
#> [1] "Success"
sol2 <- solve(prob, MEBDF2(), dt = 1 / 50)
sol2(1)
#> [1] 0.9608444