0% found this document useful (0 votes)
36 views94 pages

Lecture Notes Multibody Dynamics B - Wb1413 Lecture Notes Multibody Dynamics B - Wb1413

The document contains lecture notes for the Multibody Dynamics B course at Delft University of Technology, focusing on the principles of Newton-Euler dynamics, Lagrange equations, and numerical integration methods. It includes detailed examples and discussions on free body diagrams, virtual power, and the application of constraints in multibody systems. The notes were initially created for a course in 1997/1998 and have undergone minor revisions for subsequent editions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views94 pages

Lecture Notes Multibody Dynamics B - Wb1413 Lecture Notes Multibody Dynamics B - Wb1413

The document contains lecture notes for the Multibody Dynamics B course at Delft University of Technology, focusing on the principles of Newton-Euler dynamics, Lagrange equations, and numerical integration methods. It includes detailed examples and discussions on free body diagrams, virtual power, and the application of constraints in multibody systems. The notes were initially created for a course in 1997/1998 and have undergone minor revisions for subsequent editions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 94

lOMoARcPSD|49572953

Lecture Notes Multibody Dynamics B - Wb1413

Multibody Dynamics B (Technische Universiteit Delft)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by metalhammer 242001 (vininadur@gmail.com)
lOMoARcPSD|49572953

Lecture Notes

Multibody Dynamics B
wb1413 course 1997/1998

lecturer: A. L. Schwab
by: R.Q. van der Linde and A. L. Schwab

Faculty of Mechanical Engineering

Delft University of Technology

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Contents

Preface

1 Newton-Euler with constraints


1.1 Free body diagrams
Example 1
1.2 The principle of virtual power and Lagrange multipliers
Example 2
1.3 Active and passive elements
Example 3
1.4 Impact
1.5 Numerical Integration

2 Lagrange Equations
2.1 From force to energy
Example 1
2.2 Active and passive elements
2.3 Impact

3 A combination of methods; TMT


3.1 Transformation to independent coordinates
3.2 Active and passive elements
3.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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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.

Rotterdam, March 7, 2000

A. L. Schwab

Preface to the second edition


This second edition is an English translation of the first Dutch version. Minor changes
have been made to the text and the last example, dynamic biped simulation, is dropped.
This edition will be used for lecture notes at the European Master in Modelisation of
Continuum (EMMC) course on Multibody Dynamics, at the University of Technology of
Ho Chi Minh City (UTH), Vietnam, March 18-22, 2002.

Rotterdam, March 12, 2002

A. L. Schwab

Multibody Dynamics B – version 1 February 2010 ii R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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.

1.1 Free body diagrams

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

Figure 1 Double pendulum and free body diagrams.

Multibody Dynamics B - version 3 februari 2011 1-1 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

The Newton-Euler equations of motion for the individual bodies are:

Body 1: Newton, the sum of the applied forces equals' mass times acceleration in the two
directions:

H A  m1 g  H B  m1 x1
(vb1.1)
V A  V B  m1 y1

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 A  H B ) 12  1 sin  1  (V A  V B ) 21  1 cos  1  I 11

Body 2, just like body 1:

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

In these 6 equations of motion we have 10 unknown: the 6 accelerations of the 2 bodies


( x1 , y1 ,1 , x2 , y2 ,2 ) and the forces in the joints ( H A ,V A , H B ,VB ) . To solve for the
unknowns we need 4 more equations, the constraints imposed on the system by the joints.
Body 1 is in A connected by a cylindrical hinge to the fixed world, and body 1 and body 2
are cylindrically hinged in B. The corresponding constraint equations are:

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.

Differentiating twice with respect to time and rearranging:

x1  21  11 s 1   21  1 1 2 c 1


y1  21  11 c 1   21  1 1 2 s 1
(vb1.4)
 x1  x 2  21  11 s 1  21  22 s 2   21  1 1 2 c 1  21  2 2 2 c 2
 y1  y 2  21  11 c 1  21  22 c 2   21  1 1 2 s 1  21  2 2 2 s 2

, with the shorthand notation s i  sin  i , en c i  cos  i

Multibody Dynamics B - version 3 februari 2011 1-2 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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  [x1 y1 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  11 c1
2

 
 12  11 s1
2

a ( x , x )   
 1   2 c  1   2 c 
 21 1 1 2 1 12 2 2 2 2 
  2  11 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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

1.2 The principle of virtual power and Lagrange multipliers.

We introduce the concept of virtual power:

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   xdm , to the applied
forces results in the virtual power equation:

W   x (d f  x d m)  0 (2)


V

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:

W  x i ( f i  M ij x j )  0 (3)

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.

The joint constraints can always be written in a zero delimited form, as in

 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

x i ( f i  M ij x j )  k D k ,i x i (5)

Multibody Dynamics B - version 3 februari 2011 1-4 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

The virtual velocities are now arbitrary hence we come up with i equilibrium equations:

f i  M ij xi  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 xj 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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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 

The convective acceleration terms are: D k , pq x p x q .

 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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

1=1 2=1 3=1 4=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.

1.3 Active and Passive Elements

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.

W  x i ( f i  M ij x j )   v v (9)

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

 v  Dv ( xi )  v  Dv ,i ( xi ) xi (10)

Multibody Dynamics B - version 3 februari 2011 1-7 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Substitution of these virtual rates and velocities in the virtual power equation yields

xi ( f i  xi M ij   v Dv ,i )  0  xi / Dk ,ixi  0 (11)

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)

, with  v  (x  61  cos  ) 2  (y  61  sin   21  ) 2

Multibody Dynamics B - version 3 februari 2011 1-8 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

The partial derivatives are

 (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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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)

with k constraints, v active or passive elements and c simultaneous contact points.


Integration over the duration of impact and taking the limit case yields
t
S i  lim
  
t t
M ij xj  Dk ,i k  Dv,i v  Dc,i c dt (18)

