![]() |
Stan Math Library
2.15.0
reverse mode automatic differentiation
|
The coupled ODE system for known initial values and unknown parameters. More...
#include <coupled_ode_system.hpp>
Public Member Functions | |
coupled_ode_system (const F &f, const std::vector< double > &y0, const std::vector< var > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs) | |
Construct a coupled ODE system with the specified base ODE system, base initial state, parameters, data, and a message stream. More... | |
void | operator() (const std::vector< double > &z, std::vector< double > &dz_dt, double t) const |
Assign the derivative vector with the system derivatives at the specified state and time. More... | |
size_t | 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... | |
std::vector< std::vector< var > > | decouple_states (const std::vector< std::vector< double > > &y) const |
Returns the base ODE system state corresponding to the specified coupled system state. More... | |
Public Attributes | |
const F & | f_ |
const std::vector< double > & | y0_dbl_ |
const std::vector< var > & | theta_ |
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 unknown parameters.
If the base ODE state is size N and there are M parameters, the coupled system has N + N * M states.
The first N states correspond to the base system's N states:
The next M states correspond to the sensitivities of the parameters with respect to the first base system equation:
The final M states correspond to the sensitivities with respect to the second base system equation, etc.
F | type of functor for the base ode system. |
Definition at line 62 of file coupled_ode_system.hpp.
|
inline |
Construct a coupled ODE system with the specified base ODE system, base initial state, parameters, data, and a message stream.
[in] | f | the base ODE system functor. |
[in] | y0 | the 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 | stream to which messages are printed. |
Definition at line 86 of file coupled_ode_system.hpp.
|
inline |
Returns the base ODE system state corresponding to the specified coupled system state.
y | coupled states after solving the ode |
Definition at line 203 of file coupled_ode_system.hpp.
|
inline |
Returns the initial state of the coupled system.
Because the initial values are known, the initial state of the coupled system is the same as the initial state of the base ODE system.
This initial state returned is of size 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 condition elements are 0.
Definition at line 189 of file coupled_ode_system.hpp.
|
inline |
Assign the derivative vector with the system derivatives at the specified state and time.
The input state must be of size size()
, and the output produced will be of the same size.
[in] | z | state of the coupled ode system. |
[out] | dz_dt | populated with the derivatives of the coupled system at the specified state and time. |
[in] | t | time. |
exception | if the system function does not return the same number of derivatives as the state vector size. |
y is the base ODE system state
Definition at line 120 of file coupled_ode_system.hpp.
|
inline |
Returns the size of the coupled system.
Definition at line 172 of file coupled_ode_system.hpp.
const F& stan::math::coupled_ode_system< F, double, var >::f_ |
Definition at line 63 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, double, var >::M_ |
Definition at line 70 of file coupled_ode_system.hpp.
std::ostream* stan::math::coupled_ode_system< F, double, var >::msgs_ |
Definition at line 72 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, double, var >::N_ |
Definition at line 69 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, double, var >::size_ |
Definition at line 71 of file coupled_ode_system.hpp.
const std::vector<var>& stan::math::coupled_ode_system< F, double, var >::theta_ |
Definition at line 65 of file coupled_ode_system.hpp.
const std::vector<double> stan::math::coupled_ode_system< F, double, var >::theta_dbl_ |
Definition at line 66 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, double, var >::x_ |
Definition at line 67 of file coupled_ode_system.hpp.
const std::vector<int>& stan::math::coupled_ode_system< F, double, var >::x_int_ |
Definition at line 68 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, double, var >::y0_dbl_ |
Definition at line 64 of file coupled_ode_system.hpp.