Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::arkode_integrator< Table, DenseOutput, F, T_y0, T_t0, T_ts, Args > Class Template Reference

Detailed Description

template<ARKODE_ERKTableID Table, bool DenseOutput, typename F, typename T_y0, typename T_t0, typename T_ts, typename... Args>
class stan::math::arkode_integrator< Table, DenseOutput, F, T_y0, T_t0, T_ts, Args >

Integrator interface for ARKODE's ERKStep explicit adaptive Runge-Kutta solver, using one of ERKStep's built-in embedded Butcher tables.

Step size control is configured to match Boost odeint's controlled_runge_kutta, which this integrator replaced.

Template Parameters
TableID of the built-in ERKStep Butcher table to use, e.g. ARKODE_CASH_KARP_6_4_5 or ARKODE_DORMAND_PRINCE_7_4_5
DenseOutputif true output times are interpolated between steps, otherwise steps are truncated to end on each output time
FType of ODE right hand side
T_y0Type of initial state
T_t0Type of scalar of initial time point
T_tsType of time-points where ODE solution is returned

Definition at line 44 of file arkode_integrator.hpp.

#include <arkode_integrator.hpp>

Public Member Functions

 arkode_integrator (const char *function_name, const F &f, const T_y0 &y0, T_t0 t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const Args &... args)
 Construct arkode_integrator object.
 
 ~arkode_integrator ()
 
std::vector< Eigen::Matrix< T_Return, Eigen::Dynamic, 1 > > operator() ()
 Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... } using ARKODE's ERKStep embedded explicit Runge-Kutta solver with the Butcher table given by Table.
 

Private Types

using T_Return = return_type_t< T_y0, T_t0, T_ts, Args... >
 
using T_y0_t0 = return_type_t< T_y0, T_t0 >
 

Private Member Functions

void rhs (double t, const double y[], double dy_dt[])
 

Static Private Member Functions

static realtype max_norm (N_Vector x, N_Vector w)
 
static int erk_rhs (realtype t, N_Vector y, N_Vector ydot, void *user_data)
 

Private Attributes

const char * function_name_
 
sundials::Context sundials_context_
 
const F & f_
 
const Eigen::Matrix< T_y0_t0, Eigen::Dynamic, 1 > y0_
 
const T_t0 t0_
 
const std::vector< T_ts > & ts_
 
std::tuple< const Args &... > args_tuple_
 
std::ostream * msgs_
 
double relative_tolerance_
 
double absolute_tolerance_
 
long int max_num_steps_
 
coupled_ode_system< F, T_y0_t0, Args... > coupled_system_
 
std::vector< double > coupled_state_
 
std::vector< double > z_
 
std::vector< double > dz_dt_
 
N_Vector nv_state_
 

The documentation for this class was generated from the following file: