Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

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 ($b$).

Butcher tableau:

$c^T$ $A$
p $b$

Usage

Solve $y\rq=y$, for $t=[0;4]$, with initial value $y(0)=1$

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 $main.cpp$ file.

Requirement

C++23 (for 128bit decimal numbers)

Additional

Output of the Fitzhugh oscillator example in $main.cpp$.

Euler

About

Numerical methods to solve ordinary differential equations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages