![]() |
Stan Math Library
2.15.0
reverse mode automatic differentiation
|
Internal representation of an ODE model object which provides convenient Jacobian functions to obtain gradients wrt to states and parameters. More...
#include <ode_system.hpp>
Public Member Functions | |
ode_system (const F &f, const std::vector< double > theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs) | |
Construct an ODE model with the specified base ODE system, parameters, data, and a message stream. More... | |
void | operator() (double t, const std::vector< double > &y, std::vector< double > &dy_dt) const |
Calculate the RHS of the ODE. More... | |
template<typename Derived1 , typename Derived2 > | |
void | jacobian (double t, const std::vector< double > &y, Eigen::MatrixBase< Derived1 > &dy_dt, Eigen::MatrixBase< Derived2 > &Jy) const |
Calculate the Jacobian of the ODE RHS wrt to states y. More... | |
template<typename Derived1 , typename Derived2 > | |
void | jacobian (double t, const std::vector< double > &y, Eigen::MatrixBase< Derived1 > &dy_dt, Eigen::MatrixBase< Derived2 > &Jy, Eigen::MatrixBase< Derived2 > &Jtheta) const |
Calculate the Jacobian of the ODE RHS wrt to states y and parameters theta. More... | |
Internal representation of an ODE model object which provides convenient Jacobian functions to obtain gradients wrt to states and parameters.
Can be used to provide analytic Jacobians via partial template specialisation.
F | type of functor for the base ode system. |
Definition at line 21 of file ode_system.hpp.
|
inline |
Construct an ODE model with the specified base ODE system, parameters, data, and a message stream.
[in] | f | the base ODE system functor. |
[in] | theta | parameters of the ode. |
[in] | x | real data. |
[in] | x_int | integer data. |
[in] | msgs | stream to which messages are printed. |
Definition at line 39 of file ode_system.hpp.
|
inline |
Calculate the Jacobian of the ODE RHS wrt to states y.
The function expects the output objects to have correct sizes, i.e. dy_dt must be length N and Jy a NxN matrix (N states).
[in] | t | time. |
[in] | y | state of the ode system at time t. |
[out] | dy_dt | ODE RHS |
[out] | Jy | Jacobian of ODE RHS wrt to y. |
Definition at line 67 of file ode_system.hpp.
|
inline |
Calculate the Jacobian of the ODE RHS wrt to states y and parameters theta.
The function expects the output objects to have correct sizes, i.e. dy_dt must be length N, Jy a NxN matrix and Jtheta a NxM matrix (N states, M parameters).
[in] | t | time. |
[in] | y | state of the ode system at time t. |
[out] | dy_dt | ODE RHS |
[out] | Jy | Jacobian of ODE RHS wrt to y. |
[out] | Jtheta | Jacobian of ODE RHS wrt to theta. |
Definition at line 106 of file ode_system.hpp.
|
inline |
Calculate the RHS of the ODE.
[in] | t | time. |
[in] | y | state of the ode system at time t. |
[out] | dy_dt | ODE RHS |
Definition at line 51 of file ode_system.hpp.