Stan Math Library: stan::math::ode_system< F > Class Template Reference

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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() (const 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 (const 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 (const 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

  F | type of functor for the base ode system.

Definition at line 21 of file ode_system.hpp.

## Constructor & Destructor Documentation

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

## Member Function Documentation

template<typename F>
template<typename Derived1 , typename Derived2 >

void stan::math::ode_system< F >::jacobian | ( | const 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] | 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.

template<typename F>
template<typename Derived1 , typename Derived2 >

void stan::math::ode_system< F >::jacobian | ( | const 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] | 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 107 of file ode_system.hpp.

template<typename F>

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

Calculate the RHS of the ODE.

Parameters

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

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

- stan/math/rev/mat/functor/ode_system.hpp

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