RKcheck (Runge-Kutta check)


RKcheck is a small java application that checks the order of Runge-Kutta methods.


The Runge-Kutta method is specified by its Butcher-array in a simple xml file with the following structure:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE Runge-Kutta PUBLIC "-// Runge-Kutta V1.2//EN"
                             "" >

<!-- this is the classical Runge-Kutta method -->
<Runge-Kutta name="classical Runge-Kutta" >

    <rational> <p>1</p> <q>2</q> </rational>
    <rational> <p>1</p> <q>2</q> </rational>

      <!-- empty first row -->
      <rational> <p>1</p> <q>2</q> </rational>
      <zero/> <rational> <p>1</p> <q>2</q> </rational>
      <zero/> <zero/> <one/>

    <rational> <p>1</p> <q>6</q> </rational>
    <rational> <p>1</p> <q>3</q> </rational>
    <rational> <p>1</p> <q>3</q> </rational>
    <rational> <p>1</p> <q>6</q> </rational>


The preceding example shows how to describe the classical Runge-Kutta method. The corresponding Butcher array can be written in a human-readable form:

            O  |
           1/2 | 1/2
           1/2 |  0   1/2
            1  |  0    0    1
                 1/6  1/3  1/3  1/6

The tool computes the theoretical order conditions and checks if the method defined by the XML file respect these conditions. If the method has a set of coefficients for error estimation, the order of the error estimation is checked too.

By default and if the coefficients are all exact, computation is also exact, there is no approximation at all. If no exact expression is known for the coefficients, they can be entered as real values with arbitrary precision (using <real>...</real> elements). In this case it is recommended to use the -tolerance command-line switch in order to also use approximation in the final check, otherwise the application will say the method is of order 0 because it fails even the elementary conditions ... Exact coefficients are integers, rational numbers and quadratic surds (i.e. numbers of the form (p1 + p2 sqrt(d)) / q). All quadratic surds in one file should share the same d or the operations will be impossible to perform.

This behaviour is the one provided by the default manifest file of the distribution, which declares org.spaceroots.rkcheck.CheckOrderConditions as the main class of the jar file. There is however another possible behaviour, using another main class: org.spaceroots.rkcheck.ComputeOrderConditions. This class does not read any XML method file but writes all the order conditions up to a user-defined order in LaTeX format or in Maxima format.


The latest version is available on the downloads page. The DTD and the XML files for famous methods can also be retrieved there (they are also in the source distribution).

The javadoc can be browsed online here.