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

Class of ROS3w formula in [22] for Rosenbrock method. More...

#include <num_collect/ode/rosenbrock/ros3w_formula.h>

+ Inheritance diagram for num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >:
+ Collaboration diagram for num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >:

Public Types

using base_type
 Type of base class.
 
using equation_solver_type
 Type of class to solve equations in Rosenbrock methods.
 
- Public Types inherited from num_collect::ode::rosenbrock::rosenbrock_formula_base< Derived, Problem, EquationSolver >
using base_type = formula_base<Derived, Problem>
 Type of base class.
 
using equation_solver_type = EquationSolver
 Type of class to solve equations in Rosenbrock methods.
 
using problem_type
 Type of problem.
 
using scalar_type
 Type of scalars.
 
using variable_type
 Type of variables.
 
- Public Types inherited from num_collect::ode::formula_base< Derived, Problem >
using problem_type = Problem
 Type of problem.
 
using scalar_type = typename problem_type::scalar_type
 Type of scalars.
 
using variable_type = typename problem_type::variable_type
 Type of variables.
 

Public Member Functions

 ros3w_formula (const problem_type &problem)
 Constructor.
 
auto equation_solver () -> equation_solver_type &
 Access the solver of equations in Rosenbrock methods.
 
auto equation_solver () const -> const equation_solver_type &
 Access the solver of equations in Rosenbrock methods.
 
void step (scalar_type time, scalar_type step_size, const variable_type &current, variable_type &estimate)
 Compute the next variable.
 
void step_embedded (scalar_type time, scalar_type step_size, const variable_type &current, variable_type &estimate, variable_type &error)
 Compute the next variable and weak estimate of it with embedded formula.
 
- Public Member Functions inherited from num_collect::ode::rosenbrock::rosenbrock_formula_base< Derived, Problem, EquationSolver >
 rosenbrock_formula_base (const problem_type &problem, const scalar_type &inverted_jacobian_coeff)
 Constructor.
 
auto equation_solver () -> equation_solver_type &
 Access the solver of equations in Rosenbrock methods.
 
auto equation_solver () const -> const equation_solver_type &
 Access the solver of equations in Rosenbrock methods.
 
auto tolerances (const error_tolerances< variable_type > &val) -> Derived &
 Set the error tolerances.
 
- Public Member Functions inherited from num_collect::ode::formula_base< Derived, 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 index_type lesser_order = 2
 Order of lesser coefficients of this formula.
 
static constexpr auto log_tag
 Log tag.
 
static constexpr index_type order = 3
 Order of this formula.
 
static constexpr index_type stages = 3
 Number of stages of this formula.
 
Coefficients in Rosenbrock method.
  • 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.
  • g is coefficients of intermidiate variables in calculation of intermidiate variables.
static constexpr scalar_type a21 = coeff(6.666666666666666e-01)
 
static constexpr scalar_type a31 = coeff(6.666666666666666e-01)
 
static constexpr scalar_type a32 = coeff(0)
 
static constexpr scalar_type b1 = coeff(0)
 
static constexpr scalar_type b2 = a21
 
static constexpr scalar_type b3 = a31 + a32
 
static constexpr scalar_type g21 = coeff(3.635068368900681e-01)
 
static constexpr scalar_type g31 = coeff(-8.996866791992636e-01)
 
static constexpr scalar_type g32 = coeff(-1.537997822626885e-01)
 
static constexpr scalar_type g = coeff(4.358665215084590e-01)
 
static constexpr scalar_type g1 = g
 
static constexpr scalar_type g2 = g21 + g
 
static constexpr scalar_type g3 = g31 + g32 + g
 
static constexpr scalar_type c1 = coeff(2.500000000000000e-01)
 
static constexpr scalar_type c2 = coeff(2.500000000000000e-01)
 
static constexpr scalar_type c3 = coeff(5.000000000000000e-01)
 
static constexpr scalar_type cw1 = coeff(7.467047032740110e-01)
 
