Skip to contents

NordsieckBDF() is the variable order (1 to max_order) BDF method of SUNDIALS CVODE as implemented in OrdinaryDiffEqBDF: the history is the Nordsieck array zn[j] = h^j / j! y^(j), predicted by a Pascal triangle shift, rescaled by eta^j when the step size changes and updated by a rank one correction, with CVODE's step size and order selection. The Newton iteration stops after 3 iterations (CVODE's MAXCOR) and its increment norm is scaled into the units of the local error test. The dense output is the Nordsieck polynomial. DNordsieckBDF() is the same method for a fully implicit DAEProblem() (the corrector solves F((zn[2] + l1 z) / h, ypred + z, p, t) = 0, IDA's leading coefficient).

Usage

NordsieckBDF(
  max_order = 5L,
  stald = FALSE,
  qmax = 10,
  qsteady_min = 1,
  qsteady_max = 1,
  step_limiter = NULL,
  autodiff = NULL
)

DNordsieckBDF(
  max_order = 5L,
  stald = FALSE,
  qmax = 10,
  qsteady_min = 1,
  qsteady_max = 1,
  autodiff = NULL
)

Arguments

max_order

Maximum order (1 to 5).

stald

Stability limit detection for orders 3 to 5 (CVODE's algorithm, off by default as in CVODE).

qmax

Largest step growth factor.

qsteady_min, qsteady_max

Settings of the controller kept for compatibility; the method keeps the step size unless it may grow by 1.5 (CVODE's rule).

step_limiter

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

autodiff

As for ImplicitEuler().

Value

An algorithm object.

Examples

prob <- ODEProblem(function(u, p, t) -50 * (u - t * t), 0, c(0, 1))
sol <- solve(prob, NordsieckBDF(), reltol = 1e-6)
sol(1)
#> [1] 0.9607999
f <- function(du, u, p, t) c(du[1] + u[1], u[2] - u[1])
dprob <- DAEProblem(f, c(-1, 0), c(1, 1), c(0, 1), differential_vars = c(TRUE, FALSE))
solve(dprob, DNordsieckBDF())$retcode
#> [1] "Success"