RKIntegratorCore< FP > Class Template Reference

CPP API: mio::RKIntegratorCore< FP > Class Template Reference
mio::RKIntegratorCore< FP > Class Template Reference

Two scheme Runge-Kutta numerical integrator with adaptive step width. More...

#include <adapt_rk.h>

Inheritance diagram for mio::RKIntegratorCore< FP >:
Collaboration diagram for mio::RKIntegratorCore< FP >:

Public Member Functions

std::unique_ptr< OdeIntegratorCore< FP > > clone () const override
 
 RKIntegratorCore ()
 Setting up the integrator. More...
 
 RKIntegratorCore (const FP abs_tol, const FP rel_tol, const FP dt_min, const FP dt_max)
 Set up the integrator. More...
 
void set_abs_tolerance (FP tol)
 
void set_dt_max (FP dt_max)
 
void set_dt_min (FP dt_min)
 
void set_rel_tolerance (FP tol)
 
void set_tableaus (const Tableau< FP > &tab, const TableauFinal< FP > &final_tab)
 
bool step (const DerivFunction< FP > &f, Eigen::Ref< const Eigen::VectorX< FP >> yt, FP &t, FP &dt, Eigen::Ref< Eigen::VectorX< FP >> ytp1) const override
 Make a single integration step of a system of ODEs and adapt the step size. More...
 
- Public Member Functions inherited from mio::IntegratorCore< FP, Integrands >
 IntegratorCore (const FP &dt_min, const FP &dt_max)
 Initialize an IntegratorCore. More...
 
virtual bool step (const Integrands &... fs, Eigen::Ref< const Eigen::VectorX< FP >> yt, FP &t, FP &dt, Eigen::Ref< Eigen::VectorX< FP >> ytp1) const =0
 Make a single integration step. More...
 
virtual ~IntegratorCore ()
 
FP & get_dt_min ()
 Access lower bound to the step size dt. More...
 
const FP & get_dt_min () const
 Access lower bound to the step size dt. More...
 
FP & get_dt_max ()
 Access upper bound to the step size dt. More...
 
const FP & get_dt_max () const
 Access upper bound to the step size dt. More...
 

Protected Attributes

FP m_abs_tol
 
Eigen::Matrix< FP, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > m_kt_values
 
FP m_rel_tol
 
Tableau< FP > m_tab
 
TableauFinal< FP > m_tab_final
 
Eigen::VectorX< FP > m_yt_eval
 

Private Attributes

Eigen::Array< FP, Eigen::Dynamic, Eigen::Dynamic > m_eps
 
Eigen::Array< FP, Eigen::Dynamic, Eigen::Dynamic > m_error_estimate
 

Detailed Description

template<typename FP>
class mio::RKIntegratorCore< FP >

Two scheme Runge-Kutta numerical integrator with adaptive step width.

This class integrates a system of ODEs via the step method

Constructor & Destructor Documentation

◆ RKIntegratorCore() [1/2]

template<typename FP >
mio::RKIntegratorCore< FP >::RKIntegratorCore ( )
inline

Setting up the integrator.

◆ RKIntegratorCore() [2/2]

template<typename FP >
mio::RKIntegratorCore< FP >::RKIntegratorCore ( const FP  abs_tol,
const FP  rel_tol,
const FP  dt_min,
const FP  dt_max 
)
inline

Set up the integrator.

Parameters
abs_tolabsolute tolerance
rel_tolrelative tolerance
dt_minlower bound for time step dt
dt_maxupper bound for time step dt

Member Function Documentation

◆ clone()

template<typename FP >
std::unique_ptr<OdeIntegratorCore<FP> > mio::RKIntegratorCore< FP >::clone ( ) const
inlineoverridevirtual

◆ set_abs_tolerance()

template<typename FP >
void mio::RKIntegratorCore< FP >::set_abs_tolerance ( FP  tol)
inline
Parameters
tolthe required absolute tolerance for the comparison with the Fehlberg approximation

◆ set_dt_max()

template<typename FP >
void mio::RKIntegratorCore< FP >::set_dt_max ( FP  dt_max)
inline
Parameters
dt_maxsets the maximum step size

◆ set_dt_min()

template<typename FP >
void mio::RKIntegratorCore< FP >::set_dt_min ( FP  dt_min)
inline
Parameters
dt_minsets the minimum step size

◆ set_rel_tolerance()

template<typename FP >
void mio::RKIntegratorCore< FP >::set_rel_tolerance ( FP  tol)
inline
Parameters
tolthe required relative tolerance for the comparison with the Fehlberg approximation

◆ set_tableaus()

template<typename FP >
void mio::RKIntegratorCore< FP >::set_tableaus ( const Tableau< FP > &  tab,
const TableauFinal< FP > &  final_tab 
)
inline

◆ step()

template<typename FP >
bool mio::RKIntegratorCore< FP >::step ( const DerivFunction< FP > &  f,
Eigen::Ref< const Eigen::VectorX< FP >>  yt,
FP &  t,
FP &  dt,
Eigen::Ref< Eigen::VectorX< FP >>  ytp1 
) const
inlineoverride

Make a single integration step of a system of ODEs and adapt the step size.

Parameters
[in]ytvalue of y at t, y(t)
[in,out]tcurrent time
[in,out]dtcurrent time step size h=dt
[out]ytp1approximated value y(t+1)

Member Data Documentation

◆ m_abs_tol

template<typename FP >
FP mio::RKIntegratorCore< FP >::m_abs_tol
protected

◆ m_eps

template<typename FP >
Eigen::Array<FP, Eigen::Dynamic, Eigen::Dynamic> mio::RKIntegratorCore< FP >::m_eps
mutableprivate

◆ m_error_estimate

template<typename FP >
Eigen::Array<FP, Eigen::Dynamic, Eigen::Dynamic> mio::RKIntegratorCore< FP >::m_error_estimate
private

◆ m_kt_values

template<typename FP >
Eigen::Matrix<FP, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor> mio::RKIntegratorCore< FP >::m_kt_values
mutableprotected

◆ m_rel_tol

template<typename FP >
FP mio::RKIntegratorCore< FP >::m_rel_tol
protected

◆ m_tab

template<typename FP >
Tableau<FP> mio::RKIntegratorCore< FP >::m_tab
protected

◆ m_tab_final

template<typename FP >
TableauFinal<FP> mio::RKIntegratorCore< FP >::m_tab_final
protected

◆ m_yt_eval

template<typename FP >
Eigen::VectorX<FP> mio::RKIntegratorCore< FP >::m_yt_eval
mutableprotected