Skip to contents

Solvers for fully implicit DAEProblem()s, as in OrdinaryDiffEqBDF. DFBDF() is the variable order (1 to 5) fixed leading coefficient BDF for F(du, u, p, t) = 0, the default; DImplicitEuler() the implicit Euler method with a divided difference error estimate.

Usage

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

DImplicitEuler(autodiff = NULL)

Arguments

max_order

Maximum order of DFBDF().

qmax, qsteady_min, qsteady_max

Largest step growth factor and the range of factors that keep the step size.

autodiff

How Jacobians are computed when the problem has no symbolic Jacobian: AutoForwardDiff() (dual numbers, as ForwardDiff; central differences when the function cannot run on them), AutoFiniteDiff(fdtype) or AutoSparse(ad); see AutoForwardDiff(). The default is AutoForwardDiff(), as in OrdinaryDiffEq.

Value

An algorithm object.

Examples

f <- function(du, u, p, t) c(du[1] + p * u[1], u[2] - u[1]^2)
prob <- DAEProblem(f, c(-1, 0), c(1, 1), c(0, 1), 1, differential_vars = c(TRUE, FALSE))
sol <- solve(prob, DFBDF(), reltol = 1e-6)
sol(1)
#> [1] 0.3678794 0.1353353