![]() |
Stan Math Library
2.20.0
reverse mode automatic differentiation
|
Integrator interface for CVODES' ODE solvers (Adams & BDF methods). More...
#include <cvodes_integrator.hpp>
Public Member Functions | |
cvodes_integrator () | |
template<typename F , typename T_initial , typename T_param , typename T_t0 , typename T_ts > | |
std::vector< std::vector< typename stan::return_type< T_initial, T_param, T_t0, T_ts >::type > > | integrate (const F &f, const std::vector< T_initial > &y0, const T_t0 &t0, const std::vector< T_ts > &ts, const std::vector< T_param > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs, double relative_tolerance, double absolute_tolerance, long int max_num_steps) |
Return the solutions for the specified system of ordinary differential equations given the specified initial state, initial times, times of desired solution, and parameters and data, writing error and warning messages to the specified stream. More... | |
Integrator interface for CVODES' ODE solvers (Adams & BDF methods).
Lmm | ID of ODE solver (1: ADAMS, 2: BDF) |
Definition at line 30 of file cvodes_integrator.hpp.
|
inline |
Definition at line 32 of file cvodes_integrator.hpp.
|
inline |
Return the solutions for the specified system of ordinary differential equations given the specified initial state, initial times, times of desired solution, and parameters and data, writing error and warning messages to the specified stream.
This function is templated to allow the initials to be either data or autodiff variables and the parameters to be data or autodiff variables. The autodiff-based implementation for reverse-mode are defined in namespace stan::math
and may be invoked via argument-dependent lookup by including their headers.
The solver used is based on the backward differentiation formula which is an implicit numerical integration scheme appropiate for stiff ODE systems.
F | type of ODE system function. |
T_initial | type of scalars for initial values. |
T_param | type of scalars for parameters. |
T_t0 | type of scalar of initial time point. |
T_ts | type of time-points where ODE solution is returned. |
[in] | f | functor for the base ordinary differential equation. |
[in] | y0 | initial state. |
[in] | t0 | initial time. |
[in] | ts | times of the desired solutions, in strictly increasing order, all greater than the initial time. |
[in] | theta | parameter vector for the ODE. |
[in] | x | continuous data vector for the ODE. |
[in] | x_int | integer data vector for the ODE. |
[in,out] | msgs | the print stream for warning messages. |
[in] | relative_tolerance | relative tolerance passed to CVODE. |
[in] | absolute_tolerance | absolute tolerance passed to CVODE. |
[in] | max_num_steps | maximal number of admissable steps between time-points |
Definition at line 77 of file cvodes_integrator.hpp.