Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
Sandals::Tableau< Real, S > Struct Template Reference

Struct container for the Butcher tableau of a Runge-Kutta method. More...

#include <Tableau.hh>

Public Types

using Type = enum class type : Integer {ERK = 0, IRK = 1, DIRK = 2}
using Vector = Eigen::Vector<Real, S>
using Matrix = Eigen::Matrix<Real, S, S>

Public Member Functions

bool check (bool verbose=false) const

Public Attributes

const Real SQRT_EPSILON {std::sqrt(EPSILON)}
std::string name
Type type
Integer order
Integer order_e {-1}
Matrix A
Vector b
Vector b_e {Vector::Zero()}
Vector c
bool is_embedded {false}

Private Member Functions

Integer compute_order (Matrix const &A, Vector const &b, Vector const &c, bool verbose=false) const

Detailed Description

template<typename Real, Integer S>
struct Sandals::Tableau< Real, S >

Butcher tableau

Runge-Kutta methods are a family of numerical techniques for solving ODEs and DAEs. These methods approximate the solution by combining weighted evaluations of the system's functions at specific points called nodes within the integration domain.

A Runge-Kutta method is characterized by its Butcher tableau, a tabular representation of the method's parameters. For a method of order \(p\) and \(s\) stages, the Butcher tableau is defined as

\[ \begin{array}{c|ccc} c_1 & a_{11} & a_{12} & \dots & a_{1s} \\ c_2 & a_{21} & a_{22} & \dots & a_{2s} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ c_s & a_{s1} & a_{s2} & \dots & a_{ss} \\ \hline & b_1 & b_2 & \dots & b_s \end{array} \text{,} \]

where \(\mathbf{A}\) is the Runge-Kutta coefficient matrix, \(\mathbf{b}\) is the Runge-Kutta weights vector, \(\hat{\mathbf{b}}\) is the (optional) embedded Runge-Kutta weights vector, and \(\mathbf{c}\) is the Runge-Kutta nodes vector. These parameters define the method's structure and determine its accuracy and stability.

Template Parameters
SThe size of the Butcher tableau.

Member Typedef Documentation

◆ Matrix

template<typename Real, Integer S>
using Sandals::Tableau< Real, S >::Matrix = Eigen::Matrix<Real, S, S>

Templetized matrix type.

◆ Type

template<typename Real, Integer S>
using Sandals::Tableau< Real, S >::Type = enum class type : Integer {ERK = 0, IRK = 1, DIRK = 2}

Runge-Kutta type enumeration.

◆ Vector

template<typename Real, Integer S>
using Sandals::Tableau< Real, S >::Vector = Eigen::Vector<Real, S>

Templetized vector type.

Member Function Documentation

◆ check()

template<typename Real, Integer S>
bool Sandals::Tableau< Real, S >::check ( bool verbose = false) const
inline

Check the Butcher tableau consistency for a generic Runge-Kutta method.

Parameters
[in]verboseVerbosity flag.
Returns
True if the Butcher tableau is consistent and its order is verified, false otherwise.

◆ compute_order()

template<typename Real, Integer S>
Integer Sandals::Tableau< Real, S >::compute_order ( Matrix const & A,
Vector const & b,
Vector const & c,
bool verbose = false ) const
inlineprivate

Check the order of a Runge-Kutta method according to the conditions taken from: A family of embedded Runge-Kutta formulae, J. R. Dormand and P. J. Prince, Journal of Computational and Applied Mathematics, volume 6(1), 1980. DOI 10.1016/0771-0509(80)90013-3.

Parameters
[in]AMatrix \( \mathbf{A} \).
[in]bWeights vector \( \mathbf{b} \) or embedded weights vector \( \hat{\mathbf{b}} \).
[in]cNodes vector \( \mathbf{c} \).
[in]verboseVerbosity flag.
Returns
The calculated order of the Runge-Kutta method.

Member Data Documentation

◆ A

template<typename Real, Integer S>
Matrix Sandals::Tableau< Real, S >::A

Matrix \( \mathbf{A} \).

◆ b

template<typename Real, Integer S>
Vector Sandals::Tableau< Real, S >::b

Weights vector \( \mathbf{b} \).

◆ b_e

template<typename Real, Integer S>
Vector Sandals::Tableau< Real, S >::b_e {Vector::Zero()}

Embedded weights vector \( \hat{\mathbf{b}} \).

◆ c

template<typename Real, Integer S>
Vector Sandals::Tableau< Real, S >::c

Nodes vector \( \mathbf{c} \).

◆ is_embedded

template<typename Real, Integer S>
bool Sandals::Tableau< Real, S >::is_embedded {false}

Embedded method boolean.

◆ name

template<typename Real, Integer S>
std::string Sandals::Tableau< Real, S >::name

Name of the Runge-Kutta method.

◆ order

template<typename Real, Integer S>
Integer Sandals::Tableau< Real, S >::order

Order of the Runge-Kutta method.

◆ order_e

template<typename Real, Integer S>
Integer Sandals::Tableau< Real, S >::order_e {-1}

Order of the Runge-Kutta embedded method.

◆ SQRT_EPSILON

template<typename Real, Integer S>
const Real Sandals::Tableau< Real, S >::SQRT_EPSILON {std::sqrt(EPSILON)}

< Basic constants. Square root of machine epsilon epsilon static constant value.

◆ type

template<typename Real, Integer S>
Type Sandals::Tableau< Real, S >::type

Runge-Kutta type.


The documentation for this struct was generated from the following file: