1#ifndef CGMRES__INTEGRATOR_HPP_
2#define CGMRES__INTEGRATOR_HPP_
17template <
typename OCP,
typename StateVectorType,
typename ControlInputVectorType>
23 ocp.eval_f(
t, x,
u,
x1);
39template <
typename OCP,
typename StateVectorType,
typename ControlInputVectorType>
49 ocp.eval_f(
t, x,
u,
k1);
52 x1 = x +
dt * 0.5 * (std::sqrt(2.0)-1.0) *
k1 +
dt*(1.0-(1.0/std::sqrt(2.0))) *
k2;
54 x1 = x -
dt * 0.5 * std::sqrt(2.0) *
k2 +
dt * (1.0+(1.0/std::sqrt(2.0))) *
k3;
56 x1 = x + (
dt/6.0) * (
k1+(2.0-std::sqrt(2.0))*
k2 + (2.0+std::sqrt(2.0))*
k3+
k4);
Definition continuation_gmres.hpp:11
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorX
Alias of Eigen::VectorXd (dynamic-size vector).
Definition types.hpp:43
Eigen::Map< MatrixType > Map
Alias of Eigen::Map.
Definition types.hpp:54
VectorX RK4(const OCP &ocp, const Scalar t, const Scalar dt, const MatrixBase< StateVectorType > &x, const MatrixBase< ControlInputVectorType > &u)
Computes the next state by the 4th-order Runge-Kutta method.
Definition integrator.hpp:40
VectorX ForwardEuler(const OCP &ocp, const Scalar t, const Scalar dt, const MatrixBase< StateVectorType > &x, const MatrixBase< ControlInputVectorType > &u)
Computes the next state by the forward Euler.
Definition integrator.hpp:18
double Scalar
Alias of double.
Definition types.hpp:15