t

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

We solve (18) in 3 steps like:


1. lim
xi  xi , The configuration of the system stays the same during impact.
-
t t
t
2. lim  i dt   i , Introduction of the constraint and contact impulses.
t  t 
t
t
3. lim  M ij xj d t  M ij ( x j  x j ) , The change of momentum during impact.
t - t 
t-
Substitution of these results in (18) yields the impact equations

M ij x j  D k , i  k  D c ,i  c  S i  M ij x j (19)

Momentum Reaction Contact Applied Momentum


after Impulse Impulse Impulse before

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 xl 
 

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

1.5 Numerical Integration

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

One would expect correct results for small values of 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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Note

1-The joints in A and B come apart.


2-These gaps decrease with decreasing step size.
3-The configuration of the system after 0.5 seconds differs with the step size taken.

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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.

2.1 From force to energy

The staring point for Lagrange was: Energy=Power x time.


The work, or energy, exerted by a force F on the system is therefore ∫ f ⋅ xdt
Application of Newton law of motion ∑ f = mx yields

∫ ∑ f xdt = ∫ mxxdt ⇔ ∫ ∑ fdx = ∫ mxdx (1)

For a constant force field, for instance gravity, this yields

f ( x 2 − x1 ) = 1 2 m( x 22 − x12 ) (2)

With the concept of potential energy V = mgh and Kinetic energy T = 1


2 mx 2 one could
rewrite Newton's law as

d  ∂T  ∂V
  + = fi (3)
dt  ∂x i  ∂x i

Inertia Gravity the rest


forces forces

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Substitution of (7) in (6) and rearranging yields

∂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

Substitution of (8) in (5) yields the Lagrange equations

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

The coordinates of the point mass are

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)

expressed in the generalized coordinates and velocities as in

(
T = 1 2 m x 2 + 2x ϕ cos ϕ +  2ϕ 2 ) (vb1.4)

The potential energy of the system is

V = − mg cos ϕ (vb1.5)

Multibody Dynamics B – version 1 February 2010 2-3 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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.

First we differentiate the kinetic energy with respect to generalized velocities as in

∂T  mx + mϕ cos ϕ 


=  (vb1.6)
∂q j mx  cos ϕ + m 2ϕ 

Taking the total differential with respect to time yields

∂  ∂T   mx + mϕ cos ϕ − mϕ 2 sin ϕ 


 = (vb1.7)
∂t  ∂q  mx  cos ϕ − mxϕ  sin ϕ + m 2ϕ
 j   

The partial derivates of T and V with respect to the generalized coordinates are

∂T  0 
= 
∂q j − mxϕ sin ϕ 
(vb1.8)
∂V  0

= 
∂q j mg sin ϕ 

Substitution and rearranging yields the equations of motion in terms of generalized


coordinates

 m m cos ϕ   x  Qx + mϕ sin ϕ 


2

m cos ϕ m 2  ϕ =  Q − mg sin ϕ  (vb1.9)


     ϕ 

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

2.2 Active and passive elements

Springs and dampers can be looked upon as containers of mechanical energy (for a damper
the flow of energy is irreversible), or force elements.

The force of a spring is a conservative type of force, as defined by ∂V / ∂x = − f . The


potential energy of a spring is

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)

For the relative element displacement, f.i. elongation, we can write

ε v = Dv (q j ) (12)

The virtual velocities are

∂Dv (q j )
δεv = δq j (13)
∂q j

Substitution of these in (11) yields


∂D (q )
Qj = v j σ v (14)
∂q j

Adding these contributions to the equations of motion results in

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.

Prescribed motion which can not be expressed in terms of a prescribed generalized


coordinate like qj = qj (t), can be added to the system via a constraint of the

Dk ( q i , t ) = 0 (16)

Multibody Dynamics B – version 1 February 2010 2-5 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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 

Differentiation twice of the constraints (16) with respect to time yields

∂D k ∂ 2 Dk
q j + q j q i = 0 (19)
∂q j ∂q j ∂q i

Combination of (17) (18) and (19) yields the DAE

   
 M ijDk , j   qj  Qti − ∂  ∂T q + ∂T − ∂V 
 = 
∂q  ∂qi   ∂qi ∂qi  (20)
0kk  λk  
 Dk , j  − Dk ,lm ql qm 
∂  ∂T 
, with the mass matrix as in M ij =   which is actually an elegant way of defining the
∂q j  ∂qi 
mass matrix in terms of generalized coordinates.

Note the resemblance with the system equations as derived in chapter 1.

Multibody Dynamics B – version 1 February 2010 2-6 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

with the generalized momenta (mass times velocity)

∂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 ql− 

This corresponds to (12) from chapter 1.

Multibody Dynamics B – version 1 February 2010 2-7 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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.

3.1 Transformation to independent coordinates

According to Newton

∑ f i − M ij x j = 0 (1)

In combination with the virtual velocities yields the virtual power equation

δxi (∑ fi − M ij xj ) = 0 (2)

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 corresponding velocities are then


∂T
x i = i q k = Ti,k q k , and the virtual velocities
∂q k (4)
δx i = Ti,k δq k

Substitution of this result in (2) yields

Ti , kδqk (∑ fi − M ij xj ) = 0 (5)

The virtual velocities of the generalized coordinates δq , are independent so every k equation
must be zero as in

Ti , k (∑ fi − M ij xj ) = 0 (6)

Multibody Dynamics B – version 1 February 2010 3-1 R. Q. van der Linde, and A. L. Schwab

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

The accelerations of the center of mass of the bodies x j can be found from differentiation,
twice, of (4) yielding

x j = T j, q + T j,pq q p qq (7)

The second term is usually addressed to as the convective acceleration g j , as in

g j ( qk , qk ) = T j , pq ( qk ) q p qq (8)

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

