Skip to contents

PDIRK44() is the fixed step fourth order parallel DIRK method of OrdinaryDiffEqPDIRK: two rounds of two independent implicit stages (diagonal coefficients 1/2 and 2/3), each solved by the simplified Newton method with a fresh Jacobian and factorization at every stage. With threading = TRUE (the default) each of the two stage columns keeps its own nonlinear solver state, as Julia's two NLSolvers; with FALSE one solver serves all four stages. The stages are evaluated in order either way.

Usage

PDIRK44(autodiff = NULL, threading = TRUE)

Arguments

autodiff

As for ImplicitEuler(): how the Jacobian is formed when the problem gives none.

threading

Whether the two stage columns have separate nonlinear solvers (Julia's threaded branch).

Value

An ODE algorithm.

Examples

prob <- ODEProblem(function(u, p, t) c(-50 * (u[1] - cos(t)), -u[2]), c(0, 1), c(0, 1))
solve(prob, PDIRK44(), dt = 0.05)$u[[21]]
#> [1] 0.5569272 0.3678794