Skip to contents

DABDF2() is the adaptive second order backward differentiation formula of OrdinaryDiffEqBDF for a fully implicit DAEProblem() F(du, u, p, t) = 0: the first step is a DImplicitEuler() step, the later ones solve F((z + tmp) / (gamma dt), u + z, p, t) = 0 by a modified Newton iteration, and the local error is estimated from the derivatives of the last three steps as in ABDF2(). The dense output is the cubic Hermite interpolant of the differential variables (linear for the algebraic ones).

Usage

DABDF2(autodiff = NULL)

Arguments

autodiff

As for ImplicitEuler().

Value

An algorithm object.

Examples

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))
sol <- solve(dprob, DABDF2())
sol(0.5)
#> [1] 0.6055995 0.6054255