Ti,k (∑ fi − M ij (T j, q + g j ) ) = 0 (9a)

Or in the more familiar arrangement of unknows and knows

Ti,k M ijT j, q = Ti,k ∑ f i + Ti,k M ij g j (9b)

In matrix vector notation:

M q = f (10)

with the reduced mass matrix: M = T T MT


the first order kinematic transfer function: T = Ti , j
and the reduced force vector: f = T T [∑ f − Mg ]

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

3.2 Active and passive elements

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

δxi (∑ fi − M ij xj ) = σ vδεv (11)

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

Substitution in (4) yields

Ti , k (∑ f i − M ij xj − 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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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 xj + Dc , k λc ) d t (14)
t →t t →t
t− t−

With the same three steps:


1. lim
- +
q i− = q i+ , the coordinates do not change during the impact.
t →t
t+
2. lim
t − →t + ∫ λ dt = ρ

i i , the contact impulse.
t
t+
3. lim ∫ M ij xj dt = M ij ( x −j − x +j ) = M ijT jl (ql+ − ql− ) , the change of momentum.
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

Tik M ij T jl Dc ,k  q l+  Tik M ij T jl q l− + S k 


   =   (15)
 Dc , l 0 cc   ρ c   − e Dc ,l q l− 

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Index notation with Einstein summation convention

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Lecture Notes
Multibody Dynamics B, wb1413

A. L. Schwab & Guido M.J. Delhaes


Laboratory for Engineering Mechanics
Mechanical Engineering
Delft University of Technolgy
The Netherlands

April 9, 2009

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Contents

7 Numerical Integration of Ordinary Differential Equations 2


7.1 Euler step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
7.2 Heun step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.3 Runge Kutta 4 step . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.4 A method for second order differential equations . . . . . . . . . 9
7.5 Global Error Estimate Revisited . . . . . . . . . . . . . . . . . . 10
7.6 Error estimate in practise . . . . . . . . . . . . . . . . . . . . . . 11
7.7 Implicit Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.8 Linear Multi-step Methods . . . . . . . . . . . . . . . . . . . . . 15

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Chapter 7

Numerical Integration of
Ordinary Differential
Equations

Up until now solved for q̈ from

M̄q̈ = Q̄(q, q̇, t) (7.1)

or
DT
    
M ẍ f
= (7.2)
D 0 λ −D2 ẋẋ

But what we really want to know is q(t).


So given t0 , q0 and q̇0 and M̄q̈0 = Q̄(q0 , q̇0 , t0 ) we want to know q1 and q̇1 for
time t1 = t0 + h.
A natural, but naive, way would be,

q1 = q0 + hq̇0 ,
q̇1 = q̇0 + hq̈0 .

Which finds its origin in the Taylor expansion of a function f (x).


1 1
f (x + h) = f (x) + hf ′ (x) + h2 f ′′ (x) + · · · + hn f n (x) + O(hn+1 ) (7.3)
2 n!
Knowing this you could raise the question if it were not better to use,
1
q1 = q0 + hq̇0 + h2 q̈0 ?
2
An ordinary differential equation (ODE) is usually expressed as, y′ = f (x, y)
with initial values y(x0 ) = y0 . We have, ẏ = f (t, y) with the initial values at
t = t0 , y(t0 ) = y0 . Well actually we have a set of n second order differential
equations,
M̄q̈ = Q̄(t, q, q̇), (7.4)

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Figure 7.1: Sketch of a mass spring damper system

motion for this system with linear spring-damper is,


mẍ = mg − Fs − Fd = mg − kx − cẋ.
Substitute ẋ = u in the previous equation results in,
k c
u̇ = g −x − u.
m m
And rewritten in the standard first order form ẏ = g(t, y),
      
ẋ 0 1 x 0
= k c + . (7.7)
u̇ −m −m u g
And finally with initial
 conditions for example starting from rest, x = 0 and
0
ẋ = 0, or y0 = .
0

7.1 Euler step


The first method, yn+1 = yn + hf (tn , yn ) ,is known as an Euler step. A some-
what more refined method is,

yn+1 = yn + hf (tn , yn )
h ∗

yn+1 = yn + f (tn , yn ) + f (tn+1 , yn+1 )
2

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Figure 7.2: Sketch of the Heun integration method

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

So the global truncation error for the two methods are,

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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)

The general solution to this equation is y = ceλt and with complex λ = a + bi


and complex c we have the solutions of the form,

y = ce(a+bi)t = ceat ebit .

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

λy0 eλt = Ay0 eλt holds for any t

(A − λI) y0 = 0 ⇒ |A − λI| = 0

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 7.3: Sketch of a mass spring damper system

−λ 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:

ǫ̇ = λǫ

Re(λ) > 0: Stable only in a fixed interval.


Re(λ) < 0: Unconditionally stable.

Back to the test equation and the Method. Let’s with the Euler method,

yn+1 = yn + hf (tn , yn ) with f (tn , yn ) = λyn

yn+1 = yn + hλyn
yn+1 = (1 + hλ) yn
yn+1 = C (hλ) yn

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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!

Figure 7.4: Euler stability area in the complex coordinates

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.

Figure 7.5: pendulum solution using Euler

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

7.2 Heun step


Let’s look at Heun:


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

Figure 7.6: Heun stability area in the complex coordinates

systems.

7.3 Runge Kutta 4 step


A very accurate and efficient method is the so-called Runge Kutta method,

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 7.7: Runge Kutta stability area in the complex coordinates

h < 2.8/ω0 or with T0 = 2π/ω0 → h < (2.8/2π)T0 → h < 0.4T0


These were all 1-step methods for systems first order differential equations.

Figure 7.8: Runge Kutta maximum time step to guarantee stability

7.4 A method for second order differential equa-


tions
Now if you look at our system of differential equations half of them are pretty
simple.

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.

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

The local truncation error is:

ǫ = O h2


