Skip to contents

Rosenbrock methods of OrdinaryDiffEq.jl with an embedded error estimate and Hermite dense output: ROS2() (order 2, L-stable), ROS2PR() and the W-method ROS2S() (order 2, stiffly accurate), ROS3(), ROS3PR(), Scholz4_7(), ROS3PRL() and ROS3PRL2() (order 3, Rang), the Rosenbrock-W methods ROS34PW1a(), ROS34PW1b(), ROS34PW2(), ROS34PW3() and ROS34PRw() of Rang and Angermann, the Rosenbrock-Krylov method ROK4a(), the fourth order methods RosShamp4() (Shampine), Veldd4(), Velds4() (van Veldhuizen), GRK4T(), GRK4A() (Kaps and Rentrop) and Ros4LStab() (Hairer and Wanner), and the fixed step fourth order W-method RosenbrockW6S4OS(), which needs dt. All accept mass matrices; the W-methods keep the Jacobian along accepted steps (see Rosenbrock23()).

Usage

ROS2(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS2PR(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS2S(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS3(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS3PR(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

Scholz4_7(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS34PW1a(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS34PW1b(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS34PW2(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS34PW3(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS34PRw(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS3PRL(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROS3PRL2(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

ROK4a(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

RosShamp4(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

Veldd4(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

Velds4(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

GRK4T(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

GRK4A(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

Ros4LStab(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

RosenbrockW6S4OS(
  autodiff = NULL,
  concrete_jac = NULL,
  linsolve = NULL,
  max_jac_age = 20L,
  jac_reuse_gamma_tol = 0.03
)

Arguments

autodiff

How Jacobians are computed when the problem has no symbolic Jacobian: AutoForwardDiff() (dual numbers, as ForwardDiff; central differences when the function cannot run on them), AutoFiniteDiff(fdtype) or AutoSparse(ad); see AutoForwardDiff(). The default is AutoForwardDiff(), as in OrdinaryDiffEq.

concrete_jac, linsolve

Accepted for compatibility with OrdinaryDiffEq.jl; the linear systems are always solved densely.

max_jac_age

Number of accepted steps after which a W-method evaluates the Jacobian again (1 for Rosenbrock23() and Rosenbrock32(), which then evaluate it at every step).

jac_reuse_gamma_tol

Relative change of dt * gamma above which a W-method evaluates the Jacobian again.

Value

An algorithm object.

Examples

prob <- ODEProblem(function(u, p, t) c(-50 * (u[1] - u[2]), u[1] - u[2]), c(1, 0), c(0, 1))
solve(prob, ROS34PW2())$stats$njacs
#> [1] 82
solve(prob, GRK4A())(1)
#> [1] 0.01960784 0.01960784
solve(prob, RosenbrockW6S4OS(), dt = 0.1)(1)
#> [1] 0.01960784 0.01960784