static constexpr scalar_type cw2 = coeff(1.144064078371002e-01)
 
static constexpr scalar_type cw3 = coeff(1.388888888888889e-01)
 
static constexpr scalar_type ce1 = c1 - cw1
 
static constexpr scalar_type ce2 = c2 - cw2
 
static constexpr scalar_type ce3 = c3 - cw3
 

Private Attributes

variable_type temp_rhs_ {}
 Temporary right-hand-side vector.
 
variable_type temp_var_ {}
 Temporary variable.
 
Intermediate variables.
variable_type k1_ {}
 
variable_type k2_ {}
 
variable_type k3_ {}
 

Additional Inherited Members

- Protected Member Functions inherited from num_collect::ode::rosenbrock::rosenbrock_formula_base< Derived, Problem, EquationSolver >
auto derived () const noexcept -> const Derived &
 Access derived object.
 
auto derived () noexcept -> Derived &
 Access derived object.
 
- Protected Member Functions inherited from num_collect::ode::formula_base< Derived, Problem >
auto derived () const noexcept -> const Derived &
 Access derived object.
 
auto derived () noexcept -> Derived &
 Access derived object.
 
- Static Protected Member Functions inherited from num_collect::ode::rosenbrock::rosenbrock_formula_base< Derived, Problem, EquationSolver >
template<typename T >
static constexpr auto coeff (T val) -> scalar_type
 Convert coefficients.
 
template<typename T1 , typename T2 >
static constexpr auto coeff (T1 num, T2 den) -> scalar_type
 Create coefficients.
 
- Static Protected Member Functions inherited from num_collect::ode::formula_base< Derived, Problem >
template<typename T >
static constexpr auto coeff (T val) -> scalar_type
 Convert coefficients.
 
template<typename T1 , typename T2 >
static constexpr auto coeff (T1 num, T2 den) -> scalar_type
 Create coefficients.
 

Detailed Description

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
class num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >

Class of ROS3w formula in [22] for Rosenbrock method.

Template Parameters
ProblemType of problem.
EquationSolverType of class to solve equations in Rosenbrock methods.

Definition at line 43 of file ros3w_formula.h.

Member Typedef Documentation

◆ base_type

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
using num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::base_type
Initial value:
EquationSolver>
rosenbrock_formula_base(const problem_type &problem, const scalar_type &inverted_jacobian_coeff)
Constructor.

Type of base class.

Definition at line 48 of file ros3w_formula.h.

◆ equation_solver_type

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
using num_collect::ode::rosenbrock::rosenbrock_formula_base< Derived, Problem, EquationSolver >::equation_solver_type

Type of class to solve equations in Rosenbrock methods.

Definition at line 49 of file rosenbrock_formula_base.h.

Constructor & Destructor Documentation

◆ ros3w_formula()

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::ros3w_formula ( const problem_type & problem)
inlineexplicit

Constructor.

Parameters
[in]problemProblem.

Definition at line 126 of file ros3w_formula.h.

Member Function Documentation

◆ equation_solver() [1/2]

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
auto num_collect::ode::rosenbrock::rosenbrock_formula_base< Derived, Problem, EquationSolver >::equation_solver ( ) -> equation_solver_type&
inlinenodiscard

Access the solver of equations in Rosenbrock methods.

Returns
Solver.

Definition at line 97 of file rosenbrock_formula_base.h.

◆ equation_solver() [2/2]

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
auto num_collect::ode::rosenbrock::rosenbrock_formula_base< Derived, Problem, EquationSolver >::equation_solver ( ) const -> const equation_solver_type&
inlinenodiscard

Access the solver of equations in Rosenbrock methods.

Returns
Solver.

Definition at line 88 of file rosenbrock_formula_base.h.

◆ step()

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
void num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::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 130 of file ros3w_formula.h.

◆ step_embedded()

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
void num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::step_embedded ( scalar_type time,
scalar_type step_size,
const variable_type & current,
variable_type & estimate,
variable_type & error )
inline

Compute the next variable and weak estimate of it with embedded formula.

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

