Public Member Functions | Private Attributes | List of all members
ergodic_exploration::RungeKutta Class Reference

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_
 

Detailed Description

4th order Runge-Kutta integration

Definition at line 63 of file integrator.hpp.

Constructor & Destructor Documentation

◆ RungeKutta()

ergodic_exploration::RungeKutta::RungeKutta ( double  dt)

Constructor.

Parameters
dt- time step

Definition at line 131 of file integrator.hpp.

Member Function Documentation

◆ solve() [1/2]

template<class ModelT >
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.

Parameters
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
Returns
co-state variable solution

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.

◆ solve() [2/2]

template<class ModelT >
mat ergodic_exploration::RungeKutta::solve ( const ModelT &  model,
const vec &  x0,
const mat &  ut,
double  horizon 
) const

Simulate the dynamics forward in time.

Parameters
model- dynamic model
x0- initial state
ut- control signal (each column is applied at a single time step)
horizon- length of trajectory in time
Returns
trajectory

the boundary condition is not added to the trajectory

Definition at line 136 of file integrator.hpp.

◆ step() [1/2]

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.

Parameters
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
Returns
co-state variable

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.

◆ step() [2/2]

template<class ModelT >
vec ergodic_exploration::RungeKutta::step ( const ModelT &  model,
const vec &  x,
const vec &  u 
) const

Performs one step of RK4 forward in time.

Parameters
model- dynamic model
x- state
u- control
Returns
new state

Definition at line 177 of file integrator.hpp.

Member Data Documentation

◆ dt_

double ergodic_exploration::RungeKutta::dt_
private

Definition at line 128 of file integrator.hpp.


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


ergodic_exploration
Author(s): bostoncleek
autogenerated on Wed Mar 2 2022 00:17:13