![]() |
Stan Math Library
2.15.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< var > &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 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 > &z, std::vector< double > &dz_dt, double t) const |
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 () 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 |
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< var > & | y0_ |
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 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 455 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 481 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 598 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 586 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] | z | the current state of the coupled, shifted ode system, of size size() . |
[in,out] | dz_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. |
y is the base ODE system state
Definition at line 515 of file coupled_ode_system.hpp.
|
inline |
Returns the size of the coupled system.
Definition at line 571 of file coupled_ode_system.hpp.
const F& stan::math::coupled_ode_system< F, var, stan::math::var >::f_ |
Definition at line 456 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, var, stan::math::var >::M_ |
Definition at line 464 of file coupled_ode_system.hpp.
std::ostream* stan::math::coupled_ode_system< F, var, stan::math::var >::msgs_ |
Definition at line 466 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, var, stan::math::var >::N_ |
Definition at line 463 of file coupled_ode_system.hpp.
const size_t stan::math::coupled_ode_system< F, var, stan::math::var >::size_ |
Definition at line 465 of file coupled_ode_system.hpp.
const std::vector<var>& stan::math::coupled_ode_system< F, var, stan::math::var >::theta_ |
Definition at line 459 of file coupled_ode_system.hpp.
const std::vector<double> stan::math::coupled_ode_system< F, var, stan::math::var >::theta_dbl_ |
Definition at line 460 of file coupled_ode_system.hpp.
const std::vector<double>& stan::math::coupled_ode_system< F, var, stan::math::var >::x_ |
Definition at line 461 of file coupled_ode_system.hpp.
const std::vector<int>& stan::math::coupled_ode_system< F, var, stan::math::var >::x_int_ |
Definition at line 462 of file coupled_ode_system.hpp.
const std::vector<var>& stan::math::coupled_ode_system< F, var, stan::math::var >::y0_ |
Definition at line 457 of file coupled_ode_system.hpp.
const std::vector<double> stan::math::coupled_ode_system< F, var, stan::math::var >::y0_dbl_ |
Definition at line 458 of file coupled_ode_system.hpp.