Numerical methods to solve ordinary differential equations.
Methods comes with Butcher tableaus. Note that (embedded) tableaus come with a non-standard notation in lower left quadrant (p), showing the order of the weights (
Butcher tableau:
| p |
Solve
auto function = [](
Real const& y,
[[maybe_unused]] Real const& t
) -> Real
{
return y;
};
Real y{ 1.q };
// h, fixed step size
Real const h{ 0.02q };
Real const t_max{ 4.q };
std::uint64_t i{ 0 };
do {
y = ODE::Euler::Forward<Real>( function, h, y );
} while ( ++i * h < t_max );
std::cout << "Euler: y(" << i * h << " ) =" << y << '\n';
Output:
Steps take: 200
Euler: y( 4 ) = 52.4849
More examples are included in the
C++23 (for 128bit decimal numbers)
Output of the Fitzhugh oscillator example in
