![]() |
Stan Math Library
2.11.0
reverse mode automatic differentiation
|
The coupled ode system 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, parameters, data and a stream for messages. More... | |
void | operator() (const std::vector< double > &y, std::vector< double > &dy_dt, double t) |
Calculates the derivative of the coupled ode system with respect to the specified state at the specified time using the system state function. More... | |
int | size () const |
Returns the size of the coupled system. More... | |
std::vector< double > | initial_state () |
Returns the initial state of the coupled system, which is identical to the base ODE original state in this implementation because the initial state is known. More... | |
std::vector< std::vector< double > > | decouple_states (const std::vector< std::vector< double > > &y) |
Returns the base portion of the coupled state. 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_ |
The coupled ode system for known initial values and known parameters.
This coupled system does not add anything to the base system used to construct it, but is here for generality of the integration implementation.
F | type of system function for the base ODE system. |
Definition at line 39 of file coupled_ode_system.hpp.
|
inline |
Construct the coupled ODE system from the base system function, initial state, parameters, data and a stream for messages.
[in] | f | base ode system functor. |
[in] | y0 | initial state of the base ode. |
[in] | theta | parameters of the base ode. |
[in] | x | real data. |
[in] | x_int | integer data. |
[in,out] | msgs | print stream. |
Definition at line 63 of file coupled_ode_system.hpp.
|
inline |
Returns the base portion of the coupled state.
In this class's implementation, the coupled system is equivalent to the base system, so this function just returns its input.
y | the vector of the coupled states after solving the ode |
Definition at line 143 of file coupled_ode_system.hpp.
|
inline |
Returns the initial state of the coupled system, which is identical to the base ODE original state in this implementation because the initial state is known.
The return value is a vector of length size() where the first N (base ode system size) parameters are the initial conditions of the base ode system and the rest of the initial conditions is 0.
Definition at line 125 of file coupled_ode_system.hpp.
|
inline |
Calculates the derivative of the coupled ode system with respect to the specified state at the specified time using the system state function.
The derivative vector created is the same length as the length as the state vector.
[in] | y | current state of the coupled ode. |
[out] | dy_dt | populated with derivatives of the coupled system evaluated at specified state and time. |
[in] | t | time. |
exception | if 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.
|
inline |
Returns the size of the coupled system.
Definition at line 109 of file coupled_ode_system.hpp.
const F& stan::math::coupled_ode_system< F, double, double >::f_ |
Definition at line 41 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, double, double >::M_ |
Definition at line 47 of file coupled_ode_system.hpp.
std::ostream* stan::math::coupled_ode_system< F, double, double >::msgs_ |
Definition at line 49 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, double, double >::N_ |
Definition at line 46 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, double, double >::size_ |
Definition at line 48 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::theta_dbl_ |
Definition at line 43 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::x_ |
Definition at line 44 of file coupled_ode_system.hpp.
const std::vector<int>& stan::math::coupled_ode_system< F, double, double >::x_int_ |
Definition at line 45 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::y0_dbl_ |
Definition at line 42 of file coupled_ode_system.hpp.