Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ ode_bdf_tol_impl()

template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... T_Args, require_eigen_col_vector_t< T_y0 > * = nullptr>
std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > stan::math::ode_bdf_tol_impl ( const char *  function_name,
const F &  f,
const T_y0 &  y0,
const T_t0 &  t0,
const std::vector< T_ts > &  ts,
double  relative_tolerance,
double  absolute_tolerance,
long int  max_num_steps,
std::ostream *  msgs,
const T_Args &...  args 
)

Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... } using the stiff backward differentiation formula BDF solver from CVODES.

f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);

t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).

Template Parameters
FType of ODE right hand side
T_y0Type of initial state
T_t0Type of initial time
T_tsType of output times
T_ArgsTypes of pass-through parameters
Parameters
function_nameCalling function name (for printing debugging messages)
fRight hand side of the ODE
y0Initial state
t0Initial time
tsTimes at which to solve the ODE at. All values must be sorted and not less than t0.
relative_toleranceRelative tolerance passed to CVODES
absolute_toleranceAbsolute tolerance passed to CVODES
max_num_stepsUpper limit on the number of integration steps to take between each output (error if exceeded)
[in,out]msgsthe print stream for warning messages
argsExtra arguments passed unmodified through to ODE right hand side
Returns
Solution to ODE at times ts

Definition at line 53 of file ode_bdf.hpp.