Skip to contents

Runge-Kutta-Nystrom methods of OrdinaryDiffEqRKN for second order problems u'' = f1(u', u, p, t) given as SecondOrderODEProblem() or DynamicalODEProblem() (state c(v, u)).

Usage

Nystrom4()

FineRKN4()

FineRKN5()

RKN4()

Nystrom4VelocityIndependent()

Nystrom5VelocityIndependent()

DPRKN4()

DPRKN5()

DPRKN6()

DPRKN6FM()

DPRKN8()

DPRKN12()

ERKN4()

ERKN5()

ERKN7()

IRKN3()

IRKN4()

Value

An algorithm object.

Details

  • Velocity dependent (f1 may use v): Nystrom4() (fourth order, fixed step), RKN4() (fourth order, fixed step, Nystrom form of the classical method), FineRKN4() and FineRKN5() (adaptive embedded pairs of order 4 and 5 by Fine).

  • Velocity independent (f1 must not use v; the methods stop at initialization if it does): Nystrom4VelocityIndependent() and Nystrom5VelocityIndependent() (fixed step), IRKN3() and IRKN4() (fixed step two step improved methods, bootstrapped by Nystrom4VelocityIndependent), and the adaptive embedded pairs DPRKN4(), DPRKN5(), DPRKN6() (with a free sixth order interpolant), DPRKN6FM(), DPRKN8(), DPRKN12() (Dormand, El-Mikkawy and Prince), ERKN4(), ERKN5() and ERKN7() (Demba, Senu and Ismail; ERKN5 controls the error of the positions only).

sol$stats$nf counts evaluations of f1 and sol$stats$nf2 those of f2, with Julia's conventions. Upstream IRKN3 and IRKN4 build some stages from the wrong accelerations or times and fall to second order on problems with explicit time dependence; here they keep orders 3 and 4 with the same numbers of evaluations.

Examples

prob <- SecondOrderODEProblem(function(v, u, p, t) -u, 0, 1, c(0, 1))
sol <- solve(prob, DPRKN6(), reltol = 1e-8, abstol = 1e-8)
sol$u[[length(sol$t)]] - c(-sin(1), cos(1))
#> [1]  5.911938e-13 -7.607248e-13
solve(prob, Nystrom4(), dt = 0.1)$stats$nf
#> [1] 41