but if f is weak in z (the velocities)

ǫ = 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

which can be seen as a first order differential equation:ẏ = λy.


p
λ1,2 = −βω0 ± 1 − β 2 ω0 i
The stability comes out as:
Stable for pure oscillating systems.

Figure 7.9: Runge Kutta stability detail

An ”arcade” scheme, suitable for the entertainment industry, moderate accuracy


but fast only 1 function call per step. Note that this function call is at the time
increment tn + h/2. So in the end we know the position q and the velocity z at
the discrete points but the acceleration q̈ and all the forces etc. are only known
at the midpoints.

7.5 Global Error Estimate Revisited


To get more accurate results you just decrease the step size
 h, but · · · we only
looked at local truncation errors of the type ǫ = O hp+1 or E = O (hp ). Since
we work with finite word lengths in the computer to represent our numbers we
also have round-off errors which re of the type ǫ = C2 ← a very small number
but since we take the n = T /h steps the global or accumulated round-off error
is:  
T 1
E = C2 = O
h h

10

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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).

Figure 7.10: global error versus step size on linear scale

Figure 7.11: global error versus step size on logarithmic scale

7.6 Error estimate in practise


The global error estimate has the term:
1
y = ŷ + C1 hp + C2
h

11

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 7.14: the truncation and round-off error for different integration methods
versus step size on logarithmic scale

13

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

7.7 Implicit Methods


These were all explicit methods, recall Forward Euler yn+1 = yn + hf (tn , yn )
in contrast to the Backward Euler yn+1 = yn + hf (tn+1 , yn+1 ).
We call this method implicit, in order to know yn+1 we need to evaluate
f (tn+1 , yn+1 ), so in general we need to solve these usually non-linear equations.

yn+1 = yn + hf (tn+1 , yn+1 )

Why better? Accuracy and stability.

Accuracy: The local truncation error ǫ = O(h2 ) is the same as for the for-
ward Euler.

Stability: with the same test equation:

ẏ = λ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

The amplification factor C (hλ) = 1/ (1 − hλ). Stability is expressed by

Figure 7.15: Forward versus Backward Euler following Gear

|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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 7.16: Backward Euler stability area

7.8 Linear Multi-step Methods


Even earlier than Runge-Kutta they were devised by J.C. Adams to solve a
problem of F. Bashfort. The origin of the method has been dated back to
1855 when F. Bashfort made an application to the Royal Society for assistance
from the Government grant. There he wrote:” · · · but I am indebted to Mr.
Adams for a method of rewriting the differential equation · · · which gives the
theoretical form of the drop with an accuracy exceeding that of the most refined
measurements”. Eventually the methods were published by Bashfort in 1883.
What happened in 1855 in the United states of America? In 1855 Whitman
published at his own expense a volume of 12 poems, Leaves of Grass. Smith &
Wesson invents the revolver. It was 6 years before the civil war would started.

ẏ = f (t, y)

This is the idea: Z t1


y1 = y0 + f (t, y) dt
t0
R
Describe f in a Langrange polynomial as a function of the past and one step

Figure 7.17: Linear multistep method principle of Bashfort

15

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 7.18: Fictive interpolation future value using Lagrange polynomial

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 7.19: the stability area of the multi step integration method for different
orders

Figure 7.20: sketch of a ”reverse” carrace

A: A smooth ride v >→ h >


look far backward → k >
B: A sudden break v <→ h <
forget the past → k <

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Now if aij = 0j ≥ i → Explicit Method


and aij = 0j > i → Diagonal Implicit
else → Implicit sensostrito
( The number ci have to fulfill by: ci = Σsj=1 aij in order the integrated time
dependent system which we make arbencunicus)

Methods with one stage, s = 1

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Taylor expansion solution:

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)

Explicit 3-stage methods

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

function varargout = ode(ode,tspan,y0,options,varargin)


% ODE23 Solve non-stiff differential equations, low order method.
% [T,Y] = ODE23(ODEFUN,TSPAN,Y0) with TSPAN = [T0 TFINAL] inte-
grates the
% ... cut ...
% Initialize method parameters.
pow = 1/3;
A = [1/2; 3/4; 1];
B=[
1/2 0 2/9
0 3/4 1/3
0 0 4/9
0 0 0];
E = [-5/72; 1/12; 1/9; -1/8];
f = zeros(neq,4);
hmin = 16*eps*abs(t);
% ... cut ...
% LOOP FOR ADVANCING ONE STEP.
nofailed = true; % no failed attemps
while true
hB = h * B;
f(:,2) = feval(ode,t+h*A(1),y+f*hB(:,1),args:);
f(:,3) = feval(ode,t+h*A(2),y+f*hB(:,2),args:);
tnew = t + h*A(3);
if done
tnew = tfinal; % Hit end point exactly.
end
h = tnew - t; % Purify h.

ynew = y + f*hB(:,3);
f(:,4) = feval(ode,tnew,ynew,args:);
stats.nfevals = stats.nfevals + 3;

% Estimate the error.


if normcontrol
normynew = norm(ynew);
err = absh * (norm(f * E) / max(max(normy,normynew),threshold));
else
err = absh * (norm(f * E) ./ max(max(abs(y),abs(ynew)),threshold),inf);
end

% 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 ...

function yinterp = ntrp23(tinterp,t,y,tnew,ynew,h,f)


%NTRP23 Interpolation helper function for ODE23.

20

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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 )

ǫ = absh ∗ norm (f ∗ E) abs: back iterative norm: multi distinctive


Local truncation error estimate:
 
5 1 1 1
ǫ = h − k1 + k2 + k3 − k4
72 12 9 8

If the step is accepted then: ...


f(:,1) = f(:,4) FSAL (First Same As Last)
So apparently 4 stage but actually 3-stage method.

Finally, for dense output or event interpolation we want to interpolate accu-


