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_erk_nystrom_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_erk_nystrom_5.f90
5!! @author Mitch Richling http://www.mitchr.me/
6!! @brief Butcher tableau for the classic 4 stage Runge-Kutta method of O(4).@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 Nystrom's 6 stage Runge-Kutta method of O(5).
38!!
39!! @image html erk_nystrom_5-stab.png
40!!
41!! @par IMO
42!! I have included this method mostly for historical and reference reasons. It is frequently used for comparisons and
43!! experiments in the literature.
44!!
45!! @par Color commentary
46!! This method was proposed in Kutta (1901), and later corrected by Nystrom (1925). The original appears in
47!! an exercise in Hairer et al. (2009).
48!!
49!! @par Known Aliases
50!! 'RKN5', 'RK41' (Butcher), & 'The Runge-Kutta Method'.
51!!
52!! @par Stability Image Links
53!! <a href="erk_nystrom_5-stab.png"> <img src="erk_nystrom_5-stab.png" width="256px"> </a>
54!! <a href="erk_nystrom_5-astab.png"> <img src="erk_nystrom_5-astab.png" width="256px"> </a>
55!! <a href="erk_nystrom_5-star1.png"> <img src="erk_nystrom_5-star1.png" width="256px"> </a>
56!! <a href="erk_nystrom_5-star2.png"> <img src="erk_nystrom_5-star2.png" width="256px"> </a>
57!!
58!! @par References:
59!! - Kutta (1901); Beitrag Zur N\"herungsweisen Integration Totaler Differentialgleichungen; Z. Math. Phys. 46; p435-53
60!! - Nystr\"om (1925); Uber die numerische Integration von Differentialgleichungen; Acta Soc. Sci. Fennicae; 50(13);
61!! - Hairer, Norsett & Wanner (2009). Solving Ordinary Differential Equations. I: Nonstiff Problems; p155;
62!! zotero://select/items/0_VLZWN2CT
63!! - Butcher (2016); Numerical Methods for Ordinary Differential Equations. 3ed; p206; zotero://select/items/0_V7UTIRPT
64!!
66 use mrkiss_config, only: rk
67 implicit none
68 public
69 !> The order of the overall method
70 integer, parameter :: s = 6
71 !> Number of methods
72 integer, parameter :: m = 1
73 !> The @f$\mathbf{a}@f$ matrix for the Butcher Tableau. @hideinitializer @showinlinesource
74 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, &
75 & 2700.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
76 & 1296.0_rk, 1944.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
77 & 2025.0_rk, -24300.0_rk, 30375.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, &
78 & 600.0_rk, 9000.0_rk, -5000.0_rk, 800.0_rk, 0.0_rk, 0.0_rk, &
79 & 648.0_rk, 3888.0_rk, 1080.0_rk, 864.0_rk, 0.0_rk, 0.0_rk], [s, s]) / 8100.0_rk
80 !> The @f$\mathbf{b}@f$ matrix for the Butcher Tableau. @hideinitializer @showinlinesource
81 real(kind=rk), parameter :: b(s,m) = reshape([ 23.0_rk, 0.0_rk, 125.0_rk, 0.0_rk, -81.0_rk, 125.0_rk], [s, m]) / 192.0_rk
82 !> The @f$\mathbf{c}@f$ matrix for the Butcher Tableau. @hideinitializer @showinlinesource
83 real(kind=rk), parameter :: c(s) = [ 0.0_rk, 5.0_rk, 6.0_rk, 15.0_rk, 10.0_rk, 12.0_rk] / 15.0_rk
84 !> The method orders
85 integer, parameter :: p(m) = [5]
86 !> Number of stages for each method
87 integer, parameter :: se(m) = [6]
88end module mrkiss_erk_nystrom_5
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 Nystrom's 6 stage Runge-Kutta method of O(5).
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, s), parameter a
The matrix for the Butcher Tableau.
integer, parameter s
The order of the overall method.
real(kind=rk), dimension(s, m), parameter b
The matrix for the Butcher Tableau.
integer, parameter m
Number of methods.
integer, dimension(m), parameter p
The method orders.