Stan Math Library  2.14.0
reverse mode automatic differentiation
Public Member Functions | List of all members
stan::math::ode_system< F > Class Template Reference

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...
 

Detailed Description

template<typename F>
class stan::math::ode_system< F >

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.

Template Parameters
Ftype of functor for the base ode system.

Definition at line 21 of file ode_system.hpp.

Constructor & Destructor Documentation

§ ode_system()

template<typename F>
stan::math::ode_system< F >::ode_system ( const F &  f,
const std::vector< double >  theta,
const std::vector< double > &  x,
const std::vector< int > &  x_int,
std::ostream *  msgs 
)
inline

Construct an ODE model with the specified base ODE system, parameters, data, and a message stream.

Parameters
[in]fthe base ODE system functor.
[in]thetaparameters of the ode.
[in]xreal data.
[in]x_intinteger data.
[in]msgsstream to which messages are printed.

Definition at line 39 of file ode_system.hpp.

Member Function Documentation

§ jacobian() [1/2]

template<typename F>
template<typename Derived1 , typename Derived2 >
void stan::math::ode_system< F >::jacobian ( double  t,
const std::vector< double > &  y,
Eigen::MatrixBase< Derived1 > &  dy_dt,
Eigen::MatrixBase< Derived2 > &  Jy 
) const
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).

Parameters
[in]ttime.
[in]ystate of the ode system at time t.
[out]dy_dtODE RHS
[out]JyJacobian of ODE RHS wrt to y.

Definition at line 67 of file ode_system.hpp.

§ jacobian() [2/2]

template<typename F>
template<typename Derived1 , typename Derived2 >
void stan::math::ode_system< F >::jacobian ( double  t,
const std::vector< double > &  y,
Eigen::MatrixBase< Derived1 > &  dy_dt,
Eigen::MatrixBase< Derived2 > &  Jy,
Eigen::MatrixBase< Derived2 > &  Jtheta 
) const
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).

Parameters
[in]ttime.
[in]ystate of the ode system at time t.
[out]dy_dtODE RHS
[out]JyJacobian of ODE RHS wrt to y.
[out]JthetaJacobian of ODE RHS wrt to theta.

Definition at line 106 of file ode_system.hpp.

§ operator()()

template<typename F>
void stan::math::ode_system< F >::operator() ( double  t,
const std::vector< double > &  y,
std::vector< double > &  dy_dt 
) const
inline

Calculate the RHS of the ODE.

Parameters
[in]ttime.
[in]ystate of the ode system at time t.
[out]dy_dtODE RHS

Definition at line 51 of file ode_system.hpp.


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

     [ Stan Home Page ] © 2011–2016, Stan Development Team.