Stan Math Library
4.9.0
Automatic Differentiation
|
std::vector< Eigen::Matrix< stan::return_type_t< T_yy, T_yp, T_Args... >, -1, 1 > > stan::math::dae_tol_impl | ( | const char * | func, |
const F & | f, | ||
const T_yy & | yy0, | ||
const T_yp & | yp0, | ||
double | t0, | ||
const std::vector< double > & | ts, | ||
double | rtol, | ||
double | atol, | ||
int64_t | max_num_steps, | ||
std::ostream * | msgs, | ||
const T_Args &... | args | ||
) |
Solve the DAE initial value problem f(t, y, y')=0, y(t0) = yy0, y'(t0)=yp0 at a set of times, { t1, t2, t3, ... } using IDAS.
f
must define an operator() with the signature as: template<typename T_yy, typename T_yp, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_yy, T_yp, T_Args...>, Eigen::Dynamic, 1> operator()(double t, const Eigen::Matrix<T_yy, Eigen::Dynamic, 1>& yy,
const Eigen::Matrix<T_yp, Eigen::Dynamic, 1>& yp,
std::ostream* msgs, const T_Args&... args);
t is the time, yy the vector-valued state, yp the vector-valued state derivative, msgs a stream for error messages, and args the optional arguments passed to the DAE solve function (which are passed through to f
without modification).
F | Type of DAE residual functor |
T_yy0 | Type of initial state |
T_yp0 | Type of initial state derivatives |
T_Args | Types of pass-through parameters |
func | Calling function name (for printing debugging messages) | |
f | DAE residual functor | |
yy0 | Initial state | |
yp0 | Initial state derivatives | |
t0 | Initial time | |
ts | Times at which to solve the DAE at. All values must be sorted and not less than t0. | |
rtol | Relative tolerance passed to IDAS | |
atol | Absolute tolerance passed to IDAS | |
max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
[in,out] | msgs | the print stream for warning messages |
args | Extra arguments passed unmodified through to DAE right hand side |
ts