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::LSODAIntegrator< S > Class Template Reference

LSODA integrator - automatically switches between stiff and non-stiff methods. More...

#include <lsoda.hpp>

Inheritance diagram for diffeq::LSODAIntegrator< S >:
Collaboration diagram for diffeq::LSODAIntegrator< S >:

Public Types

enum class  MethodType { ADAMS , BDF }
 
using base_type = core::AdaptiveIntegrator< 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::AdaptiveIntegrator< S >
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

 LSODAIntegrator (system_function sys, time_type rtol=static_cast< time_type >(1e-6), time_type atol=static_cast< time_type >(1e-9))
 
void step (state_type &state, time_type dt) override
 
time_type adaptive_step (state_type &state, time_type dt) override
 
MethodType get_current_method () const
 
void set_stiffness_detection_frequency (int frequency)
 
void set_stiffness_threshold (time_type threshold)
 
void set_tolerances (time_type rtol, time_type atol)
 
void integrate (state_type &state, time_type dt, time_type end_time) override
 
- Public Member Functions inherited from 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))
 
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)
 

Additional Inherited Members

- Protected Member Functions inherited from diffeq::core::AdaptiveIntegrator< S >
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 inherited from diffeq::core::AdaptiveIntegrator< S >
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::LSODAIntegrator< S >

LSODA integrator - automatically switches between stiff and non-stiff methods.

Automatically switches between non-stiff (Adams, approximated by RK45) and stiff (BDF) methods based on stiffness detection. This is a simplified version inspired by the original LSODA algorithm.

Definition at line 20 of file lsoda.hpp.

Member Typedef Documentation

◆ base_type

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

Definition at line 22 of file lsoda.hpp.

◆ state_type

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

Definition at line 23 of file lsoda.hpp.

◆ system_function

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

Definition at line 26 of file lsoda.hpp.

◆ time_type

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

Definition at line 24 of file lsoda.hpp.

◆ value_type

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

Definition at line 25 of file lsoda.hpp.

Member Enumeration Documentation

◆ MethodType

template<system_state S>
enum class diffeq::LSODAIntegrator::MethodType
strong

Definition at line 28 of file lsoda.hpp.

Constructor & Destructor Documentation

◆ LSODAIntegrator()

template<system_state S>
diffeq::LSODAIntegrator< S >::LSODAIntegrator ( 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 33 of file lsoda.hpp.

Member Function Documentation

◆ adaptive_step()

template<system_state S>
time_type diffeq::LSODAIntegrator< S >::adaptive_step ( state_type &  state,
time_type  dt 
)
inlineoverride

Definition at line 61 of file lsoda.hpp.

◆ get_current_method()

template<system_state S>
MethodType diffeq::LSODAIntegrator< S >::get_current_method ( ) const
inline

Definition at line 79 of file lsoda.hpp.

◆ integrate()

template<system_state S>
void diffeq::LSODAIntegrator< S >::integrate ( state_type &  state,
time_type  dt,
time_type  end_time 
)
inlineoverride

Definition at line 100 of file lsoda.hpp.

◆ set_stiffness_detection_frequency()

template<system_state S>
void diffeq::LSODAIntegrator< S >::set_stiffness_detection_frequency ( int  frequency)
inline

Definition at line 81 of file lsoda.hpp.

◆ set_stiffness_threshold()

template<system_state S>
void diffeq::LSODAIntegrator< S >::set_stiffness_threshold ( time_type  threshold)
inline

Definition at line 85 of file lsoda.hpp.

◆ set_tolerances()

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

Definition at line 89 of file lsoda.hpp.

◆ step()

template<system_state S>
void diffeq::LSODAIntegrator< S >::step ( state_type &  state,
time_type  dt 
)
inlineoverride

Definition at line 57 of file lsoda.hpp.


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