Skip to contents

Explicit methods whose number of stages grows with the stiffness, for mildly stiff problems whose Jacobian has eigenvalues near the negative real axis (diffusion, parabolic PDEs after a space discretization). Each step estimates the spectral radius of the Jacobian by a nonlinear power iteration (or takes it from eigen_est) and picks the number of stages that keeps the step stable.

Usage

ROCK2(
  min_stages = 0,
  max_stages = 200,
  eigen_est = NULL,
  eigen_est_interval = 25
)

ROCK4(
  min_stages = 0,
  max_stages = 152,
  eigen_est = NULL,
  eigen_est_interval = 25
)

RKC(eigen_est = NULL, eigen_est_interval = 25)

TSRKC2(eigen_est = NULL)

TSRKC3(eigen_est = NULL)

RKMC2(min_stages = 3, max_stages = 1000, eigen_est = NULL)

ESERK4(eigen_est = NULL)

ESERK5(eigen_est = NULL)

SERK2(eigen_est = NULL)

RKL1(min_stages = 3, max_stages = 200, eigen_est = NULL)

RKL2(min_stages = 3, max_stages = 200, eigen_est = NULL)

RKG1(min_stages = 2, max_stages = 200, eigen_est = NULL)

RKG2(min_stages = 3, max_stages = 200, eigen_est = NULL)

Arguments

min_stages, max_stages

Bounds on the number of stages.

eigen_est

An upper bound on the spectral radius of the Jacobian: a number, or a function (u, p, t) returning one. NULL (the default) estimates it by power iteration.

eigen_est_interval

With the power iteration, the estimate is recomputed every eigen_est_interval steps, and always on the first step, after a rejected step and after a discontinuity.

Value

An ODE algorithm.

Details

  • ROCK2(), ROCK4(): the orthogonal Runge-Kutta Chebyshev methods of Abdulle (order 2) and Abdulle (order 4).

  • RKC(): the Runge-Kutta Chebyshev method of Sommeijer, Shampine and Verwer (order 2).

  • TSRKC2(), TSRKC3(): two step Runge-Kutta Chebyshev methods of orders 2 and 3; TSRKC3() starts with RKC steps.

  • RKMC2(): the monotone second order Chebyshev method.

  • ESERK4(), ESERK5(), SERK2(): the extrapolated stabilized methods of Martin-Vaquero (orders 4, 5 and 2).

  • RKL1(), RKL2(): Runge-Kutta Legendre super time stepping (orders 1 and 2); the stage counts are odd.

  • RKG1(), RKG2(): Runge-Kutta Gegenbauer super time stepping (orders 1 and 2).

ROCK2, ROCK4, ESERK4, ESERK5 use the PI step size controller; the others use the predictive (Gustafsson) controller, as in OrdinaryDiffEq. The methods with a stability bound cap the proposed step at the largest stable step for their maximal number of stages.

Examples

n <- 20
heat <- function(u, p, t) {
  (c(0, u[-n]) - 2 * u + c(u[-1], 0)) * (n + 1)^2
}
prob <- ODEProblem(heat, sin(pi * seq_len(n) / (n + 1)), c(0, 0.1))
sol <- solve(prob, ROCK2(), reltol = 1e-4)
sol(0.1)[1:3]
#> [1] 0.05565295 0.11006270 0.16201383