rately between yn and yn+1 without extra function evaluations to f .

yn+α = yn + hk1 α − 43 α2 + 5 3

9α +
hk2 α2 − 23 α3 +


hk3 43 α2 − 89 α3 +


hk4 −α2 + α3 +O h4 ??
 

So we have two extra things here:


• Local truncation error estimate and step size adaption!
• Accurate interpolation results.
Now look for yourself at ode45

function varargout = ode45(ode,tspan,y0,options,varargin)


%ODE45 Solve non-stiff differential equations, medium order method.
% [T,Y] = ODE45(ODEFUN,TSPAN,Y0) with TSPAN = [T0 TFINAL] inte-
grates the
% ... cut ...
% Initialize method parameters.
pow = 1/5;
A = [1/5; 3/10; 4/5; 8/9; 1; 1];
B=[

21

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

1/5 3/40 44/45 19372/6561 9017/3168 35/384


0 9/40 −56/15 −25360/2187 −355/33 0
0 0 32/9 64448/6561 46732/5247 500/1113
0 0 0 −212/729 49/176 125/192
0 0 0 0 −5103/18656 −2187/6784
0 0 0 0 0 11/84
0 0 0 0 0 0];
E = [71/57600; 0; -71/16695; 71/1920; -17253/339200; 22/525; -1/40];
f = zeros(neq,7);
hmin = 16*eps*abs(t);
% ... cut ...
% LOOP FOR ADVANCING ONE STEP.
nofailed = true; % no failed attemps
while true
hA = h * A;
hB = h * B;
f(:,2) = feval(ode,t+hA(1),y+f*hB(:,1),args:);
f(:,3) = feval(ode,t+hA(2),y+f*hB(:,2),args:);
f(:,4) = feval(ode,t+hA(3),y+f*hB(:,3),args:);
f(:,5) = feval(ode,t+hA(4),y+f*hB(:,4),args:);
f(:,6) = feval(ode,t+hA(5),y+f*hB(:,5),args:);

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;

% Estimate the error.


if normcontrol
normynew = norm(ynew)
err = absh * (norm(f * E) / max(max(normy,normynew),threshold));
else
err = absh * norm((f * E) ./ max(max(abs(y),abs(ynew)),threshold),inf); end

% 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 ...

function yinterp = ntrp45(tinterp,t,y,tnew,ynew,h,f)


%NTRP45 Interpolation helper function for ODE45.
BI = [

22

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

1 −183/64 37/12 −145/128


0 0 0 0
0 1500/371 −1000/159 −1000/371
0 −125/32 125/12 −375/64
0 9477/3392 −729/106 25515/6784
0 −11/7 11/3 −55/28
0 3/2 −4 5/2];
s = ((tinterp -t) / h)’; % may be a row vector
yinterp = y(:,ones(length(tinterp),1)) + f*(h*BI)*cumprod(s(ones(4,1),1:));

23

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Bibliography

[1] P. Henrici. Discrete variable methods in ordinary differential equations. Wiley,


New York, 1962.
[2] Charles William Gear. Numerical initial value problems in ordinary differential
equations. Prentice-Hall, Englewood Cliffs, N.J., 1971.
[3] L. F. Shampine and M. K. Gordon. Computer solution of ordinary differential
equations: the initial value problem. W. H. Freeman, San Francisco, 1975.
[4] John Charles Butcher. The numerical analysis of ordinary differential equations:
Runge-Kutta and general linear methods. J. Wiley, Chichester, New York, 1987.
[5] John H. Hubbard and Beverly H. West. Differential Equations: A Dynamical
System Approach, Part 1, Ordinary Differential Equations. Number 5 in Texts in
Applied Mathematics. Springer, New York, 1991.
[6] E. Hairer, S. P. Nørsett, and G. Wanner. Solving Ordinary Differential Equations
I: Nonstiff Problems. Number 8 in Springer Series in Computational Mathematics.
Springer-Verlag, Berlin Heidelberg, second revised edition, 1993.
[7] Lawrence F. Shampine. Numerical solution of ordinary differential equations.
Chapman & Hall, New York, 1994.
[8] Edda Eich-Soellner and Claus Führer. Numerical Methods in Multibody Dynam-
ics. European Consortium for Mathematics in Industry. B.G.Teubner, Stuttgart,
1998.
[9] Reinhold von Schwerin. Multibody System Simulation: Numerical Methods, Algo-
rithms, and Software. Number 7 in Lecture Notes in Computational Science and
Engineering. Springer-Verlag, 1999.
[10] Cleve B. Moler. Numerical Computing with Matlab. SIAM, 2004. (Free at:
http://www.mathworks.com/moler/chapters.html).

24

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Lecture Notes
Multibody Dynamics B, wb1413

A. L. Schwab & Guido M.J. Delhaes


Laboratory for Engineering Mechanics
Mechanical Engineering
Delft University of Technolgy
The Netherlands

April 28, 2011

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Contents

8 Closed Loop Systems 2

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Chapter 8

Closed Loop Systems

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 = (α).

Figure 8.1: Four-bar linkage system

Why four-bar?
So we have to write down xi = Fi (qj ).
Lets start,look at the figure above:

x1 = a/2 cos (α)


y1 = a/2 sin (α)
φ1 =α
x2 = a cos (α) + · · ·

I do not know! Look at the paper by Talbourdet from 1941 [1].

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

But I do know how to do a triple-pendulum. This is a double pendulum with


an extra pendulum at the end and the I just add two constraints to get back to
the original 1 dof system.

Figure 8.2: four-bar linkage generalized coordinate definition

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 = (α, β, γ):

x2 = a cos (α) + 2b cos (β)


y2 = a sin (α) + 2b sin (β)
φ2 =β
x3 = a cos (α) + b cos (β) + 2c cos (γ)
y3 = a sin (α) + b sin (β) + 2c sin (γ)
φ3 =γ

Now add two constraints to close the loop again at D,

1 = ∆xD =0  = a cos (α) + b cos (β)c cos (γ) − d = 0


⇒ 1
2 = ∆yD =0 2 = a sin (α) + b sin (β)c sin (γ) =0

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 8.3: flying apart of the two bars of the pendulum

Figure 8.4: constraint surface

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

This is what we call a non-linear constrained least-square problem,


||q̃n+1 − qn+1 | |2 = minqn+1
D (qn+1 ) = 0
We solve this by a Gauss-Newton method: First linearize about q̃n+1 .

qn+1 = q̃n+1 + ∆qn+1


Which leads to:

||∆qn+1 | |2 = min Σi ∆qi2 n+1
= min
D (q̃n+1 ) + D,n (q̃n+1 ) ∆qn+1 = 0
This constrained least square problem can be solved by introducing the so-
called Lagrange multipliers µ for the constraints leading to the linear system of
equations,
DT,q
    
I ∆qn+1 0
=
D,q 0 µ −D (q̃n+1 )
Or in a shorthand form, where we use ∆ = ∆qn+1 , D = D,q , and e =
−D (q̃n+1 ),
I DT
    
∆ 0
=
D 0 µ e

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

We have to solve for the vectors ∆ and µ.

Start with ∆ = −DT µ, and substitute this in the second equation, D∆ = e,


as,
−DDT µ = e
Note the dimension of the matrix D (m × n) where m < n and the product
DDT (m × m) which is now square in the smallest dimension m. If this matrix
has full rank, which it usually will have, then we can solve for µ and e,

µ = − 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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

     
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).

