50template <concepts::embedded_formula Formula,
51 concepts::step_size_controller StepSizeController =
52 pi_step_size_controller<Formula>>
54 :
public solver_base<embedded_solver<Formula, StepSizeController>,
73 typename step_size_controller_type::formula_type>);
78 using base_type::base_type;
92 "Using user-specified initial step size {}.", *
step_size_);
95 this->
logger(),
"Automatically calculate initial step size.");
101 "Automatically selected initial step size {}.", *
step_size_);
108 "Step size is not set yet. You may forget to call init "
134 iteration_logger.template append<index_type>(
136 iteration_logger.template append<scalar_type>(
"Time", &
this_type::time);
137 iteration_logger.template append<scalar_type>(
139 iteration_logger.template append<scalar_type>(
154 return std::numeric_limits<scalar_type>::quiet_NaN();
183 this->
logger(),
"Step size must be a positive value.");
Class to write logs of iterations.
auto logger() const noexcept -> const num_collect::logging::logger &
Access to the logger.
Class of solvers of ODEs using embedded formulas.
static auto norm(const variable_type &var) -> scalar_type
Get the norm of a variable.
std::optional< scalar_type > step_size_
Step size used in the next step.
auto step_size() const -> scalar_type
Get the step size.
static constexpr index_type lesser_order
Order of lesser coefficients of this formula.
Formula formula_type
Type of formula.
StepSizeController step_size_controller_type
Type of the controller of step sizes.
typename problem_type::variable_type variable_type
Type of variables.
void step()
Compute the variable of the next step.
auto problem() -> problem_type &
Get the problem.
step_size_controller_type step_size_controller_
Controller of step sizes.
auto time() const -> scalar_type
Get the current time.
auto variable() const -> const variable_type &
Get the current variable.
variable_type variable_
Variable.
auto tolerances(const error_tolerances< variable_type > &val) -> embedded_solver &
Set the error tolerances.
variable_type prev_variable_
Previous variable.
auto step_size(scalar_type val) -> this_type &
Set the step size.
auto error_norm() const -> scalar_type
Get the estimate of error in the current variable.
auto last_step_size() const -> scalar_type
Get the step size used in the last step.
auto step_size_controller() const -> const step_size_controller_type &
Access the controller of step sizes.
auto step_size_controller() -> step_size_controller_type &
Access the controller of step sizes.
scalar_type last_step_size_
Step size used in the last step.
variable_type error_
Estimate of error.
typename problem_type::scalar_type scalar_type
Type of scalars.
index_type steps_
Number of steps.
void configure_iteration_logger(logging::iterations::iteration_logger< this_type > &iteration_logger) const
Configure an iteration logger.
auto formula() -> formula_type &
Get the formula.
auto steps() const -> index_type
Get the number of steps.
void init(scalar_type time, const variable_type &variable)
Initialize.
Class of error tolerances hairer1993.
Class to calculate initial step sizes hairer1993.
auto calculate(problem_type &problem, const scalar_type &initial_time, const variable_type &initial_variable, const step_size_limits< scalar_type > &limits, const error_tolerances< variable_type > &tolerances) const -> scalar_type
Calculate the initial step size.
Base class of solvers of ODEs.
Formula formula_type
Type of formula.
typename formula_type::problem_type problem_type
Type of problem.
typename problem_type::variable_type variable_type
Type of variables.
auto problem() -> problem_type &
Get the problem.
typename problem_type::scalar_type scalar_type
Type of scalars.
auto formula() -> formula_type &
Get the formula.
Definition of error_tolerances class.
Definition of exceptions.
Definition of index_type type.
Definition of initial_step_size_calculator class.
Definition of is_eigen_vector class.
Definition of iteration_logger class.
Definition of macros for logging.
#define NUM_COLLECT_LOG_TRACE(LOGGER,...)
Write a trace log.
#define NUM_COLLECT_LOG_DEBUG(LOGGER,...)
Write a debug log.
std::ptrdiff_t index_type
Type of indices in this library.
Namespace of solvers of ordinary differential equations (ODE).
constexpr bool is_eigen_vector_v
Get whether a type is a Eigen's vector.
Definition of pi_step_size_controller class.
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 solver_base class.
Definition of step_size_controller concept.