![]() |
Stan Math Library
2.20.0
reverse mode automatic differentiation
|
The coupled_ode_system
template specialization for unknown initial values and known parameters.
More...
#include <coupled_ode_system.hpp>
Public Member Functions | |
coupled_ode_system (const F &f, const std::vector< var > &y0, const std::vector< double > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs) | |
Construct a coupled ode system from the base system function, initial state of the base system, parameters, and a stream for messages. More... | |
void | operator() (const std::vector< double > &z, std::vector< double > &dz_dt, double t) const |
Calculates the derivative of the coupled ode system with respect to 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... | |
Public Attributes | |
const F & | f_ |
const std::vector< var > & | y0_ |
const std::vector< double > & | theta_dbl_ |
const std::vector< double > & | x_ |
const std::vector< int > & | x_int_ |
std::ostream * | msgs_ |
const size_t | N_ |
const size_t | M_ |
const size_t | size_ |
The coupled_ode_system
template specialization for unknown initial values and known parameters.
This coupled ode system has N + N * N states where N is the size of the base ode system.
For the coupled ode system, the first N states are the base system's states: .
The next N states correspond to the sensitivities of the initial conditions with respect to the first base system equation:
for ].
The next N states correspond to the sensitivites with respect to the second base system equation, and so on through the last base system equation.
F | base ode system functor. Must provide operator()(double t, std::vector<var> y, std::vector<double> theta, std::vector<double> x, std::vector<int>x_int, std::ostream* msgs) |
Definition at line 217 of file coupled_ode_system.hpp.
|
inline |
Construct a coupled ode system from the base system function, initial state of the base system, parameters, and a stream for messages.
[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 for messages |
Definition at line 240 of file coupled_ode_system.hpp.
|
inline |
Returns the initial state of the coupled system.
Because the starting state is unknown, the coupled system incorporates the initial conditions as parameters. At the initial time the Jacobian of the integrated function is the identity matrix.
Definition at line 328 of file coupled_ode_system.hpp.
|
inline |
Calculates the derivative of the coupled ode system with respect to time.
This method uses nested autodiff and is not thread safe.
[in] | z | state of the coupled ode syste; this must be size size() |
[out] | dz_dt | a vector of length size() with the derivatives of the coupled system with respect to time |
[in] | t | time |
exception | if the base ode function does not return the expected number of derivatives, N. |
Definition at line 268 of file coupled_ode_system.hpp.
|
inline |
Returns the size of the coupled system.
Definition at line 313 of file coupled_ode_system.hpp.
const F& stan::math::coupled_ode_system< F, var, double >::f_ |
Definition at line 218 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, var, double >::M_ |
Definition at line 225 of file coupled_ode_system.hpp.
std::ostream* stan::math::coupled_ode_system< F, var, double >::msgs_ |
Definition at line 223 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, var, double >::N_ |
Definition at line 224 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, var, double >::size_ |
Definition at line 226 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, var, double >::theta_dbl_ |
Definition at line 220 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, var, double >::x_ |
Definition at line 221 of file coupled_ode_system.hpp.
const std::vector<int>& stan::math::coupled_ode_system< F, var, double >::x_int_ |
Definition at line 222 of file coupled_ode_system.hpp.
const std::vector<var>& stan::math::coupled_ode_system< F, var, double >::y0_ |
Definition at line 219 of file coupled_ode_system.hpp.