MRKISS 2025-09-10
A tiny library with zero dependencies that aims to make it easy to use & experiment with explicit Runge-Kutta methods.
Loading...
Searching...
No Matches
mrkiss_eerk_dormand_prince_5_4.f90
Go to the documentation of this file.
1! -*- Mode:F90; Coding:us-ascii-unix; fill-column:129 -*-
2!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.H.S.!!
3!>
4!! @file mrkiss_eerk_dormand_prince_5_4.f90
5!! @author Mitch Richling http://www.mitchr.me/
6!! @brief Butcher tableau for Dormand & Prince's 7 stage, Order (5,4) Runge-Kutta method.@EOL
7!! @keywords ode ivp differential equation initial value problem rk
8!! @std F2023
9!! @see https://github.com/richmit/MRKISS
10!! @copyright
11!! @parblock
12!! Copyright (c) 2025, Mitchell Jay Richling <http://www.mitchr.me/> All rights reserved.
13!!
14!! Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
15!! conditions are met:
16!!
17!! 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following
18!! disclaimer.
19!!
20!! 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following
21!! disclaimer in the documentation and/or other materials provided with the distribution.
22!!
23!! 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
24!! derived from this software without specific prior written permission.
25!!
26!! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
27!! INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28!! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29!! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30!! USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31!! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
32!! OF THE POSSIBILITY OF SUCH DAMAGE.
33!! @endparblock
34!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.H.E.!!
35
36!----------------------------------------------------------------------------------------------------------------------------------
37!> Butcher tableau for Dormand & Prince's 7 stage, Order (5,4) Runge-Kutta method
38!!
39!! @image html eerk_dormand_prince_5_4-stab.png
40!!
41!! @par IMO
42!! I include this method for historical reasons and for unit tests. It's a good general use method with excellent principle
43!! truncation error coefficients. It has been very widely used, frequently as the default method, across many software packages
44!! with good results. It's a standard method to use for comparisons in the literature. Today it has largely been replaced by
45!! newer methods.
46!!
47!! @par Known Aliases
48!! 'The Dormand-Prince Method', 'RKDP', 'DOPRI', 'DP5' (OrdinaryDiffEq.jl), 'ode45' (MATLAB & Octave),
49!! 'RK5(4)7M' (Dormand & Prince), & DOPRI5 (Hairer), 'ARKODE_DORMAND_PRINCE_7_4_5' (SUNDIALS)
50!!
51!! @par Stability Image Links
52!! <a href="eerk_dormand_prince_5_4-stab.png"> <img src="eerk_dormand_prince_5_4-stab.png" width="256px"> </a>
53!! <a href="eerk_dormand_prince_5_4-astab.png"> <img src="eerk_dormand_prince_5_4-astab.png" width="256px"> </a>
54!! <a href="eerk_dormand_prince_5_4-star1.png"> <img src="eerk_dormand_prince_5_4-star1.png" width="256px"> </a>
55!! <a href="eerk_dormand_prince_5_4-star2.png"> <img src="eerk_dormand_prince_5_4-star2.png" width="256px"> </a>
56!!
57!! @par References:
58!! - Dormand & Prince (1980); A family of embedded Runge-Kutta formulae; J. Comput. Appl. Math. 6, no. 1
59!! - Hairer, Norsett & Wanner (2009). Solving Ordinary Differential Equations. I: Nonstiff Problems. p178;
60!! zotero://select/items/0_VLZWN2CT
61!! - Butcher (2016); Numerical Methods for Ordinary Differential Equations. 3ed; p224; zotero://select/items/0_V7UTIRPT
62!!
64 use mrkiss_config, only: rk
65 implicit none
66 public
67 !> The order of the overall method
68 integer, parameter :: s = 7
69 !> Number of methods
70 integer, parameter :: m = 2
71 !> The @f$\mathbf{a}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
72 real(kind=rk), parameter :: a(s,s) = reshape([ 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
73 & 3427256448.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
74 & 1285221168.0_rk, 3855663504.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
75 & 16755475968.0_rk, -63975453696.0_rk, 60929003520.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
76 & 50596564480.0_rk, -198708787200.0_rk, 168327864320.0_rk, -4983390720.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
77 & 48774576060.0_rk, -184344854400.0_rk, 152622973440.0_rk, 4770896760.0_rk, -4687309620.0_rk, 0.0_rk, 0.0_rk, &
78 & 1561900725.0_rk, 0.0_rk, 7698240000.0_rk, 11156433750.0_rk, -5524329195.0_rk, 2244036960.0_rk, 0.0_rk], [s, s]) / 17136282240.0_rk
79 !> The @f$\mathbf{b}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
80 real(kind=rk), parameter :: b(s,m) = reshape([ 1947750.0_rk, 0.0_rk, 9600000.0_rk, 13912500.0_rk, -6889050.0_rk, 2798400.0_rk, 0.0_rk, &
81 & 1921409.0_rk, 0.0_rk, 9690880.0_rk, 13122270.0_rk, -5802111.0_rk, 1902912.0_rk, 534240.0_rk], [s, m]) / 21369600.0_rk
82 !> The @f$\mathbf{c}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
83 real(kind=rk), parameter :: c(s) = [ 0.0_rk, 18.0_rk, 27.0_rk, 72.0_rk, 80.0_rk, 90.0_rk, 90.0_rk] / 90.0_rk
84 !> The method orders
85 integer, parameter :: p(m) = [5, 4]
86 !> Number of stages for each method
87 integer, parameter :: se(m) = [6, 7]
Configuration for MRKISS == MR RK KISS == Mitch Richling's Runge-Kutta Keep It Simple Stupid.
integer, parameter, public rk
Real kind used across the library.
Butcher tableau for Dormand & Prince's 7 stage, Order (5,4) Runge-Kutta method.
real(kind=rk), dimension(s, m), parameter b
The matrix for the Butcher Tableau.
integer, dimension(m), parameter se
Number of stages for each method.
real(kind=rk), dimension(s, s), parameter a
The matrix for the Butcher Tableau.
integer, parameter m
Number of methods.
real(kind=rk), dimension(s), parameter c
The matrix for the Butcher Tableau.
integer, dimension(m), parameter p
The method orders.
integer, parameter s
The order of the overall method.