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_bogacki_shampine_4_5.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_bogacki_shampine_4_5.f90
5!! @author Mitch Richling http://www.mitchr.me/
6!! @brief Butcher tableau for Bogacki Shampine's 8 step, order (4,5) 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 Bogacki Shampine's 7 step, order (4,5) Runge-Kutta method
38!!
39!! @image html eerk_bogacki_shampine_4_5-stab.png
40!!
41!! @par IMO
42!! This is a good general use method with excellent error coefficients.
43!!
44!! @par Known Aliases
45!! 'bs5' (OrdinaryDiffEq.jl)
46!!
47!! @par Stability Image Links
48!! <a href="eerk_bogacki_shampine_4_5-stab.png"> <img src="eerk_bogacki_shampine_4_5-stab.png" width="256px"> </a>
49!! <a href="eerk_bogacki_shampine_4_5-astab.png"> <img src="eerk_bogacki_shampine_4_5-astab.png" width="256px"> </a>
50!! <a href="eerk_bogacki_shampine_4_5-star1.png"> <img src="eerk_bogacki_shampine_4_5-star1.png" width="256px"> </a>
51!! <a href="eerk_bogacki_shampine_4_5-star2.png"> <img src="eerk_bogacki_shampine_4_5-star2.png" width="256px"> </a>
52!!
53!! @par References:
54!! - Bogacki & Shampine (1996); An Efficient Runge-Kutta (4,5) Pair; Comp. & Math. with Appl. 32 (6); p15-28;
55!! zotero://select/items/0_3SDMHUHW
56!! - Peter Stone (2012); Bogacki-Shampine Combined 7 Stage, Order 4 and 5 Runge-Kutta Scheme with an Additional 8
57!! Stage, Order 4 FSAL Embedded Scheme; zotero://select/items/0_AS3ZHL53
58!!
60 use mrkiss_config, only: rk
61 implicit none
62 public
63 !> The order of the overall method
64 integer, parameter :: s = 7
65 !> Number of methods
66 integer, parameter :: m = 2
67 !> The @f$\mathbf{a}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
68 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, &
69 & 624139091896320.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
70 & 277395151953920.0_rk, 554790303907840.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
71 & 499493238266880.0_rk, -1768697368289280.0_rk, 2874133223470080.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
72 & 857403196948480.0_rk, -1361758018682880.0_rk, 1099881476628480.0_rk, 1901029712691200.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
73 & 99239445453330.0_rk, 861737496197760.0_rk, 403421580251235.0_rk, 599993938324872.0_rk, 844233453306243.0_rk, 0.0_rk, 0.0_rk, &
74 & 680055277224960.0_rk, -1449549904158720.0_rk, 1546177346703360.0_rk, 2400406438993920.0_rk, -3790311591306240.0_rk, 4358056983920640.0_rk, 0.0_rk], [s, s]) / 3744834551377920.0_rk
75 !> The @f$\mathbf{b}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
76 real(kind=rk), parameter :: b(s,m) = reshape([ 101492300.0_rk, 0.0_rk, 399630510.0_rk, 272071716.0_rk, 12044214.0_rk, 501329920.0_rk, 107696940.0_rk, &
77 & 104760110.0_rk, 0.0_rk, 385163505.0_rk, 295063692.0_rk, -14425047.0_rk, 516006400.0_rk, 107696940.0_rk], [s, m]) / 1394265600.0_rk
78 !> The @f$\mathbf{c}@f$ matrix for the Butcher Tableau. @hideinitializer @hideinlinesource
79 real(kind=rk), parameter :: c(s) = [ 0.0_rk, 42.0_rk, 56.0_rk, 108.0_rk, 168.0_rk, 189.0_rk, 252.0_rk] / 252.0_rk
80 !> The method orders
81 integer, parameter :: p(m) = [4, 5]
82 !> Number of stages for each method
83 integer, parameter :: se(m) = [7, 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 Bogacki Shampine's 7 step, order (4,5) Runge-Kutta method.
integer, dimension(m), parameter p
The method orders.
real(kind=rk), dimension(s), parameter c
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.
real(kind=rk), dimension(s, s), parameter a
The matrix for the Butcher Tableau.
integer, parameter s
The order of the overall method.