Background
This chapter is supposed to provide the reader with a brief overview of the mathematical and physical background.
Deriving Equations of Motion
Format
PyMbs translates the description based on bodies, joints and load elements into the following system of differential equations describing the equations of motion:
(1)
where is vector of the generalised positions; is the vector of generalised velocities; is the vector of constraint forces; is the generalised Mass Matrix; is a vector containing all centrifugal and Coriolis forces; comprises all internal and external loads; describes all holonomic constraints.
Currently, PyMbs features an explicit and a recursive scheme to derive the equations of motion. The explicit scheme is best used for small systems with up to four degrees of freedom. It obtains expressions for , , , directly. This code is very compact for small systems but the expressions become extremely long for larger systems. For that reason a recursive scheme has been implemented which exploits the kinematic structure of the system leading to many but simple equations.
Explicit Scheme
The explicit scheme is based on the Newton-Euler-Algorithm and the symbolic calculation capabilities of PyMbs through the use of sympy. Since an exhaustive presentation would go far beyond the scope of this document, only the essential highlights will be discussed.
Given a rigid body which is able to move freely in a three dimensional space, following equations describe the trajectory of its centre of gravity.
(2)
Where and describe the position and the velocity of the centre of gravity with respect to the inertial frame; represents its angular velocity with respect to a body-fixed frame; describes the bodies orientation using Cardan Angles, for example. and are sub matrices of the block diagonal matrix , given by
with being the mass and being the symmetric tensor of inertia. The vector contains centrifugal and Coriolis-forces; comprises all internal and external forces and torques.
Usually, a single body without any constraints will not be sufficient for a model of a technical system. Multiple bodies, connected by joints or governed by constraints are needed. Based on equation (2) one can find a more general description for a system consisting of bodies.
(3)
Although equation (3) looks very similar to equation (2), the definitions of the used symbols does differ
, , , and are generalised in a similar way.
Introducing joints between bodies leads to restrictions of their relative movements for which algebraic constraints can be found
These constraints are ensured by introducing corresponding constraint forces into the equations of motion acting perpendicular to the direction of allowed displacements. Thus equation (3) changes to
(4)
with
where are the Lagrange Multipliers representing a vector of generalised forces.
In many applications, a set of minimal coordinates can be found. They can be characterised by three essential properties
There exist some functions and such that and
All elements of are independent, i.e. they form a basis
All constraints are satisfied by the , i.e.
If exists, the following relations hold for , and its derivatives
(5)
and for , and its derivatives
(6)
Substituting and in equation (4) by the newly found relations, gives
(7)
Multiplication by from the left transforms the equation into the space of the minimal coordinates, eliminating all influences of constraint forces. This is due to the fact that no work is performed by constraint forces since they always act perpendicular to the allowed displacements. Thus equation (7) becomes
(8)
which can be written using the newly introduced variables
(9)
which corresponds to the general equation of motion for multibody systems (1).
Recursive Scheme
Since the explicit scheme is only suitable for small multibody systems an explicit scheme has been implemented. This has been done according to [FS] where a detailed explanation is given. Therefore only the implemented equations will be given here. For each body following information must be provided
Mass:
Inertia:
Position of Centre of Gravity:
Distance to all child bodies =
The underlying assumption is that every joint has exactly one degree of freedom. More complex joints can be obtained through a combination of such simple joints. In general each joint belonging to the body has two parameters:
Axis of Translation:
Axis of Rotation:
The equations are generated in three steps. First there is a forward loop, where all positions and velocities of each body is obtained. Below you find all equations (taken from [FS]) with denoting the current body and denoting its parent body. The index runs over all ancestor bodies.
All values are initialised with except for with denoting the gravity vector.
Second there is a backward loop in which all joint forces are calculated, with denoting all direct successors (child bodies) of the body .
Third, there is another forward loop in which expressions for the generalised accelerations are calculated.
The so found and are the elements of the Mass Matrix and a -Vector which satisfies the following relation
Thus, the form of equation (1) has been achieved.
Explicit Handling of Kinematic Loops
A unique feature of PyMbs is its ability to deal with certain kinematic loops in an explicit manner. This consequently leads to a formulation based on minimal coordinates and thereby to explicit ordinary differential equations without algebraic constraints. The underlying concept shall be presented in this section.
Currently, there are four different kinematic loops implemented as shown in Figure Kinematic loops.
Handling kinematic loops is based on the coordinate partitioning method [WH]. Given the vectors of generalised positions , a set of independent coordinates and a set of dependent coordinates are chosen according to the definitions made in the kinematic loops.
First, an explicit relation between the dependent coordinates and the independent coordinates must be provided for each loop.
Exploiting the (usually much simpler) implicit relation
of the loop , corresponding relations on velocity and acceleration level may be derived.
with . The same can be achieved for finding a relationship on acceleration level.
(10)
with . Thus, the equations the equations of motion can be reduced even further, so that they only need to be solved for the set of independent coordinates. Equation (1) may be rewritten using equation (10).
Multiplying this equation with from the left yields
(11)
with ; ; . Clearly, equation (11) has the form of (1) and is therefore compatible.
In order to implement explicit handling for a new kinematic loop, the following information must be provided:
partitioning of joint coordinates into and
, such that
, , such that and
Note, that saving and directly, although they can be derived from automatically, saves time when assembling a model and leaves room for optimising these expressions towards brevity.
Fisette, P; Samin, J. C.: Symbolic generation of large multibody system dynamic equations using a new semi-explicit Newton/Euler recursive scheme. In: Archive of applied mechanics Vol. 66, No 3. (1996) pp. 187-199
Wehage, R. A.; Hung, E. I.: Generalized coordinate partitioning for dimension reduction in analysis of constrained dynamic systems. I, Mech. Design 134 (1982) pp. 247-255