Skip to contents

Exponential propagation iterative (EPIRK) methods of OrdinaryDiffEqExponentialRK, which use the Jacobian at the start of each step as the linear part (from the jac_fn of the ODEFunction when given, otherwise by finite differences) and compute the phi function actions by the adaptive Krylov time stepping of Niesen and Wright, with tolerance reltol. Exp4() is the fourth order method of Hochbruck, Lubich and Selhofer, EPIRK4s3A() and EPIRK4s3B() fourth order and EPIRK5s3(), EXPRB53s3(), EPIRK5P1() and EPIRK5P2() fifth order EPIRK methods (upstream marks EPIRK5s3() as broken: it does not reach fifth order). These are fixed step methods. Exprb32() and Exprb43() are adaptive exponential Rosenbrock methods of orders 3 and 4 with embedded error estimates, using fixed Krylov subspaces of dimension m. For a split problem they also linearize the whole right-hand side, with the remainder f(u) - J u (upstream takes the second split function as the remainder, which does not match that Jacobian).

Usage

Exp4(adaptive_krylov = TRUE, m = 30, iop = 0, autodiff = NULL)

EPIRK4s3A(adaptive_krylov = TRUE, m = 30, iop = 0, autodiff = NULL)

EPIRK4s3B(adaptive_krylov = TRUE, m = 30, iop = 0, autodiff = NULL)

EPIRK5s3(adaptive_krylov = TRUE, m = 30, iop = 0, autodiff = NULL)

EXPRB53s3(adaptive_krylov = TRUE, m = 30, iop = 0, autodiff = NULL)

EPIRK5P1(adaptive_krylov = TRUE, m = 30, iop = 0, autodiff = NULL)

EPIRK5P2(adaptive_krylov = TRUE, m = 30, iop = 0, autodiff = NULL)

Exprb32(m = 30, iop = 0, autodiff = NULL)

Exprb43(m = 30, iop = 0, autodiff = NULL)

Arguments

adaptive_krylov

Whether to use the adaptive Krylov time stepping (otherwise one Krylov step of length dt).

m

Krylov subspace dimension (the initial one when adaptive).

iop

Incomplete orthogonalization length (0 for full Arnoldi).

autodiff

An ADType for the Jacobian when the problem has no jac_fn.

Value

An algorithm object.

Examples

f <- function(u, p, t) c(-2 * u[1] + u[2], u[1] - 2 * u[2] - u[2] * u[2] * u[2])
jac <- function(u, p, t) matrix(c(-2, 1, 1, -2 - 3 * u[2] * u[2]), 2)
prob <- ODEProblem(ODEFunction(f, jac_fn = jac), c(1, 0.5), c(0, 1))
solve(prob, EPIRK4s3A(), dt = 0.1)$u[[11]]
#> [1] 0.2782380 0.2422705
solve(prob, Exprb43())$retcode
#> [1] "Success"