Lecture Notes Multibody Dynamics B - Wb1413 Lecture Notes Multibody Dynamics B - Wb1413
Lecture Notes Multibody Dynamics B - Wb1413 Lecture Notes Multibody Dynamics B - Wb1413
Lecture Notes
Multibody Dynamics B
wb1413 course 1997/1998
lecturer: A. L. Schwab
by: R.Q. van der Linde and A. L. Schwab
Contents
Preface
2 Lagrange Equations
2.1 From force to energy
Example 1
2.2 Active and passive elements
2.3 Impact
Appendix A
Notation
Shorthand form
Symbols
Index notation with Einstein summation convention
References
Multibody Dynamics B – version 1 February 2010 i R. Q. van der Linde, and A. L. Schwab
Preface
In the spring of 1998 one of the attendance of the course was Richard Van Der Linde,
PhD student from Man Machine Systems group. He attendant the course out of interest
for his PhD subject "designing ballistic walking bipeds". In the course of his research he
came to the conclusion that the at the time available computer software for Dynamic
analysis of Multibody systems could not be applied successfully to his problems.
This course filled that gap and Richard was now able to develop his own code. For me
his questions on topics like impact and contact problems resulted in new chapters in the
course. The planned topics on dynamics of flexible multibody systems, the specialty of
our group here in Delft, had to be postponed.
Richard did not only attend the course but he wrote a nice set of lecture notes. I know
from experience that this is the best way to understand new material. My advice to all of
you is to follow Richard's path and make your own notes. These lecture notes can be
used to verify your own.
Finally I would like to thank Richard for his never lasting enthusiasm during the course.
It stimulated me enormously.
A. L. Schwab
A. L. Schwab
Multibody Dynamics B – version 1 February 2010 ii R. Q. van der Linde, and A. L. Schwab
Chapter 1
Newton†-Euler ‡ with constraints
† Woolsthorpe 1642 – Kensington 1727
‡ Basel 1707 - St.Petersburg 1783
We will start this chapter with the derivation of the equations of motion for a system of rigid
bodies interconnected by joints, the so-called multibody dynamics. We will see that deriving
the equations of motion by hand is a time consuming task. We will detect a structure in the
equations. By application of the principle of virtual power and d’Alemberts principle the
structure becomes clear and we can derive the equations of motion in a systematic way.
These equations of motion are the basis for the derivation of the impact equations. In the
last part of this chapter we will pay some attention to methods for the numeric integration of
the equations of motion.
The strategy is: Derivation of the equations of motion by cutting the joints, introduction of
the joint forces on each body and application of the Newton-Euler equations of motion to
every individual rigid body. This is undergraduate stuff; see for instance “Dynamics” by
Meriam & Kraig. Finally we will have to impose the joint constraints on the level of
acceleration of the bodies. The method is illustrated by an example.
Example 1
A double pendulum consists of two rigid bodies and two hinges see Figure 1. Note the
horizontal direction of the gravitational field g. In the right hand side of the Figure the joints
are cut, the joint forces are introduced. Joint forces are internal forces and always come in
pairs. This is what Newton's third law; "the action force and the reaction force are equal in
size and opposite in direction" is about. When we join the bodies again, the joint forces will
disappear.
g
VB
2 m HB
2 m1g m2g
HA
2
1
y m1 VA HB
1 VA
VB
x HA
Multibody Dynamics B - version 3 februari 2011 1-1 R. Q. van der Linde, and A. L. Schwab
Body 1: Newton, the sum of the applied forces equals' mass times acceleration in the two
directions:
H A m1 g H B m1 x1
(vb1.1)
V A V B m1 y1
Body 1: Euler, the sum of the applied moments at the centre of mass equals the moment of
inertia at the centre of mass times the angular acceleration:
H B m 2 g m 2 x 2
V B m 2 y 2 (vb1.2)
H B 2 2
1
sin 2 V B 2 2
1
cos 2 I 2 2
x A/1 x1 1
2 1 cos 1 0
y A/1 y1 1
2 1 sin 1 0
(vb1.3)
x B/1 x B/ 2 x1 1
2 1 cos 1 x 2 1
2 2 cos 2
y B/1 y B/ 2 y1 1
2 1 sin 1 y 2 1
2 2 sin 2
Note that the 6 equations of motion together with the 4 constraint equations result in 6-4=2
degrees of freedom for the system.
Multibody Dynamics B - version 3 februari 2011 1-2 R. Q. van der Linde, and A. L. Schwab
Combination of the equations of motion (vb1.1) and (vb1.2), and the constraint equations
(vb1.4) leads to the mixed set of Differential and Algebraic Equations, the DAE, as:
M A x f z
B 0 f a(x, x ) (vb1.5)
v
, with
M diag(m1 m1 I1 m 2 m 2 I 2 )
x [x1 y1 1 x 2 y 2 2 ]T
f v [H A VA HB VB ]T
f z m1g 0 0 m 2g 0 0
T
1 0 1 0
0 1 0 1
12 1 s1 1
1 c1 1 s1
1
2 1 c1
1
A 2 2
0 0 1 0
0 0 0 1
0 0 12 2 s 2 2 2 c2
1
1 0 2 1 s1
1
0 0 0
0 1 1 c 0 0 0
B 2 1 1
1 0 2 1 s1
1
1 0 12 2 s 2
0 1 2 1 c1 0 1 12 2 c 2
1
12 11 c1
2
12 11 s1
2
a ( x , x )
1 2 c 1 2 c
21 1 1 2 1 12 2 2 2 2
2 11 s1 2 2 2 s 2
With given initial conditions, ( x, x , t ) , these equations (vb1.5) can be solved for the
accelerations and the joint or constraint forces. Note that AT B , this fact and a more
systematic approach to derive the equations of motion is the subject of the next paragraph.
Multibody Dynamics B - version 3 februari 2011 1-3 R. Q. van der Linde, and A. L. Schwab
W x f (1)
Proposition 1:
A mechanical system is in equilibrium if the virtual power is zero for all virtual velocities that satisfy the
constraints.
Adding the inertia terms by way of the d'Alembert forces, df in xdm , to the applied
forces results in the virtual power equation:
We first integrate this virtual power over the volumes of all bodies and since we deal with
rigid bodies, we can discretize our system by the properties in the centre of mass of the
individual bodies. This leads to the discrete form of the virtual power equation:
From now on we will use index notation with Einstein summation convention and comma
donated partial derivatives. This method of notation is explained in Appendix A.
k Dk xi 0, (4a)
where k=1..m, with m constraints and i=1..n, with n the total number of coordinates of the
centre of mass of the rigid bodies. To find the velocities that satisfy the constraints, the
kinematic admissible velocities, we differentiate the constraints (4a) with respect to time and
replace the real velocities x i with the virtual velocities x i , as in
D k ( x i ) d x i
D k ,i x i 0 (4b)
x i dt
These subsidiary conditions are incorporated in the virtual power balance by the Lagrange
multipliers (k), as in
Multibody Dynamics B - version 3 februari 2011 1-4 R. Q. van der Linde, and A. L. Schwab
The virtual velocities are now arbitrary hence we come up with i equilibrium equations:
f i M ij xi k D k ,i (6)
The constraints on the accelerations are found by two times differentiation with respect to
time of the constraints (4a), as in
D k , p x p D k , pq x p x q 0 (7)
We now can combine (8) and (9) into the following DAE
M ij D k ,i x j fi
(8)
D k , j 0 kk k D k , pq x p x q
If we associate the partial differentials or Jacobian of the constraint equations Dk , j with the
. Likewise, the product
matrix D then we can write Dk , j xj as the matrix vector product Dx
Dk ,i k can then be written as DT λ (note how the order of the indices change D into DT ,
more on the index notation and the relation with matrix vector notation can be found in
Appendix A). Now if we compare this to (vb1.5), we see that AT B , which expresses the
close relation between constraint equations and constraint forces.
Multibody Dynamics B - version 3 februari 2011 1-5 R. Q. van der Linde, and A. L. Schwab
Example 2
We will now apply the systematic approach to the double pendulum problem. The
constraints in vector form are
x 1 21 1 c 1
y 1 2 1 s1
1
Dk =0 (vb2.1)
x 1 c x 1 c
1 2 1 1 2 2 2 2
y 1 21 1 s 1 y 2 21 2 s 2
The partial derivatives or jacobian is
1 0 1
2 1 s1 0 0 0
0 1 1 c1 0 0
1
0
Dk , j 2 (vb2.2)
1 0 2 1 s1 1 0 2 2 s 2
1 1
0 1 21 1 c 1 0 1 21 2 c 2
2 1 c1 1
1 2
1
s 2
2 1 1 1
D k , pq x p x q (vb2.3)
1
c 2 21 2 c 2 2 2
2 1 1 1
21 1 s 1 1 2 21 2 s 2 2 2
These can be compared to the results as in (vb1.5). The Lagrange multipliers k can be
interpreted as forces. These forces are dual to the constraints since the product is power.
This makes the interpretation of the Lagrange multipliers quit easy, if for instance the
constraint is a horizontal distance between to bodies then the Lagrange multiplier is the
horizontal force acting on the two bodies. We will look at the equilibrium equations (8) for a
clear interpretation of the Lagrange multipliers and take the static case, i.e. all velocities and
accelerations are zero. The equilibrium equations are now
f i Dk ,i k (vb2.4)
We can write out these equations for the double pendulum in the upright vertical position,
resulting in
fx1 1 0 1 0
1 1
f y1 0 1 0
M 1 21 1 0 1
1 0 2
2
(vb2.5)
fx2 0 0 1 0 3
f y2 0 0 0 1 4
M 2 0 0 1
2 0
2
Multibody Dynamics B - version 3 februari 2011 1-6 R. Q. van der Linde, and A. L. Schwab
Every Langrage multiplier is interpreted by taking a value of one and taking all multipliers
equal to zero. We will draw the free body diagrams for these four cases.
1
½2 1
1 1 1
1
1
1 ½1 1 1
1 1
1 1
Fig. Four force equilibrium systems, the columns of (vb2.5), applied forces drawn, and reaction forces
dashed.
From these figures we conclude that the columns of Dk,i represent applied forces on the
centre of mass of the bodies for which the system is in equilibrium. We can of course
combine these four force vectors by taking different values for k. All other force vectors,
the null space of Dk,i, sets the system in motion.
Active and passive elements can be added to the system via the virtual power equation. We
simple add the virtual power of these elements, the product of a force and a virtual velocity,
on the right-hand side of the virtual power equation. Note that this is the virtual power
stored in the element.
If we have for instance a spring in mind then we can express the elongation in terms of the
coordinates of the centre of mass of the bodies to find the rate of change as in
Multibody Dynamics B - version 3 februari 2011 1-7 R. Q. van der Linde, and A. L. Schwab
Substitution of these virtual rates and velocities in the virtual power equation yields
And with the same reasoning as in 1.2 we come up with the DAE for the system with active
or passive elements included reading
M ij Dk ,i x j f i v Dv ,i
D (12)
k, j 0 kk k Dk , pq x p x q
Note the only difference with (8) being the extra term in the right-hand side and note how
the element force v is transformed via Dv ,i to forces in the centre of mass of the bodies.
Example 3
Consider the system as in the figure below. A rigid body with mass m and moment of inertia
I is hinged to the fixed world in A. In B on the body a spring is connected. The other side of
the spring is fixed to the world in C.
The spring has a free length 0 = and a linear stiffness k.
C
g
k, 0 -
1
/2 y
B
A
x m, I
2
/3
The elongation of the spring expressed in terms of the coordinates of the centre of mass of
the body is
Dv ( x i ) v 0 (vb3.1)
Multibody Dynamics B - version 3 februari 2011 1-8 R. Q. van der Linde, and A. L. Schwab
(x 61 cos )
1
Dv ,i (y 61 sin 21 ) (vb3.2)
v
1 sin (x 1 cos ) 1 cos y( 1 sin 1 )
6 6 6 6 2
These partial derivatives describe the transformation from spring force v to body forces fi.
In the example the coordinates are : x = [ x, y, ] = [ ½, 0, 0]. Substitution of these
coordinates in (vb3.1) and (vb3.2) yields
Dv 61
Dv ,i 45 53 101
The force in the spring is now 61 k , being compression. This force with point of
application is B is transformed via -Dv, i to the centre of mass as can be seen from
cos
1
Dv ,i sin (vb.3.3)
v
sin cos cos sin
y 61 sin 51
where we have used the angle alpha according to tan for compact
x 61 cos
notation. Check these results.
Multibody Dynamics B - version 3 februari 2011 1-9 R. Q. van der Linde, and A. L. Schwab
1.4 Impact
The impact equations can easily be derived from the equations of motion. During an impact,
which we assume takes a very short time, high contact forces will occur. When the time
interval decreases the forces will increase. However the product of these two, the impulse,
will be constant. We define the impulse as the limit case
t
S lim Fdt
t t (13)
t
Energy will be lost during impact in the contact area. Newton reasoned an impact
restoration law that relates the relative velocity before and after impact by a material constant
e as in
e
F RETURN dt
, of
relatieve velocity after impact
(14)
F FORWARD dt relatieve velocity before impact
The amount of dissipated energy is related to e. For e=1 we have energy preservation, a fully
elastic impact, where for e=0 all impact energy is lost and we speak of a fully inelastic impact.
We start we the description of the contact condition, again we the D(x) form so we have
contact for D(x)=0. The relative velocity is now
D c ( x i ) D c ,i x i (15)
Note being the relative distance normal to the contact surface. Newton impact law now
reads
Dc ,i x i e Dc ,i x i (16)
The + and - denote just before and just after the impact. The equations of motion with the
incorporation of the contact forces , we assume that the system is in contact, can be
derived as
M ij x j D k ,i k D v ,i v D c ,i c f i (17)
where Si are the applied impact in the centre of mass of the bodies. All other forces that are
non-impulsive like elastic forces or vicious dampers disappear in the limit case and in this
way have no contribution to the impact equations.
Multibody Dynamics B - version 3 februari 2011 1-10 R. Q. van der Linde, and A. L. Schwab
M ij x j D k , i k D c ,i c S i M ij x j (19)
and together with the constraints and Newton's impact law leads to the complete impact
equations
M ij Dk ,i Dc ,i x j M ij x j S i
T
Dk ,i 0 0 k 0 (20)
DcT,i 0 0 c e Dc ,l xl
from which we can solve the velocities after impact together with the constraint impulses
and the contact impulses during impact. Note the resemblance with the previous derived
DAE's!
Multibody Dynamics B - version 3 februari 2011 1-11 R. Q. van der Linde, and A. L. Schwab
We have shown that the equations of motion of a multibody system can be derived in a
systematic manner. However, these equations still do not tell us about the position and
velocity as a function of time. Therefore we will have to integrate these differential
equations. Due to the complexity of the expressions in the differential equations we usually
cannot integrate them analytically, we will have to use numerical integration schemes.
The first and most simple scheme that comes in mind is a truncated Tayler expansion for the
position and the velocity as in
x( t dt ) x( t ) x ( t )dt
(21)
x ( t dt ) x ( t ) x( t )dt
In the next figure the results are shown for four different values of dt, during a time span of
0.5 seconds.
1.5
dt = 0.1s
1.5
dt = 0.05s
1 1
0.5 0.5
0 0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 0 0.2 0.4 0.6 0.8 1 1.2 1.4
1.5 1.5
dt = 0.02s dt = 0.01s
1 1
0.5 0.5
0 0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 0 0.2 0.4 0.6 0.8 1 1.2 1.4
Fig. Simulation of a double pendulum by a simple numerical integration scheme for a period of 0.5 seconds
where the results for four different stepsizes are shown.
Multibody Dynamics B - version 3 februari 2011 1-12 R. Q. van der Linde, and A. L. Schwab
Note
One would expect that a smaller step size gives more accurate results. However note 1 will
remain since we do not use the constraint self but twice differentiated with respect to time.
This phenomenon is called drift. It would be solved if we could incorporate the constraints
direct on the level of coordinates. These methods will be discussed in chapter 2 and 3.
The techniques for numerical integration of ordinary differential equations are not the
subject of this work. They can be found in many standard textbooks. The mastering of these
techniques is crucial since they can make or break our results, the motion of the multibody
system.
Multibody Dynamics B - version 3 februari 2011 1-13 R. Q. van der Linde, and A. L. Schwab
Chapter 2
Lagrange Equations†
†
Turijn 1736 – Parijs 1813
Instead of describing the position and orientation of every individual body together with the
constraints imposed by the joints on these coordinates we will use a minimum set of
coordinates for which the constraints are inherent fulfilled; the set of independent
generalized coordinates.
f ( x 2 − x1 ) = 1 2 m( x 22 − x12 ) (2)
d ∂T ∂V
+ = fi (3)
dt ∂x i ∂x i
Note the difference in sign between work of a force in general and gravitational work where
the force mg is opposite to the displacement h.
We will now introduce the independent generalized coordinates qi and assume that we can
express the positions and orientations of the centers of mass of all bodies xi in terms of the
generalized coordinates qi as in
∂xi
xi = xi ( q j ) ⇒ x i = q j (4)
∂q j
Multibody Dynamics B – version 1 February 2010 2-1 R. Q. van der Linde, and A. L. Schwab
Multiplying (3) on the left and the right with the partial derivatives from (4) yields
∂x i d ∂T ∂V ∂x i
+ = fi (5)
∂q j dt ∂x i ∂x i ∂q j
The first part in the left hand side can be derived from
d ∂x i ∂T ∂x i d ∂T ∂T d ∂x i
= + (6)
dt ∂q ∂x ∂q dt ∂x ∂x i dt ∂q j
j i j i
The partial derivatives for the coordinates and the velocities are equal by definition and the
time derivative of the partial derivatives equals the partial derivatives of the velocities as in
∂x i ∂x i d ∂x ∂x i
= , en i = (7)
∂q j ∂q j dt ∂q j ∂q j
∂x i d ∂T d ∂x i ∂T ∂T d ∂x i
= − = (8)
∂q j dt ∂x i dt ∂q ∂x ∂x dt
j i i
∂q
j
d ∂T ∂T ∂x i
=
−
dt ∂q j ∂x i ∂q j
d ∂T ∂T
−
dt ∂q j ∂q j
d ∂T ∂T ∂V
− + =Qj (9)
dt ∂q ∂q ∂q j
j j
∂x i
where we have introduced the generalized forces Q j = f i being the energetic duals of
∂q j
the generalized coordinates such that Qj q j is the mechanical power exerted by this force.
Multibody Dynamics B – version 1 February 2010 2-2 R. Q. van der Linde, and A. L. Schwab
Example 1
The first example is a model of a container crane, a pendulum with point mass hanging from
a horizontal moving support. This system has two degrees of freedom, the horizontal
displacement x of the cart and the pendulum angle ϕ.
The generalized coordinates are qj = (x, ϕ) met j=1..2.
x
A g
x
m B
x B = x + sin ϕ
(vb1.1)
y B = − cos ϕ
and the corresponding velocities
∂ xB
x B = q j = x + ϕ cos ϕ
∂q j
(vb1.2)
∂ yB
y B = q j = ϕ sin ϕ
∂q j
With the kinetic energy of the system (only one point mass)
(
T = 1 2 m x B + y B
2 2
) (vb1.3)
(
T = 1 2 m x 2 + 2x ϕ cos ϕ + 2ϕ 2 ) (vb1.4)
Multibody Dynamics B – version 1 February 2010 2-3 R. Q. van der Linde, and A. L. Schwab
Plugging in these expressions (vb1.4) and (vb1.5) in the Lagrange equations (9) leads
automatically to the equations of motion of the system expressed in terms of independent
generalized coordinates. Moreover with the help of symbolic manipulation like MAPLE in
MATLAB this can be done easy and almost error free. Here we will illustrate the derivation
by hand in a step-by-step manner.
The partial derivates of T and V with respect to the generalized coordinates are
∂T 0
=
∂q j − mxϕ sin ϕ
(vb1.8)
∂V 0
=
∂q j mg sin ϕ
Note the mass matrix being singular at ϕ=0+kπ, can you explain this in physical terms?
Multibody Dynamics B – version 1 February 2010 2-4 R. Q. van der Linde, and A. L. Schwab
Springs and dampers can be looked upon as containers of mechanical energy (for a damper
the flow of energy is irreversible), or force elements.
VV ( q j ) = 12 k ∆ 2 (10)
with the stiffness k and the elongation ∆ of the spring. The total potential energy of the
system is now V = VG + VV with VG the gravitation term.
If the force from the element cannot be derived from a potential we can find the
contribution to the equations of motion by comparing the virtual power contributions as in
σ vδεv = Q j δq j (11)
ε v = Dv (q j ) (12)
∂Dv (q j )
δεv = δq j (13)
∂q j
d ∂T ∂T ∂V
− + = Q j − Dv , jσ v (15)
dt ∂q j ∂q j ∂q j
This second form of adding force elements can also be applied to energy sinks or sources
like dampers and motors.
Dk ( q i , t ) = 0 (16)
Multibody Dynamics B – version 1 February 2010 2-5 R. Q. van der Linde, and A. L. Schwab
For this last form of prescribed motion we will derive the equations of motion. We apply the
same techniques as in chapter 1 resulting in the equations of motion
d ∂T ∂T ∂V ∂D
− + = Q j − k λk (17)
dt ∂q j ∂q ∂q ∂q j
j j
with the unknown Lagrange multipliers λk for the driving force from the prescribed motion.
The first term from (17) can be expanded to
∂T ∂ ∂T
d = q + ∂ ∂T q (18)
dt ∂q
j
∂q ∂q
j
∂q ∂q j
∂D k ∂ 2 Dk
q j + q j q i = 0 (19)
∂q j ∂q j ∂q i
M ijDk , j qj Qti − ∂ ∂T q + ∂T − ∂V
=
∂q ∂qi ∂qi ∂qi (20)
0kk λk
Dk , j − Dk ,lm ql qm
∂ ∂T
, with the mass matrix as in M ij = which is actually an elegant way of defining the
∂q j ∂qi
mass matrix in terms of generalized coordinates.
Multibody Dynamics B – version 1 February 2010 2-6 R. Q. van der Linde, and A. L. Schwab
2.3 Impact
To end this chapter we will derive the impact equations from the Lagrange form. There is a
lot of resemblance with the results from chapter 1.
Starting point are the Lagrange equations of motion according to (17). In the case of impact
we have
t+
+ ∫
1. S j = lim
−
Q j dt , the generalized applied impacts.
t →t
t−
+
t
+ ∫
2. lim
−
λc dt = ρ c , the impacts at the contact points.
t →t
t−
t+
∂V
q i− = q i+ ⇒ −lim+
t →t ∫ ∂q i
dt = 0 , forces from a potential are finite and have no contribution.
t−
t+
∂T
3. q i− = q i+ ⇒ −lim+
t →t ∫ ∂q i
dt = 0 , the coordinates do not change during the impact.
t−
With these results we can integrate the equations of motion (17) with respect to time from
t − to t + and take the limit case t − → t + resulting in the impact equations
+ −
∂T ∂T ∂D c
− = S i − ρ i (21)
∂q i ∂q i ∂q i
∂T
= M ( q j )q i
∂q i
Together with Newton's impact law (chapter1 (16)) in terms of the independent coordinates
we can write the set of impact equations as
M ij Dc ,i q +j M ij q −j + Si
= (22)
D
c, j 0 ρ c − e Dc ,l ql−
Multibody Dynamics B – version 1 February 2010 2-7 R. Q. van der Linde, and A. L. Schwab
Chapter 3
A combination of methods; TMT
In chapter 1 we have seen that the dynamic behavior of multibody systems can be derived
from the Newton-Euler equations of motion for a rigid body together with the constraint
equations describing the ideal joints between the bodies. A major disadvantage of this
approach is the numerical trouble we run into if we want to numerically integrate these
DAEs. In chapter 2 we have shown that by choosing independent coordinates we can derive
via the Lagrange equations the equations of motion in terms of these coordinates. These
techniques work fine for small models but if we ran into more complex systems the
symbolic computation of the partial derivatives becomes messy and cumbersome. There is a
place called Walhalla! By going back to the basic ideas as formulated by Lagrange in his
monumental work ``Méchanique analytique'' (1788): independent generalized coordinates,
virtual power and inertia contribution via d'Alembert forces. With these ingredients we can
come up with a method to derive the equations of motion for a multibody system which is
simple, clear, and computational efficient.
According to Newton
∑ f i − M ij x j = 0 (1)
In combination with the virtual velocities yields the virtual power equation
Assume we can express all coordinates of the center of mass of the bodies xi in terms of the
independent generalized coordinates q j by a kinematic transformation Ti as in
xi = Ti ( q j ) (3)
The virtual velocities of the generalized coordinates δq , are independent so every k equation
must be zero as in
Ti , k (∑ fi − M ij xj ) = 0 (6)
Multibody Dynamics B – version 1 February 2010 3-1 R. Q. van der Linde, and A. L. Schwab
The accelerations of the center of mass of the bodies x j can be found from differentiation,
twice, of (4) yielding
Note the transformation from q to x j is identical to the one from q to x j , they are
described by the same Jacobean T j, .
Substitution of (7) and (8) in (6) yields the equations of motion in terms of independent
coordinates
M q = f (10)
We have gained: The transformation T for every body is simple and the terms in the
Jacobean T j, can easily be derived by symbolic computation. The mass matrix is diagonal
and all contributions to the equations of motion can be computed numerically on a body-by-
body basis. The resulting equations of motion can be numerically integrated without much
trouble since the constraints are inherent in the system present via the transformation T.
Multibody Dynamics B – version 1 February 2010 3-2 R. Q. van der Linde, and A. L. Schwab
Adding active or passive elements to the system is done in analogue to chapter 1 section 3.
Add the virtual power of the additional elements to the virtual power balance as in
With the element force σV and the virtual element deformation rate or virtual relative speed
δεv . The relative displacement of the element is expressed in terms of the independent
generalize coordinates as in
ε v = Dv ( xi ) ⇒ εv = Dv ,i ( xi ) x i
Ti , k (∑ f i − M ij xj − Dv ,i ( xi )σ v ) = 0 (12)
Substitution of (8) in (12) and rearranging for the unknown accelerations yields in matrix
vector notation
(T MT) q = T (∑ f − Mg − D σ )
T T T
(13)
with the first order difference matrix D = Dv,i (xi ) of the additional element.
Multibody Dynamics B – version 1 February 2010 3-3 R. Q. van der Linde, and A. L. Schwab
3.3 Impact
The derivation of the impact equations is analogue to the procedure of chapter 1 section 4.
With the additional contact force λc incorporated in the force integral we come up with the
applied impulse as
t+ t+
+ ∫ + ∫
S k = lim
−
Fk d t = lim
−
(Tik M ij xj + Dc , k λc ) d t (14)
t →t t →t
t− t−
Substitution of these results in (14) and incorporation of Newton's impact law (chapter 1,
section 4 (18)) yields the impact equations
Compared to (20) form chapter 1 we note that the reduced mass matrix replaces the mass
matrix and the only constraints are the contact conditions.
Multibody Dynamics B – version 1 February 2010 3-4 R. Q. van der Linde, and A. L. Schwab
Appendix A
Notations
Shorthand notations
cx = cos(x)
sx = sin(x)
Symbols
f = force vector
g = gravitational field strength
g = the vector of convective accelerations
T = Transformation vector
x = coordinate vector
q = generalized independent coordinate vector
m = mass
M = mass matrix
I = rotational inertia
I = inertia tensor
C = spring constant
k = stiffness matrix
κ = viscous damping constant
ν = damping matrix
Multibody Dynamics B – version 1 februari 2010 A-1 R. Q. van der Linde, and A. L. Schwab
Matrix vector equations can be written in a compact and clear way by means of the index
notation with Einstein summation convention. The symbols are no longer bold faced as opposed
to matrix vector notation. For example
f = fi met i=1..n.
If in a product two indices are repeated we assume that we have to sum over this index. The
matrix-vector product y = Ax can be written as
y i = Aij x j with i=1..n and j=1..m, and summation over the index j.
The concept of transpose of a matrix is somewhat harder to spot in the index notation. Assume
we have the following equation f i = D ji s j . Then if we associate the matrix D with Dij the
above equation in matrix-vector form reads f = DT s .
Partial derivates are denoted by the comma operator followed by the appropriate index, like in
∂Ti
= Ti ,k
∂q k
∂ ∂Ti
and = Ti , jk
∂qk ∂q j
This last example is unambiguous as opposed to an impossible matrix vector notation, since we
have to deal with three indices.
Multibody Dynamics B – version 1 februari 2010 A-2 R. Q. van der Linde, and A. L. Schwab
References
Dynamics in general
1. E.T. Whittaker, A treatise on the analytical dynamics of particles and rigid bodies, 4th
edition, Cambridge University Press, Cambridge, 1937.
2. A. Sommerfeld, Vorlesungen ueber theoretische Physik, Band I: Mechanik, Klemm,
Wiesbaden, 1949.
3. G. Hamel, Theoretische Mechanik, Springer-Verlag, Berlin, 1949.
4. L.A. Pars, A treatise on analytical dynamics, Heinemann, London, 1965.
5. C. Lanczos, The variational principles of mechanics, 4th edition, University of Toronto
Press, Toronto, 1970.
6. O. Bottema, Theoretische mechanica, Scheltema & Holkema, Amsterdam, 1970.
7. H. Goldstein, Classical mechanics, 2nd edition, Addison-Wesley, Reading, 1980.
Linear algebra
1. G. Strang, Introduction to applied mathematics, Wellesley-Cambridge press, Wellesley,
1986.
2. G. Strang, Linear algebra and its applications, 3rd edition, Harcourt Brace Jovanovich,
San Diego, 1988.
Multibody System Dynamics, books
1. J. Wittenburg, Dynamics of systems of rigid bodies, Teubner, Stuttgart, 1977.
2. R.E. Roberson, R. Schwertassek, Dynamics of multibody systems, Springer-Verlag,
Berlin, 1986.
3. P.E. Nikravesh, Computer-aided analysis of mechanical systems, Prentice-Hall,
Englewood Cliffs, 1988.
4. E.J. Haug, Computer aided kinematics and dynamics of mechanical systems, Volume I:
Basic methods, Allyn and Bacon, Boston, 1989.
5. A.A. Shabana, Dynamics of multibody systems, Wiley, New York, 1989.
6. W.O. Schiehlen (ed), Multibody systems handbook, Springer-Verlag, Berlin, 1990.
7. R.L. Huston, Multibody dynamics, Butterworth-Heinemann, Stoneham, 1990.
8. M. Geradin, D. Rixen, Mechanical Vibrations, Theory and Application to Structural
Dynamics, Wiley, New York, 1994
9. F.C. Moon, Applied Dynamics, Wiley, New York, 1998.
10. D.T.Greenwood, Advanced Dynamics, Cambridge University Press, 2003.
11. A.A. Shabana, Computational Dynamics, Wiley, New York, 2001.
Multibody System Dynamics, conference proceedings
1. E.J. Haug (ed.), Computer aided analysis and optimization of mechanical system
dynamics, Springer-Verlag, 1984.
2. G. Bianchi, W.O. Schiehlen (eds), Dynamics of multibody systems, Springer-Verlag,
Berlin, 1986.
3. E.J. Haug, R.C. Deyo (eds), Real-time integration methods for mechanical system
simulation, Springer-Verlag, Heidelberg, 1991.
4. W. Schiehlen (ed.), Advanced Multibody System Dynamics, Kluwer Academic Publishers,
Dordrecht, 1993.
5. M.F.O.S. Pereira, J.A.C. Ambrosio (eds), Computer-aided analysis of rigid and flexible
mechanical systems, Kluwer Academic Publishers, Dordrecht, 1994.
Multibody Dynamics B – version 1 februari 2010 A-3 R. Q. van der Linde, and A. L. Schwab
Lecture Notes
Multibody Dynamics B, wb1413
April 9, 2009
Contents
Chapter 7
Numerical Integration of
Ordinary Differential
Equations
or
DT
M ẍ f
= (7.2)
D 0 λ −D2 ẋẋ
q1 = q0 + hq̇0 ,
q̇1 = q̇0 + hq̈0 .
with, q(t0 ) = q0 and q̇(t0 ) = q̇0 . Which we can transform into first order
differential equations by substitution of u = q̇ into (7.4),
M̄u̇ = Q̄(t, q, u).
This lead to a set 0f 2n first order differential equations,
q̇ = u q(t0 ) = q0
(7.5)
u̇ = M̄−1 Q̄(t, q, u) u(t0 ) = u0 ,
which we can write in the standard first order form
q
ẏ = f (t, y) y(t0 ) = y0 with y = . (7.6)
u
Lets look at a simple example, a mass-spring-damper system. The equation of
or Heun’s method.
This method takes a sort of average of f (y′ ) into account. Note that predictor
∗
yn+1 is a normal Euler step. What do we mean by more refined? ⇒ More
accurate results! So lets look at the accuracy of y after one step, the so-called
truncation error. The truncation error ǫ (after one step) for the two methods
follows from the Taylor expansion and are,
Euler ǫ = O h2
Heun ǫ = O h3
Far more important is the error in final result, or the so-called global error.
This global truncation error E is the result after integration over the time-span
t = 0 · · · T , which is the sum of (T /h) local true errors,
T
E= ǫ
h
Euler E = O (h)
Heun E = O h2
These are all order of magnitude things. In practise we usually do not know
the value of this error and sometimes even not know the order of magnitude.
But we can estimate the global error. Lets look at a simple one-dimensional
problem. We assume that the approximate value is
y = ŷ + C1 hp , (7.8)
with the true answer (which we do not know) ŷ and the truncation error C1 hp .
For Euler p = 1 and for Heun p = 2. This equation has two unknows, the true
value ŷ and the coefficients C1 . We can determine these values by integration
the system twice with two different stepsizes. We first integrate from t = 0 to
t = T with step size h , call this result yh . Next, we intergate again from t = 0
to t = T , but now with half the stepsize h/2 and we call this yh/2 . This results
in the following two equations,
yh = ŷ + C1 hp
p
h
yh/2 = ŷ + C1 .
2
From which we can solve ŷ and C1 . But since these are error bounds, plus or
minus, we can only give a global truncation error on our best result yh/2 ,
1
E = |ŷ − yh/2 | = |(y h − yh )| (7.9)
2p − 1 2
So this was accuracy. Far more important is stability, or how do previ-
ous made errors propagate? To investigate this we need a test equation. We
will again look at a simple one-dimensional case and use the most generic and
archetypal differential equation,
ẏ = λy. (7.10)
Which we transform with the Euler identities eiφ = cos φ + i sin φ into sines and
cosines, as
y = ceat (cos (bt) + i sin (bt))
We see that eat gives rise to growing or decaying solutions and that cos (bt) +
i sin (bt) is the oscillating part.
How does this connect to our mechanical systems?
Lets look at the mass-spring-damper system again. The equation of motion is:
mẍ + cẋ + kx = f
Look at the reduced equations for the homogenous solution mẍ + cẋ + kx = 0
and introduce the eigenfrequency ω0 , from ω02 = k/m, the relative damping β,
from 2βω0 = c/m, which results in
ẍ + 2βω0 ẋ + ω02 x = 0.
Transform this second order ODE into 2 first order equations with v = ẋ
ẋ 0 1 x
= (7.11)
v̇ −ω02 −2βω0 v
ẏ = Ay
assume solution of the form y = y0 eλt
(A − λI) y0 = 0 ⇒ |A − λI| = 0
−λ 1
= λ2 + 2βω0 λ + ω02 = 0 (7.12)
−ω02 −λ − 2βω0
p
λ = −β0 ω0 ± 1 − β 2 iω0
λ = a ± bi
Re(λ) → ”Damping” Im(λ) → ”Oscillation”
So now we have an idea what type of motions are descirbed by the test equation
ẏ = λy.
After one numerical integration step we have,
y = ŷ + ǫ,
with ŷ as the true solution and ǫ as the truncation error of the method.
ŷ˙ + ǫ̇ = λ (ŷ + ǫ)
So the true solution ŷ˙ = λŷ leads that the error can propagate:
ǫ̇ = λǫ
Back to the test equation and the Method. Let’s with the Euler method,
yn+1 = yn + hλyn
yn+1 = (1 + hλ) yn
yn+1 = C (hλ) yn
where C (hλ) is called the amplification factor. For the Euler method we have
C (hλ) = (1 + hλ).
For absolute stability C (hλ) < 1, where λ can be complex, like in hλ = a + bi.
So for stability we have to look at |C (hλ)| < 1, which for the Euler method
results in |1 + a + bi| < 1. Definition stable: local errors do not propagate!
Note that hλ = bi is not in the stability region. Euler’s method is unstable for
pure oscillating systems. For example the solution of an undamped pendulum
will become infinity over a period of time.
∗
yn+1 = yn + hλyn
yn+1 = yn + h2 (λyn + λ (yn + hλyn ))
h2 λ2
yn+1 = yn+ hλ hλ
2 yn + 2 yn + 2 yn
1 2
yn+1 = 1 + (hλ) + 2 (hλ) yn
where C (hλ) = 1 + (hλ) + 1
2 (hλ)2 .
z = hλ the condition becomes: 1 + z + 1/2z 2 < 1.
From the figure it is shown that Heun is also unstable for pure oscillating
systems.
k1 = f (tn , yn )
f tn + h2 , yn + h2 k1
k2 =
k3 = f tn + h2 , yn + h2 k2
k4 = f (tn + h, yn + hk3 )
yn+1 = yn + h6 (k1 + 2k2 + 2k3 + k4 )
The local truncation error is ǫ = O h5 and the amplification factor for this
2 3 4
method is: C (λh) = 1 + (hλ) + 1/2 (hλ) + 1/6 (hλ) + 1/24 (hλ) .
This method is stable for pure oscillating systems.
For stability:
hλ < 2.8 and with λ = ω0
q̇ = z
ż = f (t, q, z)
We can write this explicit in a very simple one (Euler 2)
f tn + h2 , qn + h2 zn , zn
k1 =
qn+1 = qn + hzn + 12 h2 k1
zn+1 = zn + hk1
with tn + h/2 is the midpoint and zn not interesting, just pick zn . Note that
only 1 function (k1 ) calls to the differential equation at the midpoint.
ǫ = O h2
ǫ = O h3
To investigate the stability we use as a test equation the simplest second order
equation that of a linear damped oscillatory system.
q̈ + 2βω0 q̇ + ω02 q = 0
and with q̇ = z:
q̇ 0 1 q
= (7.13)
ż −ω02 −2βω0 z
10
In refining our step size we would hit this. So the fatal global error is like:
C2
E = C1 hp +
h
For example Heun’s method we have E = C1 h2 + C2 /h which is shown in Figure
(7.10), or better on a log-log scale in Figure (7.11).
11
Now we expect to be either in the second term or in the third term to be dom-
inant for the error estimate.
Dominant truncation: y = ŷ + C1 hp
Dominant round-off: y = ŷ + C2 /h
Take a number of successive steps with the step sizes h = T /2n and calculate
T =timeperiod (usually start with n = 6 or 8) the differences at two successive
solutions:
Dn = |yn − yn−1 |
RT
where yn is 0
at step size h = T /2n and plot this on a log-log scale.
Figure 7.12: global error of the truncation and round-off effect versus step size
on logarithmic scale
Figure 7.13: global error of the truncation and round-off effect versus step size
on logarithmic scale
12
Figure 7.14: the truncation and round-off error for different integration methods
versus step size on logarithmic scale
13
Accuracy: The local truncation error ǫ = O(h2 ) is the same as for the for-
ward Euler.
ẏ = λy
We came up with:
yn+1 = yn + hλyn+1
And for the error:
ǫn+1 = ǫn + hλǫn+1
1
ǫn+1 = 1−hλ ǫn
|C (hλ)| < 1.
And with λ complex we get:
Even high frequency signals are not blown up! There are higher order implicit
solutions which show the same stability behaviour.
14
ẏ = f (t, y)
15
in the fictive with the interpolated function value. For instance the Lagrange
polynomial for 3 f ’s.
(t + h) t (t + 2h) t (t + 2h) (t + h)
p (t) = f−2 + f−1 + f0
(−h) (−2h) (h) (−h) (2h) (h)
Approximate
R t1 Rh
t0
f (t, y) dt by 0 p (t) dt which is h (5/12f−2 − 16/12f−1 + 23/12f0). Thus
we get yn+1 = yn + h/12 (23fn − 16fn−1 + 5fn−2 ) which is the explicit Adams-
Bashfort method. Now you could make an implicit scheme by adding fn+1 in
the polynomial resulting in:
h
yn+1 = yn + (5fn+1 + 8fn − fn−1 )
12
The implicit Adams-Moulton method.
We do not like Implicit schemes because of the necessary iterations.
h
yn+1 = yn + (9fn+1 + 19fn − 5fn−1 + fn−2 )
24
Now a very popular scheme is the following PECE (Shampine 1975)
p
Predict with A − B order k yn+1
p p
Evaluate the differential equation fn+1 tn+1 , yn+1
Correct with A − M order k + 1 yn+1
Evaluate the differential equations fn+1 (tn+1 , yn+1 )
This scheme uses only 2 future evaluations/step. This is the ode113 solver of
Matlab!
Pro’s:
• Only 2 Function Evaluations/step independent of the order
• Interpolated values of y for ”free”
Con’s:
• Startup is difficult
• Order k > 0 stability decreases
Change of step size h and order k?
Compare this with a carrace in reverse.
16
Figure 7.19: the stability area of the multi step integration method for different
orders
Finally
There are BDF-methods Backward Differentiating made popular by Gear 1971
subscribing DIFSUB. Again we build a Lagrange polynomial but now on
y−3 , y−2 , y−1 , y0 and predict y1 . But where is the differential equation? Dif-
ferentiate the polynomial and set the result being f . For instance for a BDF
with constant step size h and order 2 has the form of:
3 1
y1 − 2y0 + f−1 = hf (t1 yn )
2 2
1 4 2
y1 = − y−1 + y0 + hf (t1 yn )
3 3 3
Again, thus is an implicit scheme, and think of the startup problem. The meth-
ods are unconditionally stable up to order 6. This is ode15s with option BDF.
Most of you will be using the Matlab ode45 or ode23. There is a nice pa-
per by L.F. Shampine and M.W. Reichelt, ”The Matlab ODE Suite” SIAM J.
Sci. Compt., 18(1): 1-22, 1997. I will put the pdf-file on the website. (Note
some options have changed in time!)
17
Before we start let’s introduce Auckland New Zealand 1987 the J.C. Butcher
for a s-stage Runge-Kutta method:
yn+1 = yn + hΣsi=1 bi ki
with: ki = f tn + ci h, yn + hΣsj=1 aij kj .
The method is characterised by s, the stages and the coefficients aij , bi and ci .
These coefficients are usually written in the following scheme: Butcher arrays.
c1 a11 · · · a1s
.. .. c A
. . or
cs as1 · · · ass bT
b1 · · · bs
So RK4 looks like
k1 = f (tn , yn ) 0 0 0 0 0
= f tn + h2 , yn + h2 k1 1 1
k2 2 2 0 0 0
1 1
k3 = f tn + h2 , yn + h2 k2 2 0 2 0 0
k4 = f (tn + h, yn + hk3 ) 1 0 0 1 0
1 1 1 1
yn+1 = yn + h6 (k1 + 2k2 + 2k3 + k4 ) 6 3 3 6
0 0 1 1
Forward Euler Backward Euler
1 1
Explicit Methods with second stages, s = 2
0 0 0 0 0 0
1 1
0 ǫ = O h3
1 1 0 Heun but any 2α 2α
1 1
2 2 1−α α
Basis of the RKs-stage methods
ODE y′ = f (y)
Taylor expansion solution is:
h2 ′′ hp
y + · · · + yp + O hp+1
y (t + h) = y (t) + hy′ +
2 p!
Runge-Kutta 2 stage method explicit (hope for ǫ = O h3 )
0 0 0 0 0 0
b2 a21 0 → a a 0
c1 c2 c1 c2
k1 = f (yn ) 0 0 0
k2 = f (yn + ahk1 ) 1 1
0
2α 2α
yn+1 = yn + h (c1 k1 + c2 k2 ) 1−α α
18
Taylor expansion:
2
(ahk1 ) ′′
k2 = f (yn ) + ahk1 f ′ (yn ) + f (yn ) + · · ·
2
3
yn+1 = yn + hc1 f (yn ) + hc2 f (yn ) + hc2 ahk1 f ′ (yn ) + O h
2 ′ 3
yn+1 = yn + h (c1 + c2 ) f (yn ) + h c2 ak1 f (yn ) + O h
h2 ′′
yn + O h3
yn+1 = yn + hyn′ +
2
∂f ∂y
y′′ = = f ′ y′ = f ′ f
∂y ∂t
h (c1 + c2 ) = h c1 + c2 = 1
h2 c2 a = 21 h2 c2 a = 12
2 equations but 3 constants (c1 , c2 , a) so 1 equation missing. Is coming from:
0 0 0
1 1
2α 2α 0
1−α α
Now lets try and connect this to ODE23 (print font 10 batch)
b1 + b2 + b3 = 1 0 0 0 0
b2 c2 + b3 c3 = 12 x x 0 0
ǫ = O h4
b2 c22 + b3 c23 = 13 x x x 0
b3 a32 a21 = 16 x x x
6 coefficients and 4 equations → 2 free parameters a 3rd order method. Max #
coefficients = 0.
0 0 0 0 0 0 0 0
1 1 1 1
3 3 0 0 2 2 0 0
2 2 RK3 3 3 ”ODE23”
3 0 3 0 4 0 4 0
1 3 2 1 4
4 0 4 9 3 9
But when you read closely you see the following Butcher arrays.
1
0 10 0 0 0
2 2 0 0 0
3 3
A= 4
0
4 0 0 = BT hB = h. ∗ B
2 1 4
1 9 3 9 0
5 1 1
− 18 = E T
− 72 12 9
yn+1 = yn + f ∗ hB (:, 3)
f (:, y) = f (yn+1 ) this fy is used for local error estimate.
19
ynew = y + f*hB(:,3);
f(:,4) = feval(ode,tnew,ynew,args:);
stats.nfevals = stats.nfevals + 3;
% Accept the solution only if the weighted error is no more than the toler-
ance rtol. Estimate an h that will yield an error of rtol on the next step or the
next try at taking this step, as the case may be, and use 0.8 of this value to
avoid failures.
if err > rtol % Failed step
% ... cut ...
20
BI = [
1 −4/3 5/9
0 1 −2/3
0 4/3 −8/9
0 −1 1];
s = ((tinterp - t) / h)’; % may be a row vector
yinterp = y(:,ones(length(tinterp),1)) + f*(h*BI)*cumprod(s(ones(3,1),:));
RK3 (”ODE23”)
k1 = f (tn , yn )
= f tn + h2 , yn + h2 k1
k2
k3 = f tn + 3h 3h
4 , yn + 4 k2
yn+1 = yn + h9 (2k1 + k2 + 4k3 )
yn+α = yn + hk1 α − 43 α2 + 5 3
9α +
hk2 α2 − 23 α3 +
hk3 43 α2 − 89 α3 +
hk4 −α2 + α3 +O h4 ??
21
tnew = t + hA(6);
if done
tnew = tfinal; % Hit end point exactly.
end
h = tnew - t; % Purify h.
ynew = y + f*hB(:,6);
f(:,7) = feval(ode,tnew,ynew,args:);
stats.nfevals = stats.nfevals + 6;
% Accept the solution only if the weighted error is no more than the
% tolerance rtol. Estimate an h that will yield an error of rtol on
% the next step or the next try at taking this step, as the case may be,
% and use 0.8 of this value to avoid failures.
if err > rtol % Failed step
% ... cut ...
22
23
Bibliography
24
Lecture Notes
Multibody Dynamics B, wb1413
Contents
Chapter 8
Finding xi = Fi (qj ) for closed loops is not easy. Lets look at for instance at a
four-bar linkage. xi = (x1 , y1 , φ1 , x2 , y2 , φ2 , x3 , y3 , φ3 ) and qi = (α).
Why four-bar?
So we have to write down xi = Fi (qj ).
Lets start,look at the figure above:
So cut the loop at D and add two generalized coordinates β and γ. Next
write down the positions and orientations of the rigid bodies in terms of the
generalized coordinates, x = F(q), where q = (α, β, γ):
And finally we can form the DAE for this problem as,
3{ Fi,l Mij Dc,l q̈k QL + Fi,l (fi − Mij gj )
=
2{ Dc,k 0 λc −Dc,kl q̇k q̇l
qk
From this we solve for q̈k and λc and then we integrate the state like
q̇k
in: Z h
q̃k qk q̇k
˜k = + dt
q̇ q̇k 0 q̈k
˜ n+1 will in general NOT fulfill the
The approximate values at t + h q̃n+1 and q̇
constraints. Remember the results from the 2nd lecture things fly apart, see
Figure 8.3. One can picture the constraints as a sort of surface in a higher
dimensional space, where a state q is represented by points in that space, see
Figure 8.4. The constraint surface has the form D (q) = 0. Now a predicted
solution q̃n+1 will in general not be on the constraint surface. We have to find
a way to get back on the surface with minimal effort. Lets formulate this as a
minimization problem such that the distance from the predicted solution q̃n+1
to the solution which is on the constraint surface is minimal: ||q̃n+1 − qn+1 | |2
is minimal where all qn+1 have to fulfill the constraints D (qn+1 ) = 0
µ = − DDT
−1
e
∆ = DT DDT
−1
e
For an undetermined linear system of equations with full rank matrix D, the
matrix,
D+ = DT DDT
−1
is called the Moove-Penrose pseudo inverse and gives us the least square solution
of the problem.
Example:
x1 = 0.9
x2 − x1 =0
with values x2 = 1
x2 − x3 =0
x3 = 1
The equations are linear so the Jacobian, D, x is simply the matrix,
0.9
−1 1 0
D= x̃ = 1
0 −1 1
1
0.1
Dx̃ = ”errors”
0
x = x̃ + ∆x → Dx̃ + D∆x = 0
D∆x = −Dx̃ → ∆x = D+ (−Dx̃)
D+ = DT DDT
−1
−1 0
−1 1 0 2 −1
DDT = 1 −1 =
0 −1 1 −1 2
0 1
−1 1 2 1
DDT =3
1 2
−2 −1
D+ = DT DDT = 13 1 −1
−1
1 2
−2 −1 0.0666
−0.1
∆x = D+ (−Dx̃) = 13 1 −1 = −0.0333
0
1 2 −0.0333
||∆x| | = 0.0816
0.9 0.0666 0.9666
x = 1 + −0.0333 = 0.9666
1 −0.0333 0.9666
Note that this solution (which is on teh constraint surface) is really at the short-
est distance from the approximate solution (0.9, 1, 1). You can easily come up
with other solutions which are on the surface, like (1, 1, 1), but they are always
farther away (check this).
Bibliography
Lecture Notes
Multibody Dynamics B, wb1413
Contents
Chapter 9
algebraic components are the numbers you put into Matlab when you write a
vector like:
> v =[1;6;-3];
And the ei are just a notation for the vector base. Back to point P , we could
also write p in terms of the body fixed coordinate system e′i , as in
with p′i the algebraic components in the body fixed coordinate system. Now if
B is a rigid body, then the algebraic components p′i are constant!
How do we find the components pi ? If the vector base is an orthogonal base then
the dot-products of the base vectors is ei · ej = δij where δij is the Kronecker
delta, with δij = 1 for i = j and δij = 0 for i ̸= j. By taking the dot product of
p and a base vector ei we get the ith algebraic component, as in
pi = p · ei
But if we use the expression for p in the body fixed base e′i we get
Or expanded for all indices and written out in matrix vector form
′ ′
p1 e1 · e1 e′2 · e1 e′3 · e1 p1
p2 = e′1 · e2 e′2 · e2 e′3 · e2 p′2
p3 e′1 · e3 e′2 · e3 e′3 · e3 p′3
Or, in other words, given the body fixed components p′i of point P we can find
the space fixed components pi from
( )
pi = ei · e′j p′j with i, j = 1 · · · 3
The 9 dot-products of the 2 times 3 base vectors is what we call the Rotation
matrix R = Rij . This rotation matrix transforms the algebraic components
from the body fixed frame to the algebraic components of the space fixed frame,
as in
pi = Rij p′j with Rij = ei · e′j where i, j = 1 · · · 3.
The inverse of Rij follows directly from:
The rotation matrix in 2D can be derived by looking at Figure 9.2 and first
writing down the base vectors,
( ) ( ) ( ) ( )
1 0 cos (ϕ) − sin (ϕ)
e1 = e2 = e′1 = e′2 =
0 1 sin (ϕ) cos (ϕ)
then
( ) ( )
cos (ϕ) − sin (ϕ) −1 cos (ϕ) sin (ϕ)
Rij = ei · e′j = and Rij =
sin (ϕ) cos (ϕ) − sin (ϕ) cos (ϕ)
Start with the space fixed coordinate system and align the body fixed coor-
dinate system with the space fixed system.
1. Rotate with an angle ϕ (phi) about the z-axis.
2. Rotate with an angle θ (theta) about the rotated x-axis.
3. Rotate with an angle ψ (psi) about the rotated z-axis.
Sometimes these Euler angles are called z–x–z or 3–1–3 angles or precession,
rotation and spin angles.
How does the rotation matrix R then look? Well first of all the rotation matrix
R is defined as the transformation of the body fixed coordinates x′ into the
space fixed coordinates x as in,
x = Rx′
Figure 9.3: Euler angles z–x–z denoted by ϕ, θ, ψ depicted by the so-called ”cans
in series” to show the order of rotation.
We can derive this rotation matrix by divide and conquer, i.e. looking at every
individual transformation first and then combining the three, see Figure 9.4.
Figure 9.4: Euler angles z–x–z depicted by cans in series, together with the three
individual rotations ϕ, θ, ψ and corresponding ′′′ , ′′ and ′ coordinate systems.
cos (ϕ) − sin (ϕ) 0
x = Rϕ x′′′ Rϕ = sin (ϕ) cos (ϕ) 0
0 0 1
1 0 0
x′′′ = Rθ x′′ Rθ = 0 cos (θ) − sin (θ)
0 sin (θ) cos (θ)
cos (ψ) − sin (ψ) 0
x′′ = Rψ x′ Rψ = sin (ψ) cos (ψ) 0
0 0 1
Putting everything together:
x = Rϕ Rθ Rψ x′ = Rx′
R =Rϕ Rθ Rψ
cos (ϕ) − sin (ϕ) 0 1 0 0 cos (ψ) − sin (ψ) 0
= sin (ϕ) cos (ϕ) 0 0 cos (θ) − sin (θ) sin (ψ) cos (ψ) 0
0 0 1 0 sin (θ) cos (θ) 0 0 1
cos (ϕ) − sin (ϕ) 0 cos (ψ) − sin (ψ) 0
= sin (ϕ) cos (ϕ) 0 cos (θ) sin (ψ) cos (θ) cos (ψ) − sin (θ)
0 0 1 sin (θ) sin (ψ) sin (θ) cos (ψ) cos (θ)
R=
( )
cos (ϕ) cos (ψ) − sin (ϕ) cos (θ) sin (ψ) − cos (ϕ) sin (ψ) − sin (ϕ) cos (θ) cos (ψ) sin (ϕ) sin (θ)
sin (ϕ) cos (ψ) + cos (ϕ) cos (θ) sin (ψ) − sin (ϕ) sin (ψ) + cos (ϕ) cos (θ) cos (ψ) − cos (ϕ) sin (θ)
sin (θ) sin (ψ) sin (θ) cos (ψ) cos (θ)
Figure 9.5: If Euler angles were vectors the order would not matter as pictured
here in the ”head to head” addition.
xp = xc + xp/c
= xc + Rx′p/c with R = R (ϕ, θ, ψ)
,where the body fixed coordinates x′p/c are constant for a rigid body.
because x′p/c is constant for a rigid body. Now forget about the translation of
the center c and look at velocity of p relative to c,
The velocity on the left-hand side ẋp/c and the coordinates on the right-hand
side x′p/c are defined in two different coordinate systems. We like to express
everything in one coordinate system. Here we now now choose to express ev-
erything in the space fixed one,
We can derive this with help of the identities RRT = I. First differentiate these
with respect to time results in ṘRT + RṘT = 0. Substitute W = ṘRT into
this and we get W + WT = 0, which means that W must be anti-symmetric.
Such an 3 × 3 anti-symmetric matrix has only three independent parameters
and can be written as,
0 −c b
W= c 0 −a .
−b a 0
Why so strange? Because this is the matrix-vector form of the cross product of
two vectors in 3D,
0 −c b x bz − cy a x
c 0 −a y = cx − az = b × y =v×x
−b a 0 z ay − bx c z
Which we can also write by making use of the tilde notation to make this anti-
symmetric matrix out of a vector v as in,
0 −v3 v2
ṽ = v3 0 −v1 ,
−v2 v1 0
making v × x = ṽx.
Back to the velocity expressions ẋp/c = ṘRT xp/c . Next we define this anti-
symmetric matrix ṘRT = ω̃ with the angular velocity vector ω̃ = (ωx , ωy , ωz )
and then rewrite the velocity expressions as,
ẋp/c = ω × xp/c
= ω̃xp/c
Now how do we find ω from ṘRT = ω̃? Just work out the time derivative Ṙ by
first taking the partial derivatives of R with respect to the Euler angles ϕ, θ, ψ
and then these with time, as in,
∂R T ∂R T ∂R T
R ϕ̇ + R θ̇ + R ψ̇ = ω̃
∂ϕ ∂θ ∂ψ
These become lengthy expressions which are error prone. Moreover, since ω̃ is
anti-symmetric we do twice the amount of work necessary. Twice? Even more,
because we also derive three zeros on the diagonal, which actually could be used
for checking the correctness. Anyway, a short-cut is to use ones intuition.
One can add-up up the three angular velocity vectors from the three hinges or
Figure 9.7: Sketch of the three velocity vectors for the three z–x–z Euler angles
ϕ, θ, ψ.
cans in series, as depicted in Figure 9.7. The three individual angular velocity
vectors associated with the three hinges are,
0 θ̇ 0
ωϕ = 0 ωθ = 0 and ωψ = 0 .
ϕ̇ 0 ψ̇
Although Euler angles are not vectors, these angular speeds are vectors. But
note that ωθ and ωψ are not expressed in the global coordinate system. There-
fore we have to transform them accordingly before we can add them up, resulting
in
ω = ωϕ + Rϕ ωθ + Rϕ Rθ ωψ ⇒
0 θ̇ 0
ω = 0 + Rϕ 0 + R ϕ Rθ 0 ⇒
ϕ̇ 0 ψ̇
ωx 0 cos (ϕ) sin (ϕ) sin (θ) ϕ̇
ωy = 0 sin (ϕ) − cos (ϕ) sin (θ) θ̇
ωz 1 0 cos (θ) ψ̇
with the sum of the applied torques ΣM′c , the constant body fixed inertia tensor
J′c , the body fixed angular velocities ω ′ , and the body fixed angular accelerations
ω̇ ′ , all at the centre of mass c and expressed in the body fixed coordinate system
x′ y ′ z ′ .
From this we can solve for the angular accelerations,
−1
ω̇ ′ = (J′c ) (ΣM′c − ω ′ x (J′c ω ′ )) ,
which we can use in a numerical integration scheme to find the angular speed
ω ′ (t) as a function of time,
∫ h
ω ′ (t + h) = ω ′ (t) + ω̇ ′ (t)dt.
0
So much for the angular speed, but how about the orientation of the rigid
body? Here we need the rotation matrix as a function of time, R(t). A
naive approach would be to integrate Ṙ but since these 9 entries have 6 de-
pendance we are likely to get drift. Previously we found a way to parameterize
the rotation matrix, where we used here the three Euler angles ϕ, θ, ψ, that is
R(t) = R(ϕ(t), θ(t), ψ(t)). The development of the Euler angles as a function
of time is found from numerical integration of their time derivatives which can
be found from equation (9.1). In short, the state vector of the orientation of a
rigid body is described by the Euler angles and the angular speeds. Then the
dynamics is described by the time derivative of this state vector,
ϕ ϕ̇
θ θ̇
ψ dState ψ̇
State: ′ →
= ′
ωx′ dt ω̇x
ωy ω̇ ′
y
ωz′ ω̇z′
Figure 9.8: The full state for the orientation of a rigid body.
We call the time derivatives of the state, the state equations. For the Euler
angles the state equations can be found from (9.1), by solving for the Euler
angle rates,
′
ϕ̇ sin (ψ) cos (ψ) 0 ωx
θ̇ = 1 cos (ψ) sin (θ) − sin (ψ) sin (θ) 0 ωy′
sin θ
ψ̇ − sin (ψ) cos (θ) − cos (ψ) cos (θ) sin(θ) ωz′
Note two things. First, the Euler angle rates depend in a nonlinear way on the
Euler angles itself. Second, for sin (θ) = 0 → θ = 0 + kπ the matrix is singular
and we can not solve for the Euler angle rates. Which seems odd. Let us look
Figure 9.9: Singular z–x–z Euler angle configuration, aslo known as Gimbal
lock.
Clearly from these equations we see that they can only be true if ωy′ is zero.
Which we can easily see from the singular configuration depicted in Figure 9.9,
where the middle hinge (θ) aligns the two other hinges and by such confines the
angular speed in the xz-plane. The general solution of the Euler angle rates in
this singular configuration is, θ̇ = ωx′ , ωy′ = 0 and ϕ̇ + ψ̇ = ωz′ . Such a singular
10
Figure 9.10: Avoid the Euler angle singular configuration (Gimbal lock) by
redefining θ = θ − π/2.
ϕ, θ and ψ are not smooth in time anymore. This is very disadvantages for the
process of numerical integration which builds mainly on smooth functions.
Such a rotation is depicted in Figure 9.11, where we used for the rotation axis
the unit vector ĥ and the angle of rotation is µ. A point p′ is transformed by
this rotation into point p. We now would like to find this transformation (the
rotation matrix!) in terms of this axis–angle description. We start by looking
Figure 9.11: Rotation in space about the fixed axis ĥ over an angle µ, where
point p′ is transformed to point p (left), and top view of this rotation (right).
on the top of the cone, Figure 9.11(left) and make an orthogonal coordinate
11
a = ĥ × p′
b =a( × ĥ )
= ĥ × p′ × ĥ
Now express p in terms of p′ with the use of these two orthogonal vectors a and
b and the angle of rotation µ,
p = p′ − (1 − cos (µ)) (
b + sin (µ)a
) ( )
= p′ − (1 − cos (µ)) ĥ × p′ × ĥ + sin (µ) ĥ × p′
( ) ( )
= p′ + (1 − cos (µ)) ĥ × ĥ × p′ + sin (µ) ĥ × p′
Now use,
sin (2α) = 2 sin (α) cos (α)
,
cos (2α) = cos2 (α) − sin2 (α)
to write,
sin (µ) = 2 sin (µ/2) cos (µ/2)
1 − cos (µ) = 2 sin2 (µ/2)
and substitute these in the previous expressions, which results in,
( ( )) ( )
p = p′ + 2 sin2 (µ/2) ĥ × ĥ × p′ + 2 sin (µ/2) cos (µ/2) ĥ × p′ .
Instead of using the unit axis ĥ and angle µ we introduce a new set of parameters,
λ1
λ0 = cos (µ/2) λ = λ2 = sin (µ/2)ĥ ,
λ3
the so-called Euler parameters. These are four parameters, λ0 , λ1 , λ2 and λ3 ,
where we usually write the first as a scalar λ0 , and the last three as a vector λ.
Note that theses four parameters show a dependency, namely since we assume
the axis of rotation ĥ to be a unit vector, the norm of the Euler parameters
should be equal to one,
λ20 + λ21 + λ22 + λ23 = cos2 (µ/2) + sin2 (µ/2) = 1.
This is a constraint we have to impose on the four Euler parameters. That we
have to impose a constrained is obvious since rotation is space can be defined
uniquely by three parameters, ergo one constraint on the four Euler parameters.
Substitution of these Euler parameters into the previous expressions gives us,
p = p′ + 2λ × (λ × p′ ) + 2λ0 (λ × p′ ) .
We can write this in matrix-vector form with the help of the tilde notation for
the vector cross product λ × p′ = λ̃p′ , where
0 −λ3 λ2
λ̃ = λ3 0 −λ1
−λ2 λ1 0
12
resulting in, ( )
p = I + 2λ̃λ̃ + 2λ0 λ̃ p′ .
And since by definition the rotation matrix R describes the transformation from
body fixed to space fixed coordinate system as in,
p = Rp′ ,
we conclude that the rotation matrix in terms of Euler parameters is given by,
( )
R = I + 2λ̃λ̃ + 2λ0 λ̃ .
We know that the inverse R−1 = RT but this can also be found by counter-
rotating or in other words setting µ = −µ. Then the Euler parameters become,
λ0 (−µ) = λ0 (µ) and λ (−µ) = −λ (µ) and we get for the inverse
( )( ) ( )
R−1 = I + 2 −λ̃ −λ̃ + 2λ0 −λ̃
= I + 2λ̃λ̃ − 2λ0 λ̃
This result should be identical to the transpose, as in
( )T
RT = IT + 2 λ̃λ̃ + 2λ0 λ̃T
= I + 2λ̃λ̃ − 2λ0 λ̃
where we used the fact that the transpose of a tilde matrix is its negative,
λ̃T = −λ̃. There are some nice anecdotes on the discovery of Euler parameters,
see f.i. Altmann [1, 2].
Example: We derive the rotation matrix for a rotation about the z-axis over an
angle ϕ. Then, the corresponding Euler parameters are,
0
λ0 = cos ( ϕ2 ) λ = sin ( ϕ2 ) 0 .
1
Substitution into the expressions for the rotation matrix results in,
cos2 ( ϕ2 ) − sin2 ( ϕ2 ) −2 cos ( ϕ2 ) sin ( ϕ2 ) 0
R= 2 cos ( ϕ2 ) sin ( ϕ2 ) cos2 ( ϕ2 ) − sin2 ( ϕ2 ) 0 .
2 ϕ 2 ϕ
0 0 cos ( 2 ) + sin ( 2 )
13
we end up with
cos (ϕ) − sin (ϕ) 0
R = sin (ϕ) cos (ϕ) 0 ,
0 0 1
which is clearly the rotation matrix for a rotation about the z-axis over an angle
ϕ.
But since the Euler parameters have this constraint λi λi = 1, als o the time
derivatives of the Euler parameters are constrained. The corresponding con-
straint equation follows from the time derivative of the constraint, 2λ̇i λi = 0,
which we add as an extra equation to the above, resulting in a full set of four
equations,
λ0 λ1 λ2 λ3 λ̇0 0
−λ1 λ0 −λ3 λ2 λ̇1
2 = ωx
−λ2 λ3 λ0 −λ1 λ̇2 ωy
−λ3 −λ2 λ1 λ0 λ̇3 ωz
Which we can solve for the time derivatives of the Euler parameters, λ̇i , resulting
in,
λ̇0 λ0 −λ1 −λ2 −λ3 0
λ̇1 1 λ1 λ0 λ3 −λ2
ωx
λ̇2 = 2 λ2 −λ3 λ0 λ1 ωy
λ̇3 λ3 λ2 −λ1 λ0 ωz
Note that this is without any singularities, contrary to the expressions of the Eu-
ler angle rate in terms of the Euler angles and the angular velocities. Moreover,
in using Euler parameters we actually never have to calculate sin’s or cos’s.
14
Finally, the expressions for the Euler parameter rates in terms of the Euler
parameters and the body fixed angular velocities ω ′ are found in the same
manner. But we now start from the expressions RT Ṙ = ω̃ ′ (check this yourself).
The final result is then,
λ0 λ1 λ2 λ3 λ̇0 0
−λ1 −λ2 λ̇1 ′
2
λ0 λ3 = ωx′
−λ2 −λ3 λ0 λ1 λ̇2 ωy
−λ3 λ2 −λ1 λ0 λ̇3 ωz′
and,
λ̇0 λ0 −λ1 −λ2 −λ3 0
λ̇1 1 λ1 λ0 −λ3 λ2 ωx′
.
λ̇2 = 2 λ2 λ3 λ0 −λ1 ωy′
λ̇3 λ3 −λ2 λ1 λ0 ωz′
15
Bibliography
[1] S. L. Altmann. Rotations, Quaternions, and Double Groups. Oxford Science Pub-
lications, The Clarendon Press, Oxford University Press, New York, 1986.
[2] S. L. Altmann. Hamilton, rodrigues, and the quaternion scandal. Mathematics
Magazine, 62(5):291–308, 1989.
[3] J. Wittenburg. Dynamics of systems of rigid bodies. Teubner, Stuttgart, 1977.
[4] A. L. Schwab and J. P. Meijaard. How to draw euler angles and utilize euler
parameters. In Proceedings of IDETC/CIE 2006, ASME 2006 International Design
Engineering Technical Conferences & Computers and Information in Engineering
Conference, September 10-13, 2006, Philadelphia, PA, pages 1–7. ASME, New
York, 2006.
16
Lecture Notes
Multibody Dynamics B, wb1413
June 9, 2009
Contents
Chapter 10
Start with some counting to see the number of degrees of freedom in the coor-
dinate space and in the velocity space. The no-slip conditions are conditions
in the velocities which can not be expressed in terms of the coordinates only.
These type of constraints are called nonholonomic, opposed to the regular or
holonomic constraints.
4 bodies → 4 × 6 = 24 coordinates
3 hinges → 3 × 5 = 15 constraints on coordinates, holonomic constraints
2 contact → 2 × 1 = 2 constraints on coordinates, holonomic constraints
points 2×2 = 4 constraints on velocities, nonholonomic constraints
Look at the different bodies and number them. Pick a space fixed coordinate
system O − xyz located at the rear contact point. Label a number of interesting
points A, B, C, · · · .
Newton → Σf = mv̇G
Euler → ΣM0G = J0G ω̇ 0 + ω 0 × (J0G ω 0 )
The state is described by the position and orientation of the centre of mass of
the rigid body (xG , p), where p are either Euler Angles or Cardan Angles or
Euler parameters or · · · , and the velocities of the centre of mass (vG , ω 0 ), where
the angular velocities ω 0 are expressed in the body fixed coordinate system.
For the description of the orientation of the rigid bodies we will use the following
z − x − y or 3-1-2 Euler Angles denoted by p = (φ, θ, ψ), and where the recipe
is given by,
φ rotate about z − axis: heading or yaw
θ rotate about the rotated x − axis: bank or lean
ψ rotate about the rotated y − axis: pitch
but are of course best be depicted by the cans-in-series, see Figure 10.4
Now why this choice? Look at a wheel, Figure 10.5. The yaw motion can
be large so we put this rotation at the end or the beginning, in this case the
beginning. The singular configuration is at a lean angle of θ = ±90o which we
try to avoid in cycling, so that will be the middle hinge.
—————————————————————————————————–
First derive the rotation matrices for this definition and the angular velocities.
x = Rφ Rθ Rψ x0
cos (φ) − sin (φ) 0 1 0 0
with: Rφ = sin (φ) cos (φ) 0 , Rθ = 0 cos (θ) − sin (θ) and
0 0 1
0 sin (θ) cos (θ)0
cos (ψ) 0 sin (ψ)
Rψ = 0 1 0 .
− sin (ψ) 0 cos (ψ)
Figure 10.6: Definition of the rotation matrix and the angular velocities
—————————————————————————————————–
Now the angular velocities in terms of the Euler angles p and their time deriva-
tives ṗ. First for the space fixed angular velocities,
ω = A (p) ṗ
0 θ̇ 0
ω = 0 + Rφ 0 + Rφ Rθ ψ̇
φ̇ 0 0
ωx 0 cos (φ) − sin (φ) cos (θ) φ̇
ωy = 0 sin (φ) cos (φ) cos (θ) θ̇
ωz 1 0 sin (θ) ψ̇
ω = A (p) ṗ
Next the body fixed angular velocities,
ω 0 = A0 (p) ṗ
0 θ̇ 0
ω 0 = ψ̇ + RTψ 0 + RTψ RTθ 0
0 0 φ̇
0
ωx − sin (ψ) cos (θ) cos (ψ) 0 φ̇
ωy0 = sin (θ) 0 1 θ̇
ωz0 cos (ψ) cos (θ) sin (ψ) 0 ψ̇
ω0 = A0 (p) ṗ
−1
ṗ = (A0 (p)) ω0
0
φ̇ − sin (ψ) 0 cos (ψ) ωx
θ̇ = 1 cos (θ) cos (ψ) 0 cos (θ) sin (ψ) ωy0
cos (θ)
ψ̇ sin (θ) sin (ψ) cos (θ) − sin (θ) cos (ψ) ωz0
and next for the velocities, that is the constrained Equations of Motion for the
complete system,
m1 I3 v̇G1 Σf1 ¡ 0 0¢
0
JG ω̇10 ΣM01 − ω10 × JG ω1
1 1
m2 I3 DT v̇G2 Σf2
¡ 0 0¢
0
J G2 ω̇20 ΣM02 − ω20 × JG ω2
2
.. .. ..
. . = .
λ1 :
λ2 :
D : gi
λ21 :
(10.2)
where gi = −D2 (vGi , ωi0 ) (vGi , ωi0 ) ” are the convective terms.
The¡ matrix¢ D is the Jacobian Dh,j from the holonomic constraints ²h =
Dh xGj , pj¡ , and the
¢ Jacobian from the additional nonholonomic constraints,
²̇nh = Dnh ẋGj , ṗj , which are...... wait and see!
10.2 Constraints
Revolute Joint =
2 Points coincide → 3
2 hinge axes parallel → 2
————————————-
Total # of constraints → 5
Velocities:
³ ´ ³ ´
Velocities: ²̇ = v2 + R2 ω20 × x0A/2 − v1 − R1 ω10 × x0A/1
Which we can write in a matrix vector expression by using the tilde matrix for
the cross product.
The matrix R1 x̃0A/1 is the Jacobian of the constraints, ”D”. The constraint on
the accelerations is now:
v̇1
h i ω̇ 0
²̈ = −I R1 x̃0A/1 I −R2 x̃0A/2 1
v̇2 + g
ω̇20
where the convective terms g can be calculated from the state as:
Figure 10.9: Hinge axis being parallel (left), and a bending mode of the hinge
(right).
hinge axis êx1 and êx2 to be parallel or in other words: êx2 ⊥ êy1 and êx2 ⊥ êz1 .
¡ ¢T ¡ ¢
²1 = R1 ê0y1 R2 ê0x2 = ê0T T 0
y1 R1 R2 êx2
¡ ¢T ¡ ¢
²2 = R1 ê0z1 R2 ê0x2 = ê0T T 0
z1 R1 R2 êx2
Velocities: here we use the rule that the time derivative of a unit vector is omega
cross this unit vector, as in ê˙ i = ωi × êi , making
ẋc = ẋG + ω × r
No slip means: ẋc = 0. Actually we
have one holonomic contact condition
zG = r cos (θ),
and the radius vector in the local reference frame, see Figure 10.11,
r sin(ψ)
r0 = 0
−r cos(ψ)
00
we can evaluate ẋc (which is tedious so use Matlab symbolic toolbox or Maple!).
We end up with the linear equations for the velocities of the contact point c in
terms of the coordinates and velocities of the wheel,
ẋ ẏ ż ωx0 ωy0 ωz0
00
ẋ cos (φ) sin (φ) 0 0 −r 0
ẏ 00 = − sin (φ) cos (φ) 0 r cos (θ) cos (ψ) 0 r cos (θ) sin (ψ)
00
ż 0 0 1 r sin (θ) cos (ψ) 0 r sin (θ) sin (ψ)
c
00 00
The last entry, ż , is the holonomic constraint ż = ż + r sin (θ)θ̇ = 0 (Check
−1
this with θ̇ from ṗ = (A0 (p)) ω 0 in terms of ω 0 i.e. θ̇ = cos (ψ)ωx0 +sin (ψ)ωz0 ),
which comes from the holonomic contact condition,
²1 = z − r cos (θ).
00 00
The first two ẋ and ẏ are the two nonholonomic constraints, or no-slip con-
ditions, in the longitudinal and lateral direction of the wheel,
²̇2 = cos (φ)ẋ + sin (φ)ẏ − rωy0 ( longitudinal slip )
²̇3 = − sin (φ)ẋ + cos (φ)ẏ + rωx0 cos (θ) cos (ψ) + rωz0 cos (θ) sin (ψ) ( lateral slip )
Now we only have to find the convective terms for the wheel constraint. First
substitute ω 0 in terms of p and ṗ in the ²̇ equations.
ẋ ẏ ż φ̇ θ̇ ψ̇
²̇1 0 0 1 0 r sin (θ) 0
²̇2 = cos (φ) sin (φ) 0 −r sin (θ) 0 −r
²̇3 − sin (φ) cos (φ) 0 0 r cos (θ) 0
Next differentiate with respect to time, and forget all ¨ terms, this gives us the
convective terms,
g1 r cos (θ)θ̇2
g2 = − sin (φ)ẋφ̇ + cos (φ)ẏ φ̇ − r cos (θ)φ̇θ̇
g3 − cos (φ)ẋφ̇ − sin (φ)ẏ φ̇ − r sin (θ)θ̇2
10
Finally we can use numerical integration on the accelerations from the equations
of motion and on the velocities to find the motion in time. You can use any
method, but I prefer RK4 with a fixed stepsize. This is a fast and accurate
method. The only problem is to find a reasonable stepsize which gives fast and
accurate results. Start with h = 0.01 sec and decrease or increase according to
the results. Use the Coordinate Projection Method to minimize the constraint
errors after each numerical integration step. In this scheme we use the Moore-
Penrose pseudo-inverse D+ of the Jacobian of the constraints D, as in D+ =
¡ ¢−1
DT DDT . Where the Jacobian D = ∂(x∂² i ,pi )
, is the partial derivatives of
the constraints with respect to the state variables xi and pi . This is not equal
to the D which we have used in the constraint equations of motion, since there
we had the partial derivatives of the velocities with respect to the state variable
vi and ωi0 as in D = ∂ v∂ ²̇,ω0 . But given the latter we can easily transform to
( i i)
∂ω 0
the former with the matrices (A0 (pi )) since ∂ ṗii = (A0 (pi )) and thus get,
· ¸
∂² ∂ ²̇ ∂ ²̇ ∂ ²̇ 0
= = , A (pi )
∂ (xi , pi ) ∂ (ẋi , ṗi ) ∂vi ∂ωi0
As an example the ”two points coincide” constraint, for the velocity constraint
equations we derived
v1
h i ω0
²̇ = −I R1 x̃0A/1 I −R2 x̃0A/2 1
v2 .
ω20
which then transforms to small changes in the coordinates and Euler angles as
∆x1
h i ∆p
∆² = −I R1 x̃0A/1 (A01 ) I −R2 x̃0A/2 (A02 ) 1
∆x2
∆p2
Note that this Coordinate Projection Method only operates on the holonomic
constraints, in our case the 17 constraints.
Finally we have to find speeds, vi and ωi0 which fulfil the velocity constraints.
So now we include our non-holonomic constraints. To minimize the velocity
constraint errors we use the Coordinate Projection Method again but since we
work in this velocity space we can use the Jacobian D as derived for the con-
strained equations of motion. Since the equations are linear in the speeds this
is a one step iteration!
SUCCES!
11