Definition at line 146 of file ros3w_formula.h.

Member Data Documentation

◆ a21

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::a21 = coeff(6.666666666666666e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 91 of file ros3w_formula.h.

◆ a31

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::a31 = coeff(6.666666666666666e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 92 of file ros3w_formula.h.

◆ a32

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::a32 = coeff(0)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 93 of file ros3w_formula.h.

◆ b1

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::b1 = coeff(0)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 95 of file ros3w_formula.h.

◆ b2

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::b2 = a21
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 96 of file ros3w_formula.h.

◆ b3

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::b3 = a31 + a32
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 97 of file ros3w_formula.h.

◆ c1

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::c1 = coeff(2.500000000000000e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 108 of file ros3w_formula.h.

◆ c2

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::c2 = coeff(2.500000000000000e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 109 of file ros3w_formula.h.

◆ c3

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::c3 = coeff(5.000000000000000e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 110 of file ros3w_formula.h.

◆ ce1

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::ce1 = c1 - cw1
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 116 of file ros3w_formula.h.

◆ ce2

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::ce2 = c2 - cw2
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 117 of file ros3w_formula.h.

◆ ce3

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::ce3 = c3 - cw3
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 118 of file ros3w_formula.h.

◆ cw1

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::cw1 = coeff(7.467047032740110e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 112 of file ros3w_formula.h.

◆ cw2

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::cw2 = coeff(1.144064078371002e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 113 of file ros3w_formula.h.

◆ cw3

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::cw3 = coeff(1.388888888888889e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 114 of file ros3w_formula.h.

◆ g

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::g = coeff(4.358665215084590e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 102 of file ros3w_formula.h.

◆ g1

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::g1 = g
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 104 of file ros3w_formula.h.

◆ g2

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::g2 = g21 + g
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 105 of file ros3w_formula.h.

◆ g21

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::g21 = coeff(3.635068368900681e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 99 of file ros3w_formula.h.

◆ g3

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::g3 = g31 + g32 + g
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 106 of file ros3w_formula.h.

◆ g31

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::g31 = coeff(-8.996866791992636e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 100 of file ros3w_formula.h.

◆ g32

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
scalar_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::g32 = coeff(-1.537997822626885e-01)
staticconstexpr

Coefficient in Rosenbrock method.

Definition at line 101 of file ros3w_formula.h.

◆ k1_

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
variable_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::k1_ {}
private

Intermediate variable.

Definition at line 189 of file ros3w_formula.h.

◆ k2_

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
variable_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::k2_ {}
private

Intermediate variable.

Definition at line 190 of file ros3w_formula.h.

◆ k3_

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
variable_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::k3_ {}
private

Intermediate variable.

Definition at line 191 of file ros3w_formula.h.

◆ lesser_order

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
index_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::lesser_order = 2
staticconstexpr

Order of lesser coefficients of this formula.

Definition at line 72 of file ros3w_formula.h.

◆ log_tag

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
auto num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::log_tag
staticconstexpr
Initial value:
=
logging::log_tag_view("num_collect::ode::rosenbrock::ros3w_formula")

Log tag.

Definition at line 75 of file ros3w_formula.h.

◆ order

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
index_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::order = 3
staticconstexpr

Order of this formula.

Definition at line 69 of file ros3w_formula.h.

◆ stages

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
index_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::stages = 3
staticconstexpr

Number of stages of this formula.

Definition at line 66 of file ros3w_formula.h.

◆ temp_rhs_

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
variable_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::temp_rhs_ {}
private

Temporary right-hand-side vector.

Definition at line 198 of file ros3w_formula.h.

◆ temp_var_

template<concepts::problem Problem, concepts::rosenbrock_equation_solver EquationSolver = default_rosenbrock_equation_solver_t<Problem>>
variable_type num_collect::ode::rosenbrock::ros3w_formula< Problem, EquationSolver >::temp_var_ {}
private

Temporary variable.

Definition at line 195 of file ros3w_formula.h.


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