DUECA/DUSIME
PulsedBody.hxx

An example, including subclassing RigidBody and using Runge-Kutta integration to calculate the updates, is given here.

An example, including subclassing RigidBody and using Runge-Kutta integration to calculate the updates, is given here

/* ------------------------------------------------------------------ */
/* item : PulsedBody.hxx
made by : Rene van Paassen
date : 060502
category : header file
description :
changes : 060502 first version
language : C++
copyright : (c) 2016 TUDelft-AE-C&S
copyright : (c) 2022 René van Paassen
license : EUPL-1.2
*/
#ifndef PulsedBody_hxx
#define PulsedBody_hxx
#ifdef PulsedBody_cxx
#endif
#include <RigidBody.hxx>
class PulsedBody: public RigidBody
{
public:
double tau_e;
double dt;
PulsedBody(double dt);
void derivative(VectorE& xd, double dt_offset);
void step();
};
#endif
Helper class for implementing rigid body vehicle simulation.
Eigen::VectorXd Vector
a normal vector, allocates its own storage
Definition: RigidBody.hxx:47
This is an example, using the RigidBody class as basis for implementation of equations of motion.
Definition: PulsedBody.hxx:30
Vector force
For efficiency, auxiliary variable that represents a force vector.
Definition: PulsedBody.hxx:44
RungeKuttaWorkspace workspace
Workspace for the RungeKutta integration.
Definition: PulsedBody.hxx:54
PulsedBody(double dt)
Constructor.
Vector fpoint
Auxiliary variable, vector giving the point where the force is applied.
Definition: PulsedBody.hxx:48
~PulsedBody()
Destructor.
double tau_e
Time constant simulating the "engine" dynamics.
Definition: PulsedBody.hxx:34
Vector gravity
Auxiliary variable, vector giving gravity.
Definition: PulsedBody.hxx:51
void derivative(VectorE &xd, double dt_offset)
Function needed for integration.
double dt
Size of time steps.
Definition: PulsedBody.hxx:37
void step()
Function that does an integration step.
Rigid body dynamics function, calculates derivative of a rigid body, given sum of moments and forces ...
Definition: RigidBody.hxx:108
This defines a "data-pack", with room for workspace for the Runge-Kutta integration.
Definition: integrate_rungekutta.hxx:36
Eigen::Map< Eigen::VectorXd > VectorE
a vector that takes external storage
Definition: integrate_euler.hxx:29
Here a template function for Runge-Kutta integration is defined.