- 3.0.2 core module.
SteppersODEIntDefinitions.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
8 #include <boost/numeric/odeint.hpp>
9 
10 namespace ct {
11 namespace core {
12 namespace internal {
13 /*****************************************************************************
14  * Defining the (explicit) steppers
15  *****************************************************************************/
17 template <size_t STATE_DIM, typename SCALAR = double>
18 using euler_t = boost::numeric::odeint::euler<Eigen::Matrix<SCALAR, STATE_DIM, 1>,
19  SCALAR,
20  Eigen::Matrix<SCALAR, STATE_DIM, 1>,
21  SCALAR,
22  boost::numeric::odeint::vector_space_algebra>;
23 
25 template <size_t STATE_DIM, typename SCALAR = double>
26 using modified_midpoint_t = boost::numeric::odeint::modified_midpoint<Eigen::Matrix<SCALAR, STATE_DIM, 1>,
27  SCALAR,
28  Eigen::Matrix<SCALAR, STATE_DIM, 1>,
29  SCALAR,
30  boost::numeric::odeint::vector_space_algebra>;
31 
33 template <size_t STATE_DIM, typename SCALAR = double>
34 using runge_kutta_4_t = boost::numeric::odeint::runge_kutta4<Eigen::Matrix<SCALAR, STATE_DIM, 1>,
35  SCALAR,
36  Eigen::Matrix<SCALAR, STATE_DIM, 1>,
37  SCALAR,
38  boost::numeric::odeint::vector_space_algebra>;
39 
41 template <size_t STATE_DIM, typename SCALAR = double>
42 using runge_kutta_dopri5_t = boost::numeric::odeint::runge_kutta_dopri5<Eigen::Matrix<SCALAR, STATE_DIM, 1>,
43  SCALAR,
44  Eigen::Matrix<SCALAR, STATE_DIM, 1>,
45  SCALAR,
46  boost::numeric::odeint::vector_space_algebra>;
47 
49 template <size_t STATE_DIM, typename SCALAR = double>
50 using runge_kutta_fehlberg78_t = boost::numeric::odeint::runge_kutta_fehlberg78<Eigen::Matrix<SCALAR, STATE_DIM, 1>,
51  SCALAR,
52  Eigen::Matrix<SCALAR, STATE_DIM, 1>,
53  Time,
54  boost::numeric::odeint::vector_space_algebra>;
55 
57 template <size_t STATE_DIM, typename SCALAR = double>
58 using bulirsch_stoer_t = boost::numeric::odeint::bulirsch_stoer<Eigen::Matrix<SCALAR, STATE_DIM, 1>,
59  SCALAR,
60  Eigen::Matrix<SCALAR, STATE_DIM, 1>,
61  SCALAR,
62  boost::numeric::odeint::vector_space_algebra>;
63 
65 template <size_t STATE_DIM, size_t STEPS, typename SCALAR = double>
66 using adams_bashforth_uncontrolled_t = boost::numeric::odeint::adams_bashforth<STEPS,
67  Eigen::Matrix<SCALAR, STATE_DIM, 1>, // state
68  SCALAR, // typename value
69  Eigen::Matrix<SCALAR, STATE_DIM, 1>, // derivative
70  SCALAR, // typename time
71  boost::numeric::odeint::vector_space_algebra>;
72 
73 /*****************************************************************************
74  * Defining the symplectic steppers
75  *****************************************************************************/
76 
78 template <size_t POS_DIM, size_t VEL_DIM, typename SCALAR = double>
79 using symplectic_rk_t = boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan<Eigen::Matrix<SCALAR, POS_DIM, 1>,
80  Eigen::Matrix<SCALAR, POS_DIM, 1>,
81  SCALAR,
82  Eigen::Matrix<SCALAR, POS_DIM, 1>,
83  Eigen::Matrix<SCALAR, POS_DIM, 1>,
84  SCALAR,
85  boost::numeric::odeint::vector_space_algebra>;
86 
87 // Symplectic euler stepper
88 template <size_t POS_DIM, size_t VEL_DIM, typename SCALAR = double>
89 using symplectic_euler_t = boost::numeric::odeint::symplectic_euler<Eigen::Matrix<SCALAR, POS_DIM, 1>,
90  Eigen::Matrix<SCALAR, POS_DIM, 1>,
91  SCALAR,
92  Eigen::Matrix<SCALAR, POS_DIM, 1>,
93  Eigen::Matrix<SCALAR, POS_DIM, 1>,
94  SCALAR,
95  boost::numeric::odeint::vector_space_algebra>;
96 
97 /*****************************************************************************
98  * Defining the (implicit) steppers
99  *****************************************************************************/
100 // // works only for boost 1.56 or higher
101 //template <size_t STATE_DIM, size_t STEPS>
102 //using adams_bashforth_moulton_uncontrolled_t =
103 // boost::numeric::odeint::adams_bashforth_moulton<
104 // STEPS,
105 // Eigen::Matrix<double, STATE_DIM, 1>, // state
106 // double, // typename value
107 // Eigen::Matrix<double, STATE_DIM, 1>, // derivative
108 // double, // typename time
109 // boost::numeric::odeint::vector_space_algebra> ;
110 
111 } // namespace internal
112 } // namespace core
113 } // namespace ct
boost::numeric::odeint::euler< Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, boost::numeric::odeint::vector_space_algebra > euler_t
Simple Euler stepper.
Definition: SteppersODEIntDefinitions.h:22
CppAD::AD< CppAD::cg::CG< double > > SCALAR
boost::numeric::odeint::symplectic_euler< Eigen::Matrix< SCALAR, POS_DIM, 1 >, Eigen::Matrix< SCALAR, POS_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, POS_DIM, 1 >, Eigen::Matrix< SCALAR, POS_DIM, 1 >, SCALAR, boost::numeric::odeint::vector_space_algebra > symplectic_euler_t
Definition: SteppersODEIntDefinitions.h:95
boost::numeric::odeint::bulirsch_stoer< Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, boost::numeric::odeint::vector_space_algebra > bulirsch_stoer_t
Bulirsch Stoer stepper.
Definition: SteppersODEIntDefinitions.h:62
boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan< Eigen::Matrix< SCALAR, POS_DIM, 1 >, Eigen::Matrix< SCALAR, POS_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, POS_DIM, 1 >, Eigen::Matrix< SCALAR, POS_DIM, 1 >, SCALAR, boost::numeric::odeint::vector_space_algebra > symplectic_rk_t
A symplictic rk type stepper.
Definition: SteppersODEIntDefinitions.h:85
boost::numeric::odeint::runge_kutta_dopri5< Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, boost::numeric::odeint::vector_space_algebra > runge_kutta_dopri5_t
Runge-Kutta Dormand Price 5 stepper.
Definition: SteppersODEIntDefinitions.h:46
boost::numeric::odeint::runge_kutta4< Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, boost::numeric::odeint::vector_space_algebra > runge_kutta_4_t
Runge-Kutta4 stepper.
Definition: SteppersODEIntDefinitions.h:38
boost::numeric::odeint::adams_bashforth< STEPS, Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, boost::numeric::odeint::vector_space_algebra > adams_bashforth_uncontrolled_t
Adams Bashforth stepper.
Definition: SteppersODEIntDefinitions.h:71
boost::numeric::odeint::modified_midpoint< Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, boost::numeric::odeint::vector_space_algebra > modified_midpoint_t
Modified Midpoint stepper.
Definition: SteppersODEIntDefinitions.h:30
boost::numeric::odeint::runge_kutta_fehlberg78< Eigen::Matrix< SCALAR, STATE_DIM, 1 >, SCALAR, Eigen::Matrix< SCALAR, STATE_DIM, 1 >, Time, boost::numeric::odeint::vector_space_algebra > runge_kutta_fehlberg78_t
Runge Kutta Fehlberg 78 stepper.
Definition: SteppersODEIntDefinitions.h:54
double Time
Definition: Time.h:11