numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class of leap-frog formula. More...
#include <num_collect/ode/symplectic/leap_frog_formula.h>
Public Types | |
using | base_type = formula_base<leap_frog_formula<Problem>, Problem> |
Type of base class. | |
Public Types inherited from num_collect::ode::formula_base< leap_frog_formula< Problem >, Problem > | |
using | problem_type |
Type of problem. | |
using | scalar_type |
Type of scalars. | |
using | variable_type |
Type of variables. | |
Public Member Functions | |
void | step (scalar_type time, scalar_type step_size, const variable_type ¤t, variable_type &estimate) |
Compute the next variable. | |
Public Member Functions inherited from num_collect::ode::formula_base< leap_frog_formula< Problem >, Problem > | |
formula_base (const problem_type &problem=problem_type()) | |
Constructor. | |
auto | problem () -> problem_type & |
Get the problem. | |
auto | problem () const -> const problem_type & |
Get the problem. | |
void | step (scalar_type time, scalar_type step_size, const variable_type ¤t, variable_type &estimate) |
Compute the next variable. | |
Static Public Attributes | |
static constexpr auto | log_tag |
Log tag. | |
static constexpr index_type | order = 2 |
Order of this formula. | |
static constexpr index_type | stages = 3 |
Number of stages of this formula. | |
Additional Inherited Members | |
Protected Member Functions inherited from num_collect::ode::formula_base< leap_frog_formula< Problem >, Problem > | |
auto | derived () const noexcept -> const leap_frog_formula< Problem > & |
Access derived object. | |
auto | derived () noexcept -> leap_frog_formula< Problem > & |
Access derived object. | |
Static Protected Member Functions inherited from num_collect::ode::formula_base< leap_frog_formula< Problem >, Problem > | |
static constexpr auto | coeff (T val) -> scalar_type |
Convert coefficients. | |
static constexpr auto | coeff (T1 num, T2 den) -> scalar_type |
Create coefficients. | |
Class of leap-frog formula.
This formula solves initial value problems of ODEs with following structure:
\[ \frac{d}{dt} \begin{pmatrix} \boldsymbol{p} \\ \boldsymbol{q} \end{pmatrix} = \begin{pmatrix} -\frac{\partial V}{\partial \boldsymbol{q}} \\ \frac{\partial T}{\partial \boldsymbol{p}} \end{pmatrix} \]
This formula assumes that the lower half of the solution vector is position \(\boldsymbol{q}\), and the upper half is moment \(\boldsymbol{p}\).
Problem | Type of problem. |
Definition at line 60 of file leap_frog_formula.h.
using num_collect::ode::symplectic::leap_frog_formula< Problem >::base_type = formula_base<leap_frog_formula<Problem>, Problem> |
Type of base class.
Definition at line 64 of file leap_frog_formula.h.
|
inline |
Compute the next variable.
[in] | time | Current time. |
[in] | step_size | Step size. |
[in] | current | Current variable. |
[out] | estimate | Estimate of the next variable. |
Definition at line 91 of file leap_frog_formula.h.
|
staticconstexpr |
Log tag.
Definition at line 87 of file leap_frog_formula.h.
|
staticconstexpr |
Order of this formula.
Definition at line 84 of file leap_frog_formula.h.
|
staticconstexpr |
Number of stages of this formula.
Definition at line 81 of file leap_frog_formula.h.