DiffEq - Modern C++ ODE Integration Library 1.0.0
High-performance C++ library for solving ODEs with async signal processing
Loading...
Searching...
No Matches
diffeq::core::AdaptiveIntegrator< S > Class Template Referenceabstract
Inheritance diagram for diffeq::core::AdaptiveIntegrator< S >:
Collaboration diagram for diffeq::core::AdaptiveIntegrator< S >:

Public Types

using base_type = AbstractIntegrator< S >
 
using state_type = typename base_type::state_type
 
using time_type = typename base_type::time_type
 
using value_type = typename base_type::value_type
 
using system_function = typename base_type::system_function
 
- Public Types inherited from diffeq::core::AbstractIntegrator< S >
using state_type = S
 
using time_type = typename S::value_type
 
using value_type = typename S::value_type
 
using system_function = std::function< void(time_type, const state_type &, state_type &)>
 

Public Member Functions

 AdaptiveIntegrator (system_function sys, time_type rtol=static_cast< time_type >(1e-6), time_type atol=static_cast< time_type >(1e-9))
 
void integrate (state_type &state, time_type dt, time_type end_time) override
 
virtual time_type adaptive_step (state_type &state, time_type dt)=0
 
void set_tolerances (time_type rtol, time_type atol)
 
void set_step_limits (time_type dt_min, time_type dt_max)
 
- Public Member Functions inherited from diffeq::core::AbstractIntegrator< S >
 AbstractIntegrator (system_function sys)
 
virtual void step (state_type &state, time_type dt)=0
 
time_type current_time () const
 
void set_time (time_type t)
 
void set_system (system_function sys)
 

Protected Member Functions

time_type calculate_tolerance (value_type y_val) const
 
time_type error_norm (const state_type &error, const state_type &y) const
 
time_type error_norm_scipy_style (const state_type &error, const state_type &y_old, const state_type &y_new) const
 
time_type suggest_step_size (time_type current_dt, time_type error_norm, int order) const
 
- Protected Member Functions inherited from diffeq::core::AbstractIntegrator< S >
void advance_time (time_type dt)
 

Protected Attributes

time_type rtol_
 
time_type atol_
 
time_type dt_min_
 
time_type dt_max_
 
time_type safety_factor_
 
- Protected Attributes inherited from diffeq::core::AbstractIntegrator< S >
system_function sys_
 
time_type current_time_
 

Detailed Description

template<system_state S>
class diffeq::core::AdaptiveIntegrator< S >

Definition at line 19 of file adaptive_integrator.hpp.

Member Typedef Documentation

◆ base_type

template<system_state S>
using diffeq::core::AdaptiveIntegrator< S >::base_type = AbstractIntegrator<S>

Definition at line 21 of file adaptive_integrator.hpp.

◆ state_type

template<system_state S>
using diffeq::core::AdaptiveIntegrator< S >::state_type = typename base_type::state_type

Definition at line 22 of file adaptive_integrator.hpp.

◆ system_function

template<system_state S>
using diffeq::core::AdaptiveIntegrator< S >::system_function = typename base_type::system_function

Definition at line 25 of file adaptive_integrator.hpp.

◆ time_type

template<system_state S>
using diffeq::core::AdaptiveIntegrator< S >::time_type = typename base_type::time_type

Definition at line 23 of file adaptive_integrator.hpp.

◆ value_type

template<system_state S>
using diffeq::core::AdaptiveIntegrator< S >::value_type = typename base_type::value_type

Definition at line 24 of file adaptive_integrator.hpp.

Constructor & Destructor Documentation

◆ AdaptiveIntegrator()

template<system_state S>
diffeq::core::AdaptiveIntegrator< S >::AdaptiveIntegrator ( system_function  sys,
time_type  rtol = static_cast<time_type>(1e-6),
time_type  atol = static_cast<time_type>(1e-9) 
)
inlineexplicit

Definition at line 27 of file adaptive_integrator.hpp.

Member Function Documentation

◆ calculate_tolerance()

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::calculate_tolerance ( value_type  y_val) const
inlineprotected

Definition at line 71 of file adaptive_integrator.hpp.

◆ error_norm()

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::error_norm ( const state_type &  error,
const state_type &  y 
) const
inlineprotected

Definition at line 76 of file adaptive_integrator.hpp.

◆ error_norm_scipy_style()

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::error_norm_scipy_style ( const state_type &  error,
const state_type &  y_old,
const state_type &  y_new 
) const
inlineprotected

Definition at line 94 of file adaptive_integrator.hpp.

◆ integrate()

template<system_state S>
void diffeq::core::AdaptiveIntegrator< S >::integrate ( state_type &  state,
time_type  dt,
time_type  end_time 
)
inlineoverridevirtual

Reimplemented from diffeq::core::AbstractIntegrator< S >.

Definition at line 35 of file adaptive_integrator.hpp.

◆ set_step_limits()

template<system_state S>
void diffeq::core::AdaptiveIntegrator< S >::set_step_limits ( time_type  dt_min,
time_type  dt_max 
)
inline

Definition at line 60 of file adaptive_integrator.hpp.

◆ set_tolerances()

template<system_state S>
void diffeq::core::AdaptiveIntegrator< S >::set_tolerances ( time_type  rtol,
time_type  atol 
)
inline

Definition at line 55 of file adaptive_integrator.hpp.

◆ suggest_step_size()

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::suggest_step_size ( time_type  current_dt,
time_type  error_norm,
int  order 
) const
inlineprotected

Definition at line 115 of file adaptive_integrator.hpp.

Member Data Documentation

◆ atol_

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::atol_
protected

Definition at line 66 of file adaptive_integrator.hpp.

◆ dt_max_

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::dt_max_
protected

Definition at line 67 of file adaptive_integrator.hpp.

◆ dt_min_

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::dt_min_
protected

Definition at line 67 of file adaptive_integrator.hpp.

◆ rtol_

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::rtol_
protected

Definition at line 66 of file adaptive_integrator.hpp.

◆ safety_factor_

template<system_state S>
time_type diffeq::core::AdaptiveIntegrator< S >::safety_factor_
protected

Definition at line 68 of file adaptive_integrator.hpp.


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