This code was used for the numerical experiments in the preprint (CRC Preprint 2021/26; URL: https://www.waves.kit.edu/downloads/CRC1173_Preprint_2021-26.pdf) and in the paper "Error analysis of multirate leapfrog-type methods for second-order semilinear odes" by C. Carle and M. Hochbruck.
The scripts inside the subfolders are intended to reproduce the figures from the
preprint
Error analysis of multirate leapfrog-type methods for second-order semilinear ODEs
by Constantin carle and Marlis Hochbruck
Requirements
The codes are tested with
Ubuntu 20.04.2 LTS and Python 3.8.5 and the following version of its modules:
- numpy - 1.17.4
- scipy - 1.3.3
- dolfin (fenics) - 2019.2.0.dev0 (including mshr)
- matplotlib - 3.1.2
- tikzplotlib - 0.9.6
Generation of figures
In the folder "code_figure_6p1-6p2" open a console and run the commands
-
to obatin Figure 6.1
python3 script_figure_2dimEx.py,
-
to obtain Figure 6.2(a)
python3 script_figure_FPUT_error.py
-
to obtain Figure 6.2(b)
python3 script_figure_FPUT_hamiltonian.py.
In the folder "code_figure_6p3" open a console and run the command
python3 script_figure_wave-equation.py
to obtain Figure 6.3(a) and (b).
Additionally to the plots you can get the tikz-files which were used for generating the plots in the pdf by uncommenting the lines
#import tikzplotlib
#tikzplotlib.save("*****.tikz")
at the end of each of the above scripts.