numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class to control step sizes using PI controller [8]. More...
#include <num_collect/ode/pi_step_size_controller.h>
Public Types | |
using | base_type |
Base class. | |
Public Types inherited from num_collect::ode::step_size_controller_base< pi_step_size_controller< Formula >, Formula > | |
using | formula_type |
Type of formula. | |
using | problem_type |
Type of problem. | |
using | scalar_type |
Type of scalars. | |
using | variable_type |
Type of variables. | |
Public Member Functions | |
pi_step_size_controller () | |
Constructor. | |
auto | check_and_calc_next (scalar_type &step_size, const variable_type &variable, const variable_type &error) -> bool |
Check the error estimate and calculate the next step size. | |
auto | current_step_error_exponent (const scalar_type &val) -> pi_step_size_controller & |
Set the exponent of the error of the current time step. | |
void | init () |
Initialize. | |
auto | max_step_size_factor (const scalar_type &val) -> pi_step_size_controller & |
Set the maximum factor of step sizes. | |
auto | min_step_size_factor (const scalar_type &val) -> pi_step_size_controller & |
Set the minimum factor of step sizes. | |
auto | previous_step_error_exponent (const scalar_type &val) -> pi_step_size_controller & |
Set the exponent of the error of the previous time step. | |
auto | step_size_factor_safety_coeff (const scalar_type &val) -> pi_step_size_controller & |
Set the safety coefficient for factors of step sizes. | |
Public Member Functions inherited from num_collect::ode::step_size_controller_base< pi_step_size_controller< Formula >, Formula > | |
auto | limits () const -> const step_size_limits< scalar_type > & |
Get the limits of step sizes. | |
auto | limits (const step_size_limits< scalar_type > &val) -> pi_step_size_controller< Formula > & |
Set the limits of step sizes. | |
auto | reduction_rate (const scalar_type &val) -> pi_step_size_controller< Formula > & |
Set the rate to reduce step sizes when error is large. | |
auto | tolerances () const -> const error_tolerances< variable_type > & |
Get the error tolerances. | |
auto | tolerances (const error_tolerances< variable_type > &val) -> pi_step_size_controller< Formula > & |
Set the error tolerances. | |
Public Member Functions inherited from num_collect::logging::logging_mixin | |
logging_mixin (log_tag_view tag) | |
Constructor. | |
template<typename Child > | |
void | configure_child_algorithm_logger_if_exists (Child &child) |
Configure a logger of a child algorithm if exists. | |
auto | logger () const noexcept -> const num_collect::logging::logger & |
Access to the logger. | |
auto | logger () noexcept -> num_collect::logging::logger & |
Access to the logger. | |
Static Public Attributes | |
static constexpr scalar_type | default_current_step_error_exponent |
Default exponent of the error of the current time step. | |
static constexpr scalar_type | default_previous_step_error_exponent |
Default exponent of the error of the previous time step. | |
static constexpr index_type | formula_order_for_exponent |
Order of the formula used in exponents. | |
Private Member Functions | |
void | calc_next (scalar_type &step_size, const variable_type &variable, const variable_type &error) |
Calculate the next step size. | |
Private Attributes | |
scalar_type | current_step_error_exponent_ |
Exponent of the error of the current time step. | |
scalar_type | max_step_size_factor_ {default_max_step_size_factor} |
Maximum factor of step sizes. | |
scalar_type | min_step_size_factor_ {default_min_step_size_factor} |
Minimum factor of step sizes. | |
scalar_type | previous_step_error_ {static_cast<scalar_type>(1)} |
Error of the previous time step. | |
scalar_type | previous_step_error_exponent_ |
Exponent of the error of the previous time step. | |
scalar_type | step_size_factor_safety_coeff_ |
Safety coefficient for factors of step sizes. | |
Static Private Attributes | |
static constexpr auto | default_max_step_size_factor |
Default maximum factor of step sizes. | |
static constexpr auto | default_min_step_size_factor |
Default minimum factor of step sizes. | |
static constexpr auto | default_step_size_factor_safety_coeff |
Default safety coefficient for factors of step sizes. | |
Additional Inherited Members | |
Protected Member Functions inherited from num_collect::ode::step_size_controller_base< pi_step_size_controller< Formula >, Formula > | |
step_size_controller_base (logging::log_tag_view tag) | |
Constructor. | |
auto | derived () const noexcept -> const pi_step_size_controller< Formula > & |
Access derived object. | |
auto | derived () noexcept -> pi_step_size_controller< Formula > & |
Access derived object. | |
auto | reduce_if_needed (scalar_type &step_size, const variable_type &variable, const variable_type &error) -> bool |
Reduce step size if needed. | |
Class to control step sizes using PI controller [8].
Formula | Type of the formula. |
Definition at line 47 of file pi_step_size_controller.h.
using num_collect::ode::pi_step_size_controller< Formula >::base_type |
Base class.
Definition at line 52 of file pi_step_size_controller.h.
|
inline |
Constructor.
Definition at line 85 of file pi_step_size_controller.h.
|
inlineprivate |
Calculate the next step size.
[in,out] | step_size | Step size. |
[in] | variable | Variable. |
[in] | error | Error estimate. |
Definition at line 197 of file pi_step_size_controller.h.
|
inlinenodiscard |
Check the error estimate and calculate the next step size.
[in,out] | step_size | Step size. |
[in] | variable | Variable. |
[in] | error | Error estimate. |
true | Given error satisfies tolerances. |
false | Given error doesn't satisfy tolerances. |
Definition at line 103 of file pi_step_size_controller.h.
|
inline |
Set the exponent of the error of the current time step.
[in] | val | Value. |
Definition at line 118 of file pi_step_size_controller.h.
|
inline |
Initialize.
Definition at line 90 of file pi_step_size_controller.h.
|
inline |
Set the maximum factor of step sizes.
[in] | val | Value. |
Definition at line 164 of file pi_step_size_controller.h.
|
inline |
Set the minimum factor of step sizes.
[in] | val | Value. |
Definition at line 179 of file pi_step_size_controller.h.
|
inline |
Set the exponent of the error of the previous time step.
[in] | val | Value. |
Definition at line 133 of file pi_step_size_controller.h.
|
inline |
Set the safety coefficient for factors of step sizes.
[in] | val | Value. |
Definition at line 149 of file pi_step_size_controller.h.
|
private |
Exponent of the error of the current time step.
Definition at line 230 of file pi_step_size_controller.h.
|
staticconstexpr |
Default exponent of the error of the current time step.
This is a value proposed by [8].
Definition at line 69 of file pi_step_size_controller.h.
|
staticconstexprprivate |
Default maximum factor of step sizes.
Definition at line 246 of file pi_step_size_controller.h.
|
staticconstexprprivate |
Default minimum factor of step sizes.
Definition at line 253 of file pi_step_size_controller.h.
|
staticconstexpr |
Default exponent of the error of the previous time step.
This is a value proposed by [8].
Definition at line 78 of file pi_step_size_controller.h.
|
staticconstexprprivate |
Default safety coefficient for factors of step sizes.
Definition at line 238 of file pi_step_size_controller.h.
|
staticconstexpr |
Order of the formula used in exponents.
Definition at line 61 of file pi_step_size_controller.h.
|
private |
Maximum factor of step sizes.
Definition at line 250 of file pi_step_size_controller.h.
|
private |
Minimum factor of step sizes.
Definition at line 257 of file pi_step_size_controller.h.
|
private |
Error of the previous time step.
Definition at line 227 of file pi_step_size_controller.h.
|
private |
Exponent of the error of the previous time step.
Definition at line 234 of file pi_step_size_controller.h.
|
private |
Safety coefficient for factors of step sizes.
Definition at line 242 of file pi_step_size_controller.h.