The Gauss-Newton iteration scheme is now,


set iterat = 0
set tol = 1e-12
set x_n+1 x_n
set maxiterat = 10
evaluate eps=D(x_n+1)
repeat
dx_n+1 = -D,x^T(D,x D,x^T) eps
x_n+1 = x_n+1 + dx_n+1
eps = D(x_n+1)
iterat = iterat+1
until max(abs(eps))<tol or iterat>maxiterat
Next we determine the speeds which fulfill the constraints, these are linear
equations so we have a linear least square problem which we can solve in one
step:
epsdot=D,x xdot_n+1
dxdot_n+1 = -D,x^T(D,x D,x^T) epsdot
xdot_n+1 = xdot_n+1 + dxdot_n+1
Now take a look at the Hrones & Nelson [2] four-bar linkage atlas. A 700 page
folio book from 1951, which shows 500.000 solutions of the coupler curve for a
general four-bar linkage. And how are these constructed? with a mechanism!

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Bibliography

[1] G. J. Talbourdet. Mathematiscal Solutions of Four-Bar Linkages; part I - Analysis


of Single 4-Bar Linkage. Machine Design, May 1941.
[2] J. A. Hrones and G. L. Nelson. Analysis of the four bar linkage. MIT press and
John Wiley & Son, New York, 1951.

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Lecture Notes
Multibody Dynamics B, wb1413

A. L. Schwab & Guido M.J. Delhaes


Laboratory for Engineering Mechanics
Mechanical Engineering
Delft University of Technolgy
The Netherlands

May 31, 2010

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Contents

9 Rotation Matrix, Euler Angles & Euler Parameters 2


9.1 Euler Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
9.2 Euler angles and angular velocities . . . . . . . . . . . . . . . . . 6
9.3 Euler parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
9.3.1 Angular velocities and Euler parameters . . . . . . . . . . 14

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Chapter 9

Rotation Matrix, Euler


Angles & Euler Parameters

Figure 9.1: Rigid Body coordinate system


The motion of a rigid body in space can be described by the sum of a
translation and a rotation. For instance the translation of a point C of the
body, and for the rotation we look at the change in orientation of a body fixed
coordinate system described by the motion of the body fixed base vectors e′i ,
where i = 1 · · · 3.
Here we focus on the rotation so lets forget the translational part. We follow
the position of an arbitrary point P , which is fixed in rigid body B, during
rotation.
After rotation, point P is
p = p1 e1 + p2 e2 + p3 e3
with pi the algebraic components in the space fixed coordinate system, and ei
with i = 1 · · · 3 the space fixed coordinate system. Or to be more specific, the

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

p = p′1 e′1 + p′2 e′2 + p′3 e′3

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

pi = (p′1 e′1 + p′2 e′2 + p′3 e′3 ) · ei

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:

p′i = p · e′i = pj ej · e′i


−1 −1
p′i = Rij pj with Rij = e′i · ej
−1
Apparently Rij = Rji or in other words, the inverse is the transpose as in
−1
R = R . Which we can also write as RRT = I. A matrix which fulfil this
T

requirement is called an orthogonal matrix. Such a matrix has all eigenvalues


λ ± 1.

Now R has 9 components and RRT = I imposes 6 independent conditions


