template<class _DynamicalSystem>
BipedalLocomotion::ContinuousDynamicalSystem::RK4 class

RK4 implements the runge-kutta 4 integration method.

Template parameters
_DynamicalSystem a class derived from DynamicalSystem

It implements the following equation

\[ x_{k+1} = x_k + \frac{1}{6} \left( k_1 + 2 k_2 + 2 k_3 + k_4 \right) \]

where

\[ \begin{cases} k_1 = f(x_k, u_k, t_k) \\ k_2 = f(x_k + \frac{dt}{2} k_1, u_k, t_k + \frac{dt}{2}) \\ k_3 = f(x_k + \frac{dt}{2} k_2, u_k, t_k + \frac{dt}{2}) \\ k_4 = f(x_k + dt k_3, u_k, t_k + dt) \end{cases} \]

where $x_k$ is the state at time $t_k$ , $u_k$ is the input at time $t_k$ and $dt$ is the sampling time.

Base classes

template<class _Derived>
class FixedStepIntegrator<RK4<_DynamicalSystem>>
Fixed step integrator base class.

Public types

using DynamicalSystem = typename internal::traits<RK4<_DynamicalSystem>>::DynamicalSystem
using State = typename internal::traits<RK4<_DynamicalSystem>>::State
using StateDerivative = typename internal::traits<RK4<_DynamicalSystem>>::StateDerivative

Public functions

auto oneStepIntegration(const std::chrono::nanoseconds& t0, const std::chrono::nanoseconds& dT) -> bool
Integrate one step.

Function documentation

template<class _DynamicalSystem>
bool BipedalLocomotion::ContinuousDynamicalSystem::RK4<_DynamicalSystem>::oneStepIntegration(const std::chrono::nanoseconds& t0, const std::chrono::nanoseconds& dT)

Integrate one step.

Parameters
t0 initial time.
dT sampling time.
Returns true in case of success, false otherwise.