![]() |
Stan Math Library
2.8.0
reverse mode automatic differentiation
|
The coupled ode system for unknown intial values and unknown parameters. More...
#include <coupled_ode_system.hpp>
Public Member Functions | |
coupled_ode_system (const F &f, const std::vector< stan::math::var > &y0, const std::vector< stan::math::var > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs) | |
Construct a coupled ODE system with unknown initial value and known parameters, given the base ODE system functor, the initial state of the base ODE, the parameters, data, and an output stream to which to write messages. More... | |
void | operator() (const std::vector< double > &y, std::vector< double > &dy_dt, double t) |
Populates the derivative vector with derivatives of the coupled ODE system state with respect to time evaluated at the specified state and specified time. More... | |
size_t | size () const |
Returns the size of the coupled system. More... | |
std::vector< double > | initial_state () |
Returns the initial state of the coupled system. More... | |
std::vector< std::vector < stan::math::var > > | decouple_states (const std::vector< std::vector< double > > &y) |
Return the basic ODE solutions given the specified coupled system solutions, including the partials versus the parameters encoded in the autodiff results. More... | |
Public Attributes | |
const F & | f_ |
const std::vector < stan::math::var > & | y0_ |
std::vector< double > | y0_dbl_ |
const std::vector < stan::math::var > & | theta_ |
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 unknown intial values and unknown parameters.
The coupled system has N + N * (N + M) states, where N is size of the base ODE state vector and M is the number of parameters.
The first N states correspond to the base system's N states:
The next N+M states correspond to the sensitivities of the initial conditions, then to the parameters with respect to the to the first base system equation:
The next N+M states correspond to the sensitivities with respect to the second base system equation, etc.
If the original ode has a state vector of size N states and a parameter vector of size M, the coupled system has N + N * (N
F | the functor for the base ode system |
Definition at line 495 of file coupled_ode_system.hpp.
|
inline |
Construct a coupled ODE system with unknown initial value and known parameters, given the base ODE system functor, the initial state of the base ODE, the parameters, data, and an output stream to which to write 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 | output stream to which to print messages. |
Definition at line 521 of file coupled_ode_system.hpp.
|
inline |
Return the basic ODE solutions given the specified coupled system solutions, including the partials versus the parameters encoded in the autodiff results.
y | the vector of the coupled states after solving the ode |
Definition at line 652 of file coupled_ode_system.hpp.
|
inline |
Returns the initial state of the coupled system.
Because the initial state is unknown, the coupled system incorporates the initial condition offset from zero as a parameter, and hence the return of this function is a vector of zeros.
Definition at line 640 of file coupled_ode_system.hpp.
|
inline |
Populates the derivative vector with derivatives of the coupled ODE system state with respect to time evaluated at the specified state and specified time.
[in] | y | the current state of the coupled ode system, of size size() . |
[in,out] | dy_dt | populate with the derivatives of the coupled system evaluated at the specified state and time. |
[in] | t | time. |
exception | if the base system does not return a derivative vector of the same size as the state vector. |
Definition at line 558 of file coupled_ode_system.hpp.
|
inline |
Returns the size of the coupled system.
Definition at line 625 of file coupled_ode_system.hpp.
const F& stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::f_ |
Definition at line 496 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::M_ |
Definition at line 504 of file coupled_ode_system.hpp.
std::ostream* stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::msgs_ |
Definition at line 506 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::N_ |
Definition at line 503 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::size_ |
Definition at line 505 of file coupled_ode_system.hpp.
const std::vector<stan::math::var>& stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::theta_ |
Definition at line 499 of file coupled_ode_system.hpp.
std::vector<double> stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::theta_dbl_ |
Definition at line 500 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::x_ |
Definition at line 501 of file coupled_ode_system.hpp.
const std::vector<int>& stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::x_int_ |
Definition at line 502 of file coupled_ode_system.hpp.
const std::vector<stan::math::var>& stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::y0_ |
Definition at line 497 of file coupled_ode_system.hpp.
std::vector<double> stan::math::coupled_ode_system< F, stan::math::var, stan::math::var >::y0_dbl_ |
Definition at line 498 of file coupled_ode_system.hpp.