Skip to contents

RKIP() solves a semilinear problem u' = A u + f(u, t), given as SplitODEProblem(L, f, u0, tspan) with a constant SciML operator L (such as MatrixOperator(A) or DiagonalOperator(d)), with an explicit Runge-Kutta method (by default Verner's 6(5) pair) in the interaction picture v = exp(-A t) u, as in OrdinaryDiffEqRKIP. The exponentials exp(A c_i dt) are cached for nb_of_cache_step step sizes in geometric progression from dtmin to dtmax; the proposed steps are moved onto these sizes (and clamped to them when clamp_lower_dt or clamp_higher_dt). The cache is kept in the algorithm object, so solving several problems with the same linear part and the same RKIP() object reuses it.

Usage

RKIP(
  dtmin = 0.001,
  dtmax = 1,
  nb_of_cache_step = 100,
  tableau = NULL,
  clamp_lower_dt = FALSE,
  clamp_higher_dt = TRUE,
  use_ldiv = FALSE
)

Arguments

dtmin, dtmax

The smallest and largest cached step sizes.

nb_of_cache_step

The number of cached step sizes.

tableau

An ExplicitRKTableau() with an embedded error estimate; by default Verner's 6(5) tableau.

clamp_lower_dt, clamp_higher_dt

Whether to clamp the proposed step to the smallest or largest cached step.

use_ldiv

Whether to apply exp(-A h) by solving with exp(A h) instead of caching it.

Value

An algorithm object.

Examples

L <- MatrixOperator(matrix(c(-2, 1, 0, -3), 2))
prob <- SplitODEProblem(L, function(u, p, t) -u * u * u, c(1, 0.5), c(0, 1))
sol <- solve(prob, RKIP())
sol$u[[length(sol$u)]]
#> [1] 0.11083964 0.09416942