4th order Runge-Kutta integration More...
#include <integrator.hpp>
Public Member Functions | |
RungeKutta (double dt) | |
Constructor. More... | |
template<class ModelT > | |
mat | solve (const CoStateFunc &func, const ModelT &model, const vec &rhoT, const mat &xt, const mat &ut, const mat &edx, const mat &bdx, double horizon) const |
Solve the co-state variable backwards in time. More... | |
template<class ModelT > | |
mat | solve (const ModelT &model, const vec &x0, const mat &ut, double horizon) const |
Simulate the dynamics forward in time. More... | |
vec | step (const CoStateFunc &func, const vec &rho, const vec &gdx, const vec &dbar, const mat &fdx) const |
Performs one step of RK4 backwards in time. More... | |
template<class ModelT > | |
vec | step (const ModelT &model, const vec &x, const vec &u) const |
Performs one step of RK4 forward in time. More... | |
Private Attributes | |
double | dt_ |
4th order Runge-Kutta integration
Definition at line 63 of file integrator.hpp.
ergodic_exploration::RungeKutta::RungeKutta | ( | double | dt | ) |
mat ergodic_exploration::RungeKutta::solve | ( | const CoStateFunc & | func, |
const ModelT & | model, | ||
const vec & | rhoT, | ||
const mat & | xt, | ||
const mat & | ut, | ||
const mat & | edx, | ||
const mat & | bdx, | ||
double | horizon | ||
) | const |
Solve the co-state variable backwards in time.
func | - time derivatve of co-state variable |
model | - dynamic model |
rhoT | - co-state variable terminal condition (zero vector) |
xt | - forward porpagated dynamic model trajectory |
ut | - control signal |
edx | - gradient of the ergodic metric for each state in xt |
bdx | - derivatve of barrier function for each state in xt |
horizon | - length of trajectory in time |
co-state is sorted from [t0 tf] no need to index backwards and the boundary condition is not added to the trajectory
Definition at line 155 of file integrator.hpp.
mat ergodic_exploration::RungeKutta::solve | ( | const ModelT & | model, |
const vec & | x0, | ||
const mat & | ut, | ||
double | horizon | ||
) | const |
Simulate the dynamics forward in time.
model | - dynamic model |
x0 | - initial state |
ut | - control signal (each column is applied at a single time step) |
horizon | - length of trajectory in time |
the boundary condition is not added to the trajectory
Definition at line 136 of file integrator.hpp.
vec ergodic_exploration::RungeKutta::step | ( | const CoStateFunc & | func, |
const vec & | rho, | ||
const vec & | gdx, | ||
const vec & | dbar, | ||
const mat & | fdx | ||
) | const |
Performs one step of RK4 backwards in time.
func | - time derivatve of the co-state variable |
rho | - co-state variable |
gdx | - gradient of the ergodic metric |
dbar | - derivatve of barrier function for a state |
fdx | - jacobian of the model with respect to the control |
The robot model is used to compose A = D1[f(x,u)]. The columns of xt, ut, and edx correspond to the state, control, or derivative at a given time.
Definition at line 186 of file integrator.hpp.
vec ergodic_exploration::RungeKutta::step | ( | const ModelT & | model, |
const vec & | x, | ||
const vec & | u | ||
) | const |
Performs one step of RK4 forward in time.
model | - dynamic model |
x | - state |
u | - control |
Definition at line 177 of file integrator.hpp.
|
private |
Definition at line 128 of file integrator.hpp.