numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::ode::runge_kutta::rk4_formula< Problem > Class Template Reference

Class of Runge-Kutta 4 formula (classic Runge-Kutta method). More...

#include <num_collect/ode/runge_kutta/rk4_formula.h>

+ Inheritance diagram for num_collect::ode::runge_kutta::rk4_formula< Problem >:
+ Collaboration diagram for num_collect::ode::runge_kutta::rk4_formula< Problem >:

Public Types

using base_type = formula_base<rk4_formula<Problem>, Problem>
 Type of base class.
 
- Public Types inherited from num_collect::ode::formula_base< rk4_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 &current, variable_type &estimate)
 Compute the next variable.
 
- Public Member Functions inherited from num_collect::ode::formula_base< rk4_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 &current, variable_type &estimate)
 Compute the next variable.
 

Static Public Attributes

static constexpr auto log_tag
 Log tag.
 
static constexpr index_type order = 4
 Order of this formula.
 
static constexpr index_type stages = 4
 Number of stages of this formula.
 
Coefficients in Butcher array.
  • a is coefficients of intermidiate variables in calculation of intermidiate variables.
  • b is coefficients of time in calculation of intermidiate variables.
  • c is coefficients of intermidiate variables in calculation of estimates of next variables.
static constexpr scalar_type a21 = coeff(1, 2)
 
static constexpr scalar_type a32 = coeff(1, 2)
 
static constexpr scalar_type a43 = coeff(1)
 
static constexpr scalar_type b1 = coeff(0)
 
static constexpr scalar_type b2 = coeff(1, 2)
 
static constexpr scalar_type b3 = coeff(1, 2)
 
static constexpr scalar_type b4 = coeff(1)
 
static constexpr scalar_type c1 = coeff(1, 6)
 
static constexpr scalar_type c2 = coeff(1, 3)
 
static constexpr scalar_type c3 = coeff(1, 3)
 
static constexpr scalar_type c4 = coeff(1, 6)
 

Private Attributes

Intermediate variables.
variable_type k1_ {}
 
variable_type k2_ {}
 
variable_type k3_ {}
 
variable_type k4_ {}
 

Additional Inherited Members

- Protected Member Functions inherited from num_collect::ode::formula_base< rk4_formula< Problem >, Problem >
auto derived () const noexcept -> const rk4_formula< Problem > &
 Access derived object.
 
auto derived () noexcept -> rk4_formula< Problem > &
 Access derived object.
 
- Static Protected Member Functions inherited from num_collect::ode::formula_base< rk4_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.
 

Detailed Description

template<concepts::problem Problem>
class num_collect::ode::runge_kutta::rk4_formula< Problem >

Class of Runge-Kutta 4 formula (classic Runge-Kutta method).

Template Parameters
ProblemType of problem.

Definition at line 38 of file rk4_formula.h.

Member Typedef Documentation

◆ base_type

template<concepts::problem Problem>
using num_collect::ode::runge_kutta::rk4_formula< Problem >::base_type = formula_base<rk4_formula<Problem>, Problem>

Type of base class.

Definition at line 41 of file rk4_formula.h.

Member Function Documentation

◆ step()

template<concepts::problem Problem>
void num_collect::ode::runge_kutta::rk4_formula< Problem >::step ( scalar_type time,
scalar_type step_size,
const variable_type & current,
variable_type & estimate )
inline

Compute the next variable.

Parameters
[in]timeCurrent time.
[in]step_sizeStep size.
[in]currentCurrent variable.
[out]estimateEstimate of the next variable.

Definition at line 94 of file rk4_formula.h.

Member Data Documentation

◆ a21

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::a21 = coeff(1, 2)
staticconstexpr

Coefficient in Butcher array.

Definition at line 78 of file rk4_formula.h.

◆ a32

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::a32 = coeff(1, 2)
staticconstexpr

Coefficient in Butcher array.

Definition at line 79 of file rk4_formula.h.

◆ a43

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::a43 = coeff(1)
staticconstexpr

Coefficient in Butcher array.

Definition at line 80 of file rk4_formula.h.

◆ b1

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::b1 = coeff(0)
staticconstexpr

Coefficient in Butcher array.

Definition at line 82 of file rk4_formula.h.

◆ b2

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::b2 = coeff(1, 2)
staticconstexpr

Coefficient in Butcher array.

Definition at line 83 of file rk4_formula.h.

◆ b3

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::b3 = coeff(1, 2)
staticconstexpr

Coefficient in Butcher array.

Definition at line 84 of file rk4_formula.h.

◆ b4

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::b4 = coeff(1)
staticconstexpr

Coefficient in Butcher array.

Definition at line 85 of file rk4_formula.h.

◆ c1

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::c1 = coeff(1, 6)
staticconstexpr

Coefficient in Butcher array.

Definition at line 87 of file rk4_formula.h.

◆ c2

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::c2 = coeff(1, 3)
staticconstexpr

Coefficient in Butcher array.

Definition at line 88 of file rk4_formula.h.

◆ c3

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::c3 = coeff(1, 3)
staticconstexpr

Coefficient in Butcher array.

Definition at line 89 of file rk4_formula.h.

◆ c4

template<concepts::problem Problem>
scalar_type num_collect::ode::runge_kutta::rk4_formula< Problem >::c4 = coeff(1, 6)
staticconstexpr

Coefficient in Butcher array.

Definition at line 90 of file rk4_formula.h.

◆ k1_

template<concepts::problem Problem>
variable_type num_collect::ode::runge_kutta::rk4_formula< Problem >::k1_ {}
private

Intermediate variable.

Definition at line 123 of file rk4_formula.h.

◆ k2_

template<concepts::problem Problem>
variable_type num_collect::ode::runge_kutta::rk4_formula< Problem >::k2_ {}
private

Intermediate variable.

Definition at line 124 of file rk4_formula.h.

◆ k3_

template<concepts::problem Problem>
variable_type num_collect::ode::runge_kutta::rk4_formula< Problem >::k3_ {}
private

Intermediate variable.

Definition at line 125 of file rk4_formula.h.

◆ k4_

template<concepts::problem Problem>
variable_type num_collect::ode::runge_kutta::rk4_formula< Problem >::k4_ {}
private

Intermediate variable.

Definition at line 126 of file rk4_formula.h.

◆ log_tag

template<concepts::problem Problem>
auto num_collect::ode::runge_kutta::rk4_formula< Problem >::log_tag
staticconstexpr
Initial value:
=
logging::log_tag_view("num_collect::ode::runge_kutta::rk4_formula")

Log tag.

Definition at line 64 of file rk4_formula.h.

◆ order

template<concepts::problem Problem>
index_type num_collect::ode::runge_kutta::rk4_formula< Problem >::order = 4
staticconstexpr

Order of this formula.

Definition at line 61 of file rk4_formula.h.

◆ stages

template<concepts::problem Problem>
index_type num_collect::ode::runge_kutta::rk4_formula< Problem >::stages = 4
staticconstexpr

Number of stages of this formula.

Definition at line 58 of file rk4_formula.h.


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