"ImplicitRungeKutta" Method for NDSolve


Implicit RungeKutta methods have a number of desirable properties.

The GaussLegendre methods, for example, are self-adjoint, meaning that they provide the same solution when integrating forward or backward in time.

This loads packages defining some example problems and utility functions:


A generic framework for implicit RungeKutta methods has been implemented. The focus so far is on methods with interesting geometric properties and currently covers the following schemes:

Coefficient Generation


Load an example problem:
This problem has two invariants that should remain constant. A numerical method may not be able to conserve these invariants:
This solves the system using an implicit RungeKutta Gauss method. The order of the scheme is selected using the "DifferenceOrder" method option:
A plot of the error in the invariants shows an increase as the integration proceeds:

The "ImplicitSolver" method of "ImplicitRungeKutta" has options AccuracyGoal and PrecisionGoal that specify the absolute and relative error to aim for in solving the nonlinear system of equations.

These options have the same default values as the corresponding options in NDSolve, since often there is little point in solving the nonlinear system to much higher accuracy than the local error of the method.

However, for certain types of problems it can be useful to solve the nonlinear system up to the working precision:

The first invariant is the Hamiltonian of the system, and the error is now bounded, as it should be, since the Gauss implicit RungeKutta method is a symplectic integrator.

The second invariant is conserved exactly (up to roundoff) since the Gauss implicit RungeKutta method conserves quadratic invariants:

This defines the implicit midpoint method as the one-stage implicit RungeKutta method of order two.

For this problem it can be more efficient to use a fixed-point iteration instead of a Newton iteration to solve the nonlinear system:

At present, the implicit RungeKutta method framework does not use banded Newton techniques for uncoupling the nonlinear system.

Option Summary

"ImplicitRungeKutta" Options

option name
default value
"Coefficients""ImplicitRungeKuttaGaussCoefficients"specify the coefficients to use in the implicit RungeKutta method
"DifferenceOrder"Automaticspecify the order of local accuracy of the method
"ImplicitSolver""Newton"specify the solver to use for the nonlinear system; valid settings are FixedPoint or "Newton"
"StepSizeControlParameters"Automaticspecify the step control parameters
"StepSizeRatioBounds"{,4}specify the bounds on a relative change in the new step size
"StepSizeSafetyFactors"Automaticspecify the safety factors to use in the step size estimate

Options of the method "ImplicitRungeKutta".

The default setting of Automatic for the option "StepSizeSafetyFactors" uses the values {9/10,9/10}.

"ImplicitSolver" Options

option name
default value
AccuracyGoalAutomaticspecify the absolute tolerance to use in solving the nonlinear system
"IterationSafetyFactor"specify the safety factor to use in solving the nonlinear system
MaxIterationsAutomaticspecify the maximum number of iterations to use in solving the nonlinear system
PrecisionGoalAutomaticspecify the relative tolerance to use in solving the nonlinear system

Common options of "ImplicitSolver".

option name
default value
"JacobianEvaluationParameter"specify when to recompute the Jacobian matrix in Newton iterations
"LinearSolveMethod"Automaticspecify the linear solver to use in Newton iterations
"LUDecompositionEvaluationParameter"specify when to compute LU decompositions in Newton iterations

Options specific to the "Newton" method of "ImplicitSolver".