Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
Fehlberg45.hxx
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 * Copyright (c) 2025, Davide Stocco and Enrico Bertolazzi. *
3 * *
4 * The Sandals project is distributed under the BSD 2-Clause License. *
5 * *
6 * Davide Stocco Enrico Bertolazzi *
7 * University of Trento University of Trento *
8 * e-mail: davide.stocco@unitn.it e-mail: enrico.bertolazzi@unitn.it *
9\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
11#pragma once
12
13#ifndef SANDALS_FEHELBERG45_HXX
14#define SANDALS_FEHELBERG45_HXX
15
16namespace Sandals
17{
37 class Fehlberg45Tableau : public Tableau<6>
38 {
39 public:
40 using Tableau<6>::Type;
41 using Tableau<6>::Vector;
42 using Tableau<6>::Matrix;
43
48 this->name = "Fehlberg45";
49 this->type = Type::ERK;
50 this->order = 4;
51 this->order_e = 5;
52 this->is_embedded = true;
53 this->A << 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
54 1.0/4.0, 0.0, 0.0, 0.0, 0.0, 0.0,
55 3.0/32.0, 9.0/32.0, 0.0, 0.0, 0.0, 0.0,
56 1932.0/2197.0, -7200.0/2197.0, 7296.0/2197.0, 0.0, 0.0, 0.0,
57 439.0/216.0, -8.0, 3680.0/513.0, -845.0/4104.0, 0.0, 0.0,
58 -8.0/27.0, 2.0, -3544.0/2565.0, 1859.0/4104.0, -11.0/40.0, 0.0;
59 this->b << 25.0/216.0, 0.0, 1408.0/2565.0, 2197.0/4104.0, -1.0/5.0, 0.0;
60 this->b_e << 16.0/135.0, 0.0, 6656.0/12825.0, 28561.0/56430.0, -9.0/50.0, 2.0/55.0;
61 this->c << 0.0, 1.0/4.0, 3.0/8.0, 12.0/13.0, 1.0, 1.0/2.0;
62 }
63 }; // class Fehlberg45Tableau
64
72 template <Integer N, Integer M = 0>
73 class Fehlberg45 : public RungeKutta<6, N, M>
74 {
75 public:
77
82
87 Fehlberg45(System t_system) : RungeKutta<6, N, M>(Fehlberg45Tableau(), t_system) {}
88
89 }; // class Fehlberg45
90
91} // namespace Sandals
92
93#endif // SANDALS_FEHELBERG45_HXX
Fehlberg45(System t_system)
Definition Fehlberg45.hxx:87
typename Implicit< N, M >::Pointer System
Definition Fehlberg45.hxx:76
Fehlberg45()
Definition Fehlberg45.hxx:81
Butcher tableau for the Runge-Kutta-Fehlberg 4(5) method.
Definition Fehlberg45.hxx:38
Fehlberg45Tableau()
Definition Fehlberg45.hxx:47
std::shared_ptr< Implicit< N, M > > Pointer
Definition Implicit.hxx:42
RungeKutta(const RungeKutta &)=delete
The namespace for the Sandals library.
Definition Sandals.hh:73
Struct container for the Butcher tableau of a Runge-Kutta method.
Definition Tableau.hxx:36
bool is_embedded
Definition Tableau.hxx:49
enum class type :Integer {ERK=0, IRK=1, DIRK=2} Type
Definition Tableau.hxx:37
Eigen::Matrix< Real, S, S > Matrix
Definition Tableau.hxx:39
Integer order
Definition Tableau.hxx:43
Vector b_e
Definition Tableau.hxx:47
Type type
Definition Tableau.hxx:42
Eigen::Vector< Real, S > Vector
Definition Tableau.hxx:38
Matrix A
Definition Tableau.hxx:45
Integer order_e
Definition Tableau.hxx:44
std::string name
Definition Tableau.hxx:41
Vector b
Definition Tableau.hxx:46
Vector c
Definition Tableau.hxx:48