EulerIntegratorCore< FP > Class Template Reference

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

Simple explicit euler integration y(t+1) = y(t) + h*f(t,y) for ODE y'(t) = f(t,y) More...

#include <euler.h>

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

Public Member Functions

std::unique_ptr< OdeIntegratorCore< FP > > clone () const override
 
 EulerIntegratorCore ()
 
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
 Fixed step width of the integration. 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...
 

Detailed Description

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

Simple explicit euler integration y(t+1) = y(t) + h*f(t,y) for ODE y'(t) = f(t,y)

Template Parameters
FPA floating point type, e.g., ScalarType.

Constructor & Destructor Documentation

◆ EulerIntegratorCore()

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

Member Function Documentation

◆ clone()

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

◆ step()

template<typename FP >
bool mio::EulerIntegratorCore< 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

Fixed step width of the integration.

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