This code is a C++ implementation of several explicit stabilized methods for solving ordinary differential equations
In addition to the explicit stabilized methods listed below, standard methods such as explicit and implicit Euler, explicit and implicit midpoint, and Runge-Kutta 4 are implemented for comparison purposes.
Explicit stabilized methods use an increased number of stages to increase stability, in contrast to standard methods that use more stages to increase accuracy. Due to this different strategy, the stability domain grows quadratically along the negative real axis and the methods have no step size restriction (despite being explicit). For instance, see below the stability domain of the RKC method for
In this code we implement the following explicit stabilized methods: RKC, ROCK, RKL, RKU1 for the non multirate problem
When solving a multirate equation
Instead of solving the original multirate problem
The averaged right-hand side
For more details on the mathematical background and for numerical results produced with this code, see the following publication:
Abdulle, A., Grote, M. J., & Rosilho de Souza, G. (2022). Explicit stabilized multirate method for stiff differential equations. Mathematics of Computation, 91(338), 2681–2714, DOI:10.1090/mcom/3753.
One possible way to run the code is by creating a Docker image from the Dockerfile provided here and running the code within a container. Otherwise, one could compile the code as usual.
To create the Docker image, from the root directory of the repository, run:
docker build -t multirate .
For running the code, execute:
docker run --rm -ti -v "$(pwd)/results":/multirate/results multirate ARGS_LIST
For the ARGS_LIST
, see below.
For compilation, eigen is needed. However, if the code has been downloaded with git clone ...
, then a compatible version of eigen
is cloned automatically by the makefile2. Hence, the following command will download the dependency and compile the code:
mkdir build && cd build && cmake -S .. -B . && make
Run the code from the build
directory as
./MultirateIntegrators ARGS_LIST
For the ARGS_LIST
, see the next section.
For the full list of arguments use the --help
option or check out the ARGS_LIST.md
file, here we just provide an example.
To run a simulation
- solving the PDE Brusselator benchmark (problem 5):
-test 5
, - with the mRKC method and step size
$\Delta t=0.01$ :-rk mRKC -dt 1e-2
, - with output in
.bin
format every 10 time steps:-bin true -ofreq 10
,
in the build
directory execute:
./MultirateIntegrators -test 5 -rk mRKC -dt 1e-2 -bin true -ofreq 10
The output is stored in the results
folder.
For visualization of the results, several Matlab scripts are provided in the matlab
folder. To produce output with the appropriate format use either the -matlab true
or -bin true
arguments.