Skip to contents

The Radau IIA collocation methods with 3, 5, 7, ... stages (orders 5, 9, 13, ...) under one controller, after OrdinaryDiffEqFIRK's AdaptiveRadau: the method starts at the stage count of min_order and moves up two stages when the Newton iteration has converged in fewer than 2.6 iterations on average over more than ten steps, down when it needed more than 8. The tableaus of 3, 5 and 7 stages are Julia's; larger ones are computed (Gauss-Radau nodes and the eigen decomposition of the collocation matrix) and agree with Julia's to rounding. The Newton tolerance follows the transformed relative tolerance unless kappa is given. The dense output uses the stage count of each step (Julia interpolates with the stage count in force at the end).

Usage

AdaptiveRadau(
  autodiff = NULL,
  min_order = 5L,
  max_order = 13L,
  extrapolant = "dense",
  fast_convergence_cutoff = 1/5,
  new_W_gamma_dt_cutoff = 1/5,
  kappa = NULL,
  maxiters = 10L,
  smooth_est = TRUE,
  step_limiter = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  threading = FALSE
)

Arguments

autodiff

Differentiation choice for the Jacobian when the problem has none (see AutoForwardDiff()).

min_order, max_order

Order range (at least 5); the stage counts are (order - 1) %/% 4 * 2 + 1.

extrapolant

"dense" (the default: the previous collocation polynomial gives the starting values) or "constant" (zero starting values).

fast_convergence_cutoff

Rate below which the Newton iteration counts as fast.

new_W_gamma_dt_cutoff

Stored only; the out of place methods factorize every step.

kappa

Tolerance of the Newton stopping test (default 1/100; RadauIIA3() always uses 1/100, as Julia).

maxiters

Maximum number of Newton iterations.

smooth_est

Whether the error estimate is smoothed through the real block.

step_limiter

Optional function(u, integrator, p, t) applied after every accepted step.

concrete_jac, linsolve

Accepted for compatibility; dense LU factorizations are used.

threading

Accepted for compatibility; the stage systems are solved serially.

Value

An ODE algorithm.

Details

A correction to Julia: with a mass matrix, Julia's out of place step computes mass_matrix * w with w the vector of stage vectors, which mixes the stages (and fails unless the state has as many components as the method has stages); here the mass matrix multiplies each stage.

Examples

vdp <- function(u, p, t) c(u[2], p[1] * ((1 - u[1] * u[1]) * u[2]) - u[1])
prob <- ODEProblem(vdp, c(2, 0), c(0, 1), 10)
sol <- solve(prob, AdaptiveRadau(), reltol = 1e-8, abstol = 1e-10)
sol$u[[length(sol$u)]]
#> [1]  1.93385291 -0.07042352