DUECA/DUSIME
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
integrate_euler.hxx File Reference

Here a template function for Euler integration is defined. More...

Include dependency graph for integrate_euler.hxx:

Classes

class  EulerWorkspace
 This defines a "data-pack", with room for workspace for the Euler integration below. More...
 

Typedefs

typedef Eigen::Map< Eigen::VectorXd > VectorE
 a vector that takes external storage
 

Functions

template<class MOD >
void integrate_euler (MOD &model, EulerWorkspace &ws, double dt)
 This function applies one Euler integration step to the state given in the kinematics argument.
 

Detailed Description

Here a template function for Euler integration is defined.

Function Documentation

◆ integrate_euler()

template<class MOD >
void integrate_euler ( MOD & model,
EulerWorkspace & ws,
double dt )

This function applies one Euler integration step to the state given in the kinematics argument.

The forces, moments and gravitation applied by the forcer are taken into account. Note that Euler integration steps are really simple, and in practice rather coarse. This function is meant to be a reference implementation, normally you would want a more sophisticated integration method like Runge Kutta.

The template parameter needs to stick to the following signature:

class MOD {
// calculate derivative for current time + dt
void derivative(VectorE& xd, double dt);
// return state
const Vector& X() const;
// set state
void setState(const VectorE& newx);
};
Parameters
modelState-carrying object, that can calculate its derivative.
wsWorkspace.
dtTime step of the integration.