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_7_8.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_7_8.f90
5!! @author Mitch Richling http://www.mitchr.me/
6!! @brief Butcher tableau for Dormand & Prince's 13 stage, Order (7,8) 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 13 stage, Order (7,8) Runge-Kutta method
38!!
39!! @image html eerk_dormand_prince_7_8-stab.png
40!!
41!! @par Stability Image Links
42!! <a href="eerk_dormand_prince_7_8-stab.png"> <img src="eerk_dormand_prince_7_8-stab.png" width="256px"> </a>
43!! <a href="eerk_dormand_prince_7_8-astab.png"> <img src="eerk_dormand_prince_7_8-astab.png" width="256px"> </a>
44!! <a href="eerk_dormand_prince_7_8-star1.png"> <img src="eerk_dormand_prince_7_8-star1.png" width="256px"> </a>
45!! <a href="eerk_dormand_prince_7_8-star2.png"> <img src="eerk_dormand_prince_7_8-star2.png" width="256px"> </a>
46!!
47!! @par References:
48!! - Prince & Dormand(1981); High Order Embedded Runge-Kutta Formulae; J. of Comp. and Appl. Math. 7 (1); p67-75;
49!! zotero://select/items/0_N9KVWVST
50!! - Peter Stone (2011); "The 'Classical' Prince-Dormand 13 Stage Combined Order 7 and 8 Runge-Kutta Scheme";
51!! http://www.peterstone.name/Maplepgs/RKcoeff.html; zotero://select/items/0_LTA7NCAS
52!!
54 use mrkiss_config, only: rk
55 implicit none
56 public
57 !> The order of the overall method
58 integer, parameter :: s = 13
59 !> Number of methods
60 integer, parameter :: m = 2
61 !> The @f$\mathbf{a}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
62 real(kind=rk), parameter :: a(s,s) = reshape([0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
63 & 0.055555555555555555555555555555555555555555555555556_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
64 & 0.020833333333333333333333333333333333333333333333333_rk, 0.062500000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
65 & 0.031250000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.093750000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
66 & 0.312500000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, -1.171875000000000000000000000000000000000000000000000_rk, 1.17187500000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
67 & 0.037500000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.18750000000000000000000000000000000000000000000000_rk, 0.150000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
68 & 0.047910137111111111111111111111111111111111111111111_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.11224871277777777777777777777777777777777777777778_rk, -0.025505673777777777777777777777777777777777777777778_rk, 0.012846823888888888888888888888888888888888888888889_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
69 & 0.016917989787292281181431107136038236065514928795434_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.38784827848604316952654574415937335337072755585260_rk, 0.035977369851500327896700889634772368008158739458750_rk, 0.196970214215666060156715256072149888128169802168420_rk, -0.172713852340501838761392997002333845572571026275210_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
70 & 0.069095753359192300648564548984547678561041372446856_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, -0.63424797672885415188280787497173854654263360311207_rk, -0.161197575224604080366876923981817123442223786480850_rk, 0.138650309458825255419866950133015801927665488949580_rk, 0.940928614035756269724239684130258343471181148314500_rk, 0.21163632648194398185537211713190210476353638860840_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
71 & 0.183556996839045385489806023536880308449764251627730_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, -2.46876808431559245274431575997410745777764975354770_rk, -0.291286887816300456388002572803951980054338029408170_rk, -0.026473020233117375688439799465946143259630552826769_rk, 2.847838764192800449164518254216773770231582185012000_rk, 0.28138733146984979253940364182671178209807054553601_rk, 0.12374489986331465762703021266363972031220135360697_rk, 0.00000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
72 & -1.215424817395888059160510525029662994880024988044100_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 16.67260866594577243228041328856410774858907460078800_rk, 0.915741828416817960595718650450742633159373633429810_rk, -6.056605804357470947554505543091634004081967083324400_rk, -16.003573594156178111841706410078823030680793040639000_rk, 14.84930308629766255754539189802663208272299893302700_rk, -13.37157573528984931829304139618159579089195289469700_rk, 5.13418264817963793317325361165860289871249428616290_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
73 & 0.258860916438264283815730932231757766729630776630110_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, -4.77448578548920511231011750970604274682939185374660_rk, -0.435093013777032509440700411810317781932355166161800_rk, -3.049483332072241509560512866312031613982854911220700_rk, 5.577920039936099117423676634464941858623588944531500_rk, 6.15583158986104009733868912668895448119775493746290_rk, -5.06210458673693837007740643391039164499022071214170_rk, 2.19392617318067906127491429046580601978826270738900_rk, 0.134627998659334941535726237887323661395585277257190_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk, &
74 & 0.822427599626507477963168204772666590957230361776580_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, -11.65867325727766428397655303545841477547369082638900_rk, -0.757622116690936195881116154088244965366375759195410_rk, 0.713973588159581527978269282765054675314224887856630_rk, 12.075774986890056739566170448600679670957058009722000_rk, -2.12765911392040265639082085896939863542792797327510_rk, 1.99016620704895541832807169834431415217617301735980_rk, -0.23428647154404029266029469185680153145124258170044_rk, 0.175898577707942265073105105890144818314550863844620_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.00000000000000000000000000000000000000000000000000_rk], [s, s])
75 !> The @f$\mathbf{b}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
76 real(kind=rk), parameter :: b(s,m) = reshape([0.041747491141530246222085928468507115134193602807448_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, -0.055452328611239308961521894654716718893593281565192_rk, 0.239312807201180097046747354248756969660305359311070_rk, 0.70351066940344302305804641088970215136637997294223_rk, -0.75975961381446092988448767708505840765542301921571_rk, 0.66056303092228634146137859483782063994041971253414_rk, 0.158187482510123335529614838600685443972856732403460_rk, -0.238109538752862804471863555305697193525139079217450_rk, 0.25000000000000000000000000000000000000000000000000_rk, &
77 & 0.029553213676353496981964883112032246577332779250092_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, 0.000000000000000000000000000000000000000000000000000_rk, -0.828606276487797039766805612688719184735403754401810_rk, 0.311240900051118327929913751626857051289736321782690_rk, 2.46734519059988698196468570406876145856225957547580_rk, -2.54694165184190873912738007541570896178090516311470_rk, 1.44354858367677524030187495069010426851106801018920_rk, 0.079415595881127287271301954162228677131467786374196_rk, 0.044444444444444444444444444444444444444444444444444_rk, 0.00000000000000000000000000000000000000000000000000_rk], [s, m])
78 !> The @f$\mathbf{c}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
79 real(kind=rk), parameter :: c(s) = [ 0.000000000000000000000000000000000000000000000000000_rk, 0.055555555555555555555555555555555555555555555555556_rk, 0.083333333333333333333333333333333333333333333333333_rk, 0.125000000000000000000000000000000000000000000000000_rk, 0.312500000000000000000000000000000000000000000000000_rk, 0.375000000000000000000000000000000000000000000000000_rk, 0.147500000000000000000000000000000000000000000000000_rk, 0.46500000000000000000000000000000000000000000000000_rk, 0.56486545138225957539835850142616825873856700872641_rk, 0.65000000000000000000000000000000000000000000000000_rk, 0.924656277640504446745013574318369542649203446702740_rk, 1.000000000000000000000000000000000000000000000000000_rk, 1.00000000000000000000000000000000000000000000000000_rk]
80 !> The method orders
81 integer, parameter :: p(m) = [7, 8]
82 !> Number of stages for each method
83 integer, parameter :: se(m) = [13, 12]
85
86
87
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 13 stage, Order (7,8) Runge-Kutta method.
integer, parameter s
The order of the overall method.
integer, dimension(m), parameter p
The method orders.
real(kind=rk), dimension(s), parameter c
The matrix for the Butcher Tableau.
real(kind=rk), dimension(s, s), parameter a
The matrix for the Butcher Tableau.
integer, dimension(m), parameter se
Number of stages for each method.
real(kind=rk), dimension(s, m), parameter b
The matrix for the Butcher Tableau.
integer, parameter m
Number of methods.