46template <concepts::formula Formula>
121 "0 <= previous_step_error_exponent <= "
122 "current_step_error_exponent must be satisfied.");
137 "0 <= previous_step_error_exponent <= "
138 "current_step_error_exponent must be satisfied.");
152 "Safety coefficient for factors of step sizes must be a positive "
167 "0 < min_step_size_factor < max_step_size_factor must be "
183 "0 < min_step_size_factor < max_step_size_factor must be "
202 this->
tolerances().calc_norm(variable, error);
220 step_size = this->
limits().apply(step_size);
Class of tags of logs without memory management.
Class to control step sizes using PI controller gustafsson1991.
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 min_step_size_factor(const scalar_type &val) -> pi_step_size_controller &
Set the minimum factor of step sizes.
static constexpr scalar_type default_previous_step_error_exponent
Default exponent of the error of the previous time step.
scalar_type previous_step_error_
Error of the previous time step.
scalar_type previous_step_error_exponent_
Exponent of the error of the previous time step.
static constexpr auto default_max_step_size_factor
Default maximum factor of step sizes.
static constexpr auto default_step_size_factor_safety_coeff
Default safety coefficient for factors of step sizes.
auto step_size_factor_safety_coeff(const scalar_type &val) -> pi_step_size_controller &
Set the safety coefficient for factors of step sizes.
scalar_type current_step_error_exponent_
Exponent of the error of the current time step.
scalar_type step_size_factor_safety_coeff_
Safety coefficient for factors of step sizes.
static constexpr auto default_min_step_size_factor
Default minimum factor of step sizes.
scalar_type max_step_size_factor_
Maximum factor of step sizes.
static constexpr scalar_type default_current_step_error_exponent
Default exponent of the error of the current time step.
auto max_step_size_factor(const scalar_type &val) -> pi_step_size_controller &
Set the maximum factor of step sizes.
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.
void calc_next(scalar_type &step_size, const variable_type &variable, const variable_type &error)
Calculate the next step size.
static constexpr index_type formula_order_for_exponent
Order of the formula used in exponents.
scalar_type min_step_size_factor_
Minimum factor of step sizes.
auto current_step_error_exponent(const scalar_type &val) -> pi_step_size_controller &
Set the exponent of the error of the current time step.
Base class of classes to control step sizes.
typename formula_type::problem_type problem_type
auto reduce_if_needed(scalar_type &step_size, const variable_type &variable, const variable_type &error) -> bool
auto limits() const -> const step_size_limits< scalar_type > &
auto tolerances() const -> const error_tolerances< variable_type > &
typename problem_type::scalar_type scalar_type
typename problem_type::variable_type variable_type
Definition of error_tolerances class.
Definition of exceptions.
Definition of get_least_known_order function.
Definition of index_type type.
Definition of log_tag_view class.
Definition of macros for logging.
std::ptrdiff_t index_type
Type of indices in this library.
auto isfinite(const T &val) -> bool
Check whether a number is finite.
constexpr auto get_least_known_order() -> index_type
Get the least known order of a formula.
Namespace of solvers of ordinary differential equations (ODE).
constexpr auto pi_step_size_controller_log_tag
Log tag.
Definition of NUM_COLLECT_PRECONDITION macro.
#define NUM_COLLECT_PRECONDITION(CONDITION,...)
Check whether a precondition is satisfied and throw an exception if not.
Definition of step_size_controller_base class.
Definition of step_size_limits class.