( )T
on R. (And not 9 because of the symmetry RRT = RRT . So you could
parameterize R with 9 − 6 = 3 independent parameters.

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Let’s check this in 2D.


R 4 components
RRT = I 3 conditions
1 parameters to describe R

When we continue, then in a 4 dimensional space (I have no clear concept of


such a space, but anyway just for example’s sake), we can parameterize this
4 × 4 rotation matrix with 16 − 10 = 6 independent parameters!

Figure 9.2: Fixed and rotated coordinate system

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 (ϕ)

9.1 Euler Angles


One way to parameterize the 3D rotation matrix R is by Euler angles. Euler
angles is a kind of recipe which goes like this:

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′

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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′

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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 (θ)

The rotation matrix R expressed in the z–x–z Euler angles ϕ, θ, ψ is now,

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 (θ)

Now Rϕ Rθ Rψ ̸= Rθ Rϕ Rψ so the order of rotation is important. This means


that the Euler angles (ϕ, θ, ψ) are no vectors! Because, if Euler angles were
vectors then the order would not matter, but it does!

Figure 9.5: If Euler angles were vectors the order would not matter as pictured
here in the ”head to head” addition.

9.2 Euler angles and angular velocities


The next step in describing orientation is space is to look at the change with
time, angular velocities. Recall that, after translation and rotation, we can find

Figure 9.6: Sketch fixed and body fixed coordinate system

any point p in the body from,

xp = xc + xp/c
= xc + Rx′p/c with R = R (ϕ, θ, ψ)

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

,where the body fixed coordinates x′p/c are constant for a rigid body.

We now find the velocities by differentatin with respect to time, as in,


ẋp = ẋc + ẋp/c
= ẋc + Ṙx′p/c + Rẋ′p/c with ẋ′p/c = 0

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,

ẋp − ẋc = ẋp/c = Ṙx′p/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,

x′p/c = RT xp/c → ẋp/c = ṘRT xp/c

What is this matrix ṘRT ?

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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 (θ) ψ̇

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

!BE AWARE!: the  timederivatives of the three Euler angles ϕ, θ, ψ which we


ϕ̇
write as a vector  θ̇  is not a vector, never ever!
ψ̇
Likewise we can derive the angular velocities in the body fixed coordinate system
as in,  ′       
ωx 0 θ̇ 0
 ωy′  =  0  + RTψ  0  + RTψ RTθ  0  ⇒
ωz′ ψ̇ 0 ϕ̇
 ′    
ωx sin (ψ) sin (θ) cos (ψ) 0 ϕ̇
 ωy′  =  cos (ψ) sin (θ) − sin (ψ) 0   θ̇  (9.1)
ωz′ cos (θ) 0 1 ψ̇
Why am I telling all this? In fact we are only interested in the rotational motion
of a rigid body. This is governed by the set of first order differential equations
of motion also unknown as the Euler equations,

ΣM′c = J′c ω̇ ′ + ω ′ x (J′c ω ′ ) ,

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′

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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.

at such a singular configuration where θ = 0 and ψ = 0 (the latter condition


is not necessary for a singular configuration but makes things somewhat more
easy to picture), equations (9.1) then become,
    
ωx′ 0 1 0 ϕ̇
 ωy′  =  0 0 0   θ̇ 
ωz′ 1 0 1 ψ̇

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

configuration of the Euler angles is sometimes referred to as Gimbal lock.


One way to get rid of the singularity is to redefine the Euler angles by changing
θ = θ − π/2. A major disadvantage of this reformulation of angles is that new

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.

9.3 Euler parameters


There is a solution to all these problems. Euler’s Theorem on rotation of a rigid
body in space reads,

Any rotation in 3D space can be described by a rotation about a


fixed axis at a given angle.

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

system (a, b), where

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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 λ̃ .

Next we expand this, where we make use of,


 
−λ22 − λ23 λ1 λ2 λ1 λ3
λ̃λ̃ =  λ2 λ1 −λ23 − λ21 λ2 λ3  ,
λ3 λ1 λ3 λ2 −λ21 − λ22
which looks a lot like the inertia tensor −Jc . Expanding all terms and making
use of the constraint on the Euler parameters, λ20 + λ21 + λ22 + λ23 = 1, we get the
rotation matrix expressed in terms of the Euler parameters,
 2 
λ0 + λ21 − λ22 − λ23 2 (λ1 λ2 − λ0 λ3 ) 2 (λ1 λ3 + λ0 λ2 )
R= 2 (λ2 λ1 + λ0 λ3 ) λ20 − λ21 + λ22 − λ23 2 (λ2 λ3 − λ0 λ1 ) 
2 (λ3 λ1 − λ0 λ2 ) 2 (λ3 λ2 + λ0 λ1 ) λ0 − λ21 − λ22 + λ23
2

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Next, using the goniometric identities,

2 cos ( ϕ2 ) sin ( ϕ2 ) = sin (ϕ)


,
cos2 ( ϕ2 ) − sin2 ( ϕ2 ) = cos (ϕ)

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
ϕ.

9.3.1 Angular velocities and Euler parameters


The last step is to find the expressions for the angular velocity vector ω in terms
of the Euler Parameters and its time derivatives. Formally, we have ṘRT = ω̃.
Which we expand for Euler parameters into
∂R T ∂R T ∂R T ∂R T
R λ̇0 + R λ̇1 + R λ̇2 + R λ̇3 = ω̃
∂λ0 ∂λ1 ∂λ2 ∂λ3
After simplification, and with help of the identities λi λi = 1 (summation over
i), we end-up with a set of three linear equations,
 
  λ̇0  
−λ1 λ0 −λ3 λ2  λ̇1  ωx
2  −λ2 λ3 λ0 −λ1  
 λ̇2
 =  ωy 

−λ3 −λ2 λ1 λ0 ωz
λ̇3

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Lecture Notes
Multibody Dynamics B, wb1413

A. L. Schwab & Guido M.J. Delhaes


Laboratory for Engineering Mechanics
Mechanical Engineering
Delft University of Technolgy
The Netherlands

June 9, 2009

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Contents

10 Notes on the Bicycle Project 2


10.1 The Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
10.2 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Chapter 10

Notes on the Bicycle


Project

10.1 The Model


This is a recipe for making a full 3D dynamic model of a bicycle.

Figure 10.1: bicycle model

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

So we have in total 24 coordinates, 17 constraints on the coordinates (and the


velocities), and an additional 4 constraints on the velocities only. Which leaves
24 − 17 = 7 degrees of freedom in the coordinates, and 24 − 21 = 3 degrees of
freedom in the velocities, the so-called mobility.

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 10.2: numbering of the bodies of the bicycle model

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, · · · .

Figure 10.3: Unconstrained rigid body

The equations of motion for a single unconstrained rigid body are:

Newton → Σf = mv̇G
Euler → ΣM0G = J0G ω̇ 0 + ω 0 × (J0G ω 0 )

where G is the centre of mass of the rigid body.

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.

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Figure 10.4: Definition Euler Angles by cans-in-series

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.

Figure 10.5: Definition of the coordinate system of a running wheel

—————————————————————————————————–
First derive the rotation matrices for this definition and the angular velocities.

x = Rφ Rθ Rψ x0

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

   
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) ṗ

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

