![]() |
Stan Math Library
2.20.0
reverse mode automatic differentiation
|
IDAS DAE system that contains informtion on residual equation functor, sensitivity residual equation functor, as well as initial conditions. More...
#include <idas_system.hpp>
Public Types | |
using | scalar_type = typename stan::return_type< Tyy, Typ, Tpar >::type |
using | return_type = std::vector< std::vector< scalar_type > > |
Public Member Functions | |
idas_system (const F &f, const std::vector< int > &eq_id, const std::vector< Tyy > &yy0, const std::vector< Typ > &yp0, const std::vector< Tpar > &theta, const std::vector< double > &x_r, const std::vector< int > &x_i, std::ostream *msgs) | |
Construct IDAS DAE system from initial condition and parameters. More... | |
~idas_system () | |
destructor to deallocate IDAS solution memory and workspace. More... | |
N_Vector & | nv_yy () |
return reference to current N_Vector of unknown variable More... | |
N_Vector & | nv_yp () |
return reference to current N_Vector of derivative variable More... | |
N_Vector & | nv_rr () |
return reference to current N_Vector of residual workspace More... | |
N_Vector & | id () |
return reference to DAE variable IDs More... | |
const std::vector< double > & | yy_val () |
return reference to current solution vector value More... | |
const std::vector< double > & | yp_val () |
return reference to current solution derivative vector value More... | |
const std::vector< Tyy > & | yy0 () const |
return reference to initial condition More... | |
const std::vector< Typ > & | yp0 () const |
return reference to derivative initial condition More... | |
const std::vector< Tpar > & | theta () const |
return reference to parameter More... | |
std::vector< scalar_type > | vars () const |
return a vector of vars for that contains the initial condition and parameters in case they are vars. More... | |
const size_t | n () |
return number of unknown variables More... | |
const size_t | ns () |
return number of sensitivity parameters More... | |
const size_t | n_sys () |
return size of DAE system for primary and sensitivity unknowns More... | |
const size_t | n_par () |
return theta size More... | |
void * | mem () |
return IDAS memory handle More... | |
const F & | f () |
return reference to DAE functor More... | |
IDAResFn | residual () |
return a closure for IDAS residual callback More... | |
void | check_ic_consistency (const double &t0, const double &tol) |
Static Public Attributes | |
static constexpr bool | is_var_yy0 = stan::is_var<Tyy>::value |
static constexpr bool | is_var_yp0 = stan::is_var<Typ>::value |
static constexpr bool | is_var_par = stan::is_var<Tpar>::value |
static constexpr bool | need_sens = is_var_yy0 || is_var_yp0 || is_var_par |
Protected Attributes | |
const F & | f_ |
const std::vector< Tyy > & | yy_ |
const std::vector< Typ > & | yp_ |
std::vector< double > | yy_val_ |
std::vector< double > | yp_val_ |
const std::vector< Tpar > & | theta_ |
const std::vector< double > & | x_r_ |
const std::vector< int > & | x_i_ |
const size_t | N_ |
const size_t | M_ |
const size_t | ns_ |
N_Vector | nv_yy_ |
N_Vector | nv_yp_ |
std::vector< double > | rr_val_ |
N_Vector | nv_rr_ |
N_Vector | id_ |
void * | mem_ |
std::ostream * | msgs_ |
IDAS DAE system that contains informtion on residual equation functor, sensitivity residual equation functor, as well as initial conditions.
This is a base type that is intended to contain common values used by forward sensitivity system.
F | type of functor for DAE residual |
Tyy | scalar type of initial unknown values |
Typ | scalar type of initial unknown's derivative values |
Tpar | scalar type of parameters |
Definition at line 90 of file idas_system.hpp.
using stan::math::idas_system< F, Tyy, Typ, Tpar >::return_type = std::vector<std::vector<scalar_type> > |
Definition at line 118 of file idas_system.hpp.
using stan::math::idas_system< F, Tyy, Typ, Tpar >::scalar_type = typename stan::return_type<Tyy, Typ, Tpar>::type |
Definition at line 117 of file idas_system.hpp.
|
inline |
Construct IDAS DAE system from initial condition and parameters.
[in] | f | DAE residual functor |
[in] | eq_id | array for DAE's variable ID(1 for * derivative variables, 0 for algebraic variables). |
[in] | yy0 | initial condiiton |
[in] | yp0 | initial condiiton for derivatives |
[in] | theta | parameters of the base DAE. |
[in] | x_r | continuous data vector for the DAE. |
[in] | x_i | integer data vector for the DAE. |
[in] | msgs | stream to which messages are printed. |
Definition at line 133 of file idas_system.hpp.
|
inline |
destructor to deallocate IDAS solution memory and workspace.
Definition at line 183 of file idas_system.hpp.
|
inline |
Definition at line 330 of file idas_system.hpp.
|
inline |
return reference to DAE functor
Definition at line 305 of file idas_system.hpp.
|
inline |
return reference to DAE variable IDs
Definition at line 217 of file idas_system.hpp.
|
inline |
return IDAS memory handle
Definition at line 300 of file idas_system.hpp.
|
inline |
return number of unknown variables
Definition at line 280 of file idas_system.hpp.
|
inline |
return theta size
Definition at line 295 of file idas_system.hpp.
|
inline |
return size of DAE system for primary and sensitivity unknowns
Definition at line 290 of file idas_system.hpp.
|
inline |
return number of sensitivity parameters
Definition at line 285 of file idas_system.hpp.
|
inline |
return reference to current N_Vector of residual workspace
Definition at line 210 of file idas_system.hpp.
|
inline |
return reference to current N_Vector of derivative variable
Definition at line 203 of file idas_system.hpp.
|
inline |
return reference to current N_Vector of unknown variable
Definition at line 196 of file idas_system.hpp.
|
inline |
return a closure for IDAS residual callback
Definition at line 310 of file idas_system.hpp.
|
inline |
return reference to parameter
Definition at line 252 of file idas_system.hpp.
|
inline |
return a vector of vars for that contains the initial condition and parameters in case they are vars.
The sensitivity with respect to this vector will be calculated by IDAS.
Definition at line 262 of file idas_system.hpp.
|
inline |
return reference to derivative initial condition
Definition at line 245 of file idas_system.hpp.
|
inline |
return reference to current solution derivative vector value
Definition at line 231 of file idas_system.hpp.
|
inline |
return reference to initial condition
Definition at line 238 of file idas_system.hpp.
|
inline |
return reference to current solution vector value
Definition at line 224 of file idas_system.hpp.
|
protected |
Definition at line 92 of file idas_system.hpp.
|
protected |
Definition at line 107 of file idas_system.hpp.
|
static |
Definition at line 114 of file idas_system.hpp.
|
static |
Definition at line 113 of file idas_system.hpp.
|
static |
Definition at line 112 of file idas_system.hpp.
|
protected |
Definition at line 101 of file idas_system.hpp.
|
protected |
Definition at line 108 of file idas_system.hpp.
|
protected |
Definition at line 109 of file idas_system.hpp.
|
protected |
Definition at line 100 of file idas_system.hpp.
|
static |
Definition at line 115 of file idas_system.hpp.
|
protected |
Definition at line 102 of file idas_system.hpp.
|
protected |
Definition at line 106 of file idas_system.hpp.
|
protected |
Definition at line 104 of file idas_system.hpp.
|
protected |
Definition at line 103 of file idas_system.hpp.
|
protected |
Definition at line 105 of file idas_system.hpp.
|
protected |
Definition at line 97 of file idas_system.hpp.
|
protected |
Definition at line 99 of file idas_system.hpp.
|
protected |
Definition at line 98 of file idas_system.hpp.
|
protected |
Definition at line 94 of file idas_system.hpp.
|
protected |
Definition at line 96 of file idas_system.hpp.
|
protected |
Definition at line 93 of file idas_system.hpp.
|
protected |
Definition at line 95 of file idas_system.hpp.