![]() |
Stan
2.5.0
probability, sampling & optimization
|
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::agrad::var > &y0, const std::vector< stan::agrad::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... | |
| int | 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::agrad::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::agrad::var > & | y0_ |
| std::vector< double > | y0_dbl_ |
| const std::vector < stan::agrad::var > & | theta_ |
| std::vector< double > | theta_dbl_ |
| const std::vector< double > & | x_ |
| const std::vector< int > & | x_int_ |
| const int | N_ |
| const int | M_ |
| const int | 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 506 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 532 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 665 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 653 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 570 of file coupled_ode_system.hpp.
|
inline |
Returns the size of the coupled system.
Definition at line 638 of file coupled_ode_system.hpp.
| const F& stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::f_ |
Definition at line 507 of file coupled_ode_system.hpp.
| const int stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::M_ |
Definition at line 515 of file coupled_ode_system.hpp.
| std::ostream* stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::msgs_ |
Definition at line 517 of file coupled_ode_system.hpp.
| const int stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::N_ |
Definition at line 514 of file coupled_ode_system.hpp.
| const int stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::size_ |
Definition at line 516 of file coupled_ode_system.hpp.
| const std::vector<stan::agrad::var>& stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::theta_ |
Definition at line 510 of file coupled_ode_system.hpp.
| std::vector<double> stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::theta_dbl_ |
Definition at line 511 of file coupled_ode_system.hpp.
| const std::vector<double>& stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::x_ |
Definition at line 512 of file coupled_ode_system.hpp.
| const std::vector<int>& stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::x_int_ |
Definition at line 513 of file coupled_ode_system.hpp.
| const std::vector<stan::agrad::var>& stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::y0_ |
Definition at line 508 of file coupled_ode_system.hpp.
| std::vector<double> stan::math::coupled_ode_system< F, stan::agrad::var, stan::agrad::var >::y0_dbl_ |
Definition at line 509 of file coupled_ode_system.hpp.