Stan Math Library  2.20.0
reverse mode automatic differentiation
Public Member Functions | Public Attributes | List of all members
stan::math::coupled_ode_system< F, double, double > Class Template Reference

coupled_ode_system specialization for for known initial values and known parameters. More...

#include <coupled_ode_system.hpp>

Public Member Functions

 coupled_ode_system (const F &f, const std::vector< double > &y0, const std::vector< double > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs)
 Construct the coupled ode system from the base system function, initial state of the base system, parameters, data and a stream for messages. More...
 
void operator() (const std::vector< double > &y, std::vector< double > &dy_dt, double t) const
 Calculates the derivative of the coupled ode system with respect to time. More...
 
int size () const
 Returns the size of the coupled system. More...
 
std::vector< double > initial_state () const
 Returns the initial state of the coupled system. More...
 

Public Attributes

const F & f_
 
const std::vector< double > & y0_dbl_
 
const std::vector< double > & theta_dbl_
 
const std::vector< double > & x_
 
const std::vector< int > & x_int_
 
const size_t N_
 
const size_t M_
 
const size_t size_
 
std::ostream * msgs_
 

Detailed Description

template<typename F>
class stan::math::coupled_ode_system< F, double, double >

coupled_ode_system specialization for for known initial values and known parameters.

For this case, the coupled ode is the same as the base ode. There are no sensitivity parameters and the size of the coupled ode system is the size of the base ode system.

Template Parameters
Fbase ode system functor. Must provide operator()(double t, std::vector<double> y, std::vector<double> theta, std::vector<double> x, std::vector<int>x_int, std::ostream* msgs)

Definition at line 45 of file coupled_ode_system.hpp.

Constructor & Destructor Documentation

◆ coupled_ode_system()

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

Construct the coupled ode system from the base system function, initial state of the base system, parameters, data and a stream for messages.

Parameters
[in]fbase ode system functor
[in]y0initial state of the base ode
[in]thetaparameters of the base ode
[in]xreal data
[in]x_intinteger data
[in,out]msgsstream for messages

Definition at line 69 of file coupled_ode_system.hpp.

Member Function Documentation

◆ initial_state()

template<typename F >
std::vector<double> stan::math::coupled_ode_system< F, double, double >::initial_state ( ) const
inline

Returns the initial state of the coupled system.

Here, it is identical to base ode state because the initial state is known.

Returns
initial state of the coupled system

Definition at line 115 of file coupled_ode_system.hpp.

◆ operator()()

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

Calculates the derivative of the coupled ode system with respect to time.

Parameters
[in]ycurrent state of the coupled ode. This must be the correct size, N_.
[out]dy_dtpopulated with derivatives of the coupled system evaluated at specified state and time. This vector will be overwritten.
[in]ttime.
Exceptions
exceptionif the system function does not return a derivative vector of the same size as the state vector.

Definition at line 95 of file coupled_ode_system.hpp.

◆ size()

template<typename F >
int stan::math::coupled_ode_system< F, double, double >::size ( ) const
inline

Returns the size of the coupled system.

Returns
size of the coupled system.

Definition at line 107 of file coupled_ode_system.hpp.

Member Data Documentation

◆ f_

template<typename F >
const F& stan::math::coupled_ode_system< F, double, double >::f_

Definition at line 47 of file coupled_ode_system.hpp.

◆ M_

template<typename F >
const size_t stan::math::coupled_ode_system< F, double, double >::M_

Definition at line 53 of file coupled_ode_system.hpp.

◆ msgs_

template<typename F >
std::ostream* stan::math::coupled_ode_system< F, double, double >::msgs_

Definition at line 55 of file coupled_ode_system.hpp.

◆ N_

template<typename F >
const size_t stan::math::coupled_ode_system< F, double, double >::N_

Definition at line 52 of file coupled_ode_system.hpp.

◆ size_

template<typename F >
const size_t stan::math::coupled_ode_system< F, double, double >::size_

Definition at line 54 of file coupled_ode_system.hpp.

◆ theta_dbl_

template<typename F >
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::theta_dbl_

Definition at line 49 of file coupled_ode_system.hpp.

◆ x_

template<typename F >
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::x_

Definition at line 50 of file coupled_ode_system.hpp.

◆ x_int_

template<typename F >
const std::vector<int>& stan::math::coupled_ode_system< F, double, double >::x_int_

Definition at line 51 of file coupled_ode_system.hpp.

◆ y0_dbl_

template<typename F >
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::y0_dbl_

Definition at line 48 of file coupled_ode_system.hpp.


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

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