And for the space fixed angular velocities the inverse,

−1
ṗ = (A0 (p)) ω0
     0 
φ̇ − sin (ψ) 0 cos (ψ) ωx
 θ̇  = 1  cos (θ) cos (ψ) 0 cos (θ) sin (ψ)   ωy0 
cos (θ)
ψ̇ sin (θ) sin (ψ) cos (θ) − sin (θ) cos (ψ) ωz0

Note the singularity at θ = π/2 ± kπ!


—————————————————————————————————–
Recall that the state of the system is described by the coodinates of the cm,
xGi , the Euler angles, pi , the velocities of the cm of the bodies, vGi , and the
angular velocities of the bodies expressed in the body fixed frame, ωi0 .
Then the state equations are, first for the coordinates and Euler angles,
¾
ẋGi = vGi
−1 for each body i = 1 · · · 4 (10.1)
ṗi = (A0 (pi )) ωi0

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!

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

10.2 Constraints
Revolute Joint =
2 Points coincide → 3
2 hinge axes parallel → 2
————————————-
Total # of constraints → 5

First look at two points coincide:


 
Figure 10.7: Revolute ²x
Joint constraint ² = xA2 − xA1 =  ²y 
²z
² = x2 + xA/2 − x1 − xA/1
² = x2 + R2 x0A/2 − x1 − R1 x0A/1

with R1 = R(p1 ), R2 = R(p2 ) and


where x0A/2 , x0A/1 are constant vec-
tors.

Figure 10.8: Two Points Coincide

Velocities:

²̇ = ẋ2 + ω2 × xA/2 − ẋ1 − ω1 × xA/1


= v2 + ω2 × xA/2 − v1 − ω1 × xA/1
Accelerations:

²̈ = v̇2 + ω˙2 × xA/2 − v̇1 − ω̇1 × xA/1


+ω2 × (ω2 × xA/2 ) − ω1 × (ω1 × xA/1 )
These last equations are the constraint equations we have to add to the equa-
tions of motion but .... we work in a body fixed ω 0 instead of space ω.

³ ´ ³ ´
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.

²̇ = v2 − R2 x̃0A/2 ω20 − v1 + R1 x̃0A/1 ω10


or in matrix-vector form:
 
v1
h i  ω0 
²̇ = −I R1 x̃0A/1 I −R2 x̃0A/2  1 
 v2 
ω20

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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:

g = ω2 × (ω2 × xA/2 ) − ω1 × (ω1 × xA/1 )


Next look at the two hinge axes being parallel constraints. We want the two

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 .

²1 = êTy1 êx2 ( like bending about êz1 )


²2 = êTz1 êx2 ( like bending about êy1 )
or with R1 = R (p1 ) and R2 = R (p2 ) and referring to the body fixed prime
vectors which are constant:

¡ ¢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

²̇1 = ê˙ Ty1 êx2 + êTy1 ê˙ x2


T
= (ω1 × êy1 ) êx2 + êTy1 (ω2 × êx2 )
But we prefer the body fixed coordinate system with ω 0 .
¡ ¡ ¢¢T ¡ ¡ ¢¢
²̇1 = R1 ω10 × ê0y1 êx2 + êTy1 R2 ω20 × ê0x2
²̇1 ˜0 ω 0 − êT R2 ê
= −êTx2 R1 ê ˜0 ω 0
y1 1 y1 x2 2

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Apparently the Jacobian matrix D is:


∂ ²̇1 ˜0 and ∂ ²̇1 = −êT R2 ê
˜0
0 = −êTx2 R1 ê y1 y1 x2
∂ω1 ∂ω20
Accelerations:
T
²̈1 = (ω̇1 × êy1 ) êx2 + êTy1 (ω̇2 × êx2 ) +
T T
(ω1 × (ω1 × êy1 )) êx2 + (ω1 × êy1 ) (ω2 × êx2 ) +
T T
(ω1 × êy1 ) (ω2 × êx2 ) + êy1 (ω2 × (ω2 × êx2 ))
Be aware that the convective term g1 goes to the right-hand side of the Equa-
tions of motion.
T T
g1 = (ω1 × (ω1 × êy1 )) êx2 + (ω1 × êy1 ) (ω2 × êx2 ) +
T
(ω1 × êy1 ) (ω2 × êx2 ) + êTy1 (ω2 × (ω2 × êx2 ))
and of course
∂²̈1 ∂ ²̇1
=
∂ ω̇1 ∂ω1
so this Jacobian of the acceleration constraint is the same as the one for the
velocities constraint, always!
—————————————————————————————————–
Wheel contact constraints

The velocity of contact point c is

ẋc = ẋG + ω × r
No slip means: ẋc = 0. Actually we
have one holonomic contact condition

zG = r cos (θ),

and two nonholonomic or no-slip con-


ditions
ẋc = 0
.
ẏc = 0
But ... I like to think in a moving
Figure 10.10: Definition coordinate sys-
coordinate system.
tems for the wheel contact constraint
00
ẋc =6 0 zero longitudinal slip
00
ẏc = 6 0 zero lateral slip
00 00 00 00
ẋc = ẋG + ω × r
Now with 00
ẋG = RTφ ẋG
and ³ 00 00
´
ω ×r = Rθ Rψ (ω 0 × r0 ) .

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

Figure 10.11: r,r’

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)


lOMoARcPSD|49572953

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

Downloaded by metalhammer 242001 (vininadur@gmail.com)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy