Skip to contents

Pass as initializealg to solve() to choose how the integrator makes the initial values of a DAE consistent. BrownFullBasicInit() keeps the differential variables and solves the algebraic equations for the algebraic variables (and, for fully implicit problems, for the derivatives of the differential variables). ShampineCollocationInit() takes a small implicit Euler step to find consistent values of all variables. CheckInit() only checks the residual and fails with retcode "InitialFailure" when it is not satisfied; NoInit() takes the initial values as they are, without evaluating the residual. OverrideInit() solves the problem's initialization problem (its initialization_data, see OverrideInitData()) for the initial values and parameters, and DefaultInit() is OrdinaryDiffEq's default: OverrideInit() when the problem has an initialization problem, else CheckInit(). After an event that changes the state of a DAE, OverrideInit() and DefaultInit() make the algebraic values consistent as BrownFullBasicInit() does. Without initializealg the solvers use BrownFullBasicInit().

Usage

BrownFullBasicInit(abstol = NULL)

ShampineCollocationInit(initdt = NULL)

CheckInit()

NoInit()

OverrideInit(abstol = NULL, reltol = NULL, nlsolve = NULL)

DefaultInit()

Arguments

abstol

Tolerance of the nonlinear solve; the integrator's abstol when NULL.

initdt

Step of ShampineCollocationInit(); by default min(t0 / 1000, dtmax / 10) (or dtmax / 10 when t0 = 0).

reltol, nlsolve

Relative tolerance and nonlinear solver of the initialization solve of OverrideInit() (stored; the initialization problem is solved with its own algorithm).

Value

An initialization algorithm object.

Examples

f <- function(du, u, p, t) c(du[1] + u[1], u[2] - 2 * u[1])
prob <- DAEProblem(f, c(0, 0), c(1, 5), c(0, 1), differential_vars = c(TRUE, FALSE))
sol <- solve(prob, DFBDF(), initializealg = BrownFullBasicInit())
sol$u[[1]]
#> [1] 1 2