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 | ( | const F & | f, |
const T_yy & | yy0, | ||
const T_yp & | yp0, | ||
double | t0, | ||
const std::vector< double > & | ts, | ||
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, assuming default controls (relative tol, absolute tol, max number of steps) = (1.e-10, 1.e-10, 1e8).
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 |
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. | |
[in,out] | msgs | the print stream for warning messages |
args | Extra arguments passed unmodified through to DAE right hand side |
ts