Lecture Notes

Multibody 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

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 i R. Q. van der Linde, and A. L. Schwab

Preface

In the spring of 1998 one of the attendance of the course was Richard Van Der Linde, PhD student from Man Machine Systems group. He attendant the course out of interest for his PhD subject "designing ballistic walking bipeds". In the course of his research he came to the conclusion that the at the time available computer software for Dynamic analysis of Multibody systems could not be applied successfully to his problems. This course filled that gap and Richard was now able to develop his own code. For me his questions on topics like impact and contact problems resulted in new chapters in the course. The planned topics on dynamics of flexible multibody systems, the specialty of our group here in Delft, had to be postponed.

Richard did not only attend the course but he wrote a nice set of lecture notes. I know from experience that this is the best way to understand new material. My advice to all of you is to follow Richard's path and make your own notes. These lecture notes can be used to verify your own.

Finally I would like to thank Richard for his never lasting enthusiasm during the course. It stimulated me enormously.

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 ii R. Q. van der Linde, and A. L. Schwab Chapter 1

Newton†-Euler ‡ with constraints

† Woolsthorpe 1642 – Kensington 1727 ‡ Basel 1707 - St.Petersburg 1783

We will start this chapter with the derivation of the equations of motion for a system of rigid bodies interconnected by joints, the so-called multibody dynamics. We will see that deriving the equations of motion by hand is a time consuming task. We will detect a structure in the equations. By application of the principle of virtual power and d’Alemberts principle the structure becomes clear and we can derive the equations of motion in a systematic way. These equations of motion are the basis for the derivation of the impact equations. In the last part of this chapter we will pay some attention to methods for the numeric integration of the equations of motion.

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 HB l2 m2 m1g m2g HA j2 l1 y VA H m 1 B j VA 1 VB x HA

Figure 1 Double pendulum and free body diagrams.

Multibody Dynamics B 1-1 R. Q. van der Linde, and A. L. Schwab 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 + m g - H = m &x& A 1 B 1 1 (vb1.1) V A -VB = 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:

1 1 && (H A + H B ) 2 l 1 sinj1 - (VA + VB ) 2 l 1 cosj1 = I1j1

Body 2, just like body 1:

H B +m 2 g =m 2 &x& 2

V B =m 2 &y& 2 (vb1.2) 1 1 && H B 2l 2 sinj 2 -V B 2l 2 cosj 2 =I 2 j 2

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

(&x&1, &y&1,j&&1, x&&2 , &y&2,j&&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:

= - 1l j = 0 x A x 1 2 1 cos 1 1 y A = y 1 - l 1 sinj 1 = 0 2 (vb1.3) = Þ + 1l j = - 1l j x B1 x B2 x 1 2 1 cos 1 x 2 2 2 cos 2 1 1 y B1 = y B2 Þy 1 + 2l 1 sinj 1 = y 2 - 2l 2 sinj 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:

1 && 1 & 2 &x&1 + 2 l 1j 1 s1 = - 2 l 1j1 c1 &y& - 1 l j&& c = - 1 l j& 2 s 1 2 1 1 1 2 1 1 1 (vb1.4) 1 && 1 && 1 & 2 1 & 2 - &x&1 + &x&2 + 2 l 1j1 s1 + 2 l 2j 2 s 2 = - 2 l 1j 1 c1 - 2 l 2j 2 c2 1 && 1 && 1 & 2 1 & 2 - &y&1 + &y&2 - 2 l 1j1 c1 - 2 l 2j 2 c 2 = - 2 l 1j 1 s1 - 2 l 2j 2 s2

, with the shorthand notation s i = sinji , en ci = cosji

Multibody Dynamics B 1-2 R. Q. van der Linde, and A. L. Schwab Combination of the equations of motion (vb1.1) and (vb1.2), and the constraint equations (vb1.4) leads to the mixed set of Differential and Algebraic Equations, the DAE, as:

éM A ù é x&& ù é fz ù ê ú ê ú = ê ú (vb1.5) ë B 0 û ë fv û ëa(x, x&)û , with

M = diag(m1 m1 I1 m2 m2 I2 ) T x&& = [x&&1 &y&1 j&&1 x&&2 &y&2 j&&2 ] T fv = [HA VA HB VB ] T fz = [m1g 0 0 m2g 0 0]

é 1 0 -1 0 ù ê 0 1 0 1 ú ê ú 1 1 1 1 ê l1 s1 - l1 c1 l1 s1 - l1 c1 ú A = ê 2 2 2 2 ú ê 0 0 1 0 ú ê 0 0 0 1 ú ê 1 1 ú ëê 0 0 2 l2 s2 - 2 l2 c2 ûú

1 é 1 0 2 l1 s1 0 0 0 ù ê ú 0 1 - 1 l c 0 0 0 B = ê 2 1 1 ú 1 1 ê-1 0 2 l1 s1 1 0 2 l 2 s2 ú ê 1 1 ú ë 0 -1 - 2 l1 c1 0 1 - 2 l 2 c2 û

é - 1 l j& 2 c ù ê 2 1 1 1 ú - 1 l j& 2 s a(x, x&) = ê 2 1 1 1 ú ê- 1 l j& 2 c - 1 l j& 2 c ú ê 2 1 1 1 2 2 2 2 ú 1 2 1 2 ëê- 2 l1j&1 s1- 2 l 2j& 2 s2 ûú

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 1-3 R. Q. van der Linde, and A. L. Schwab 1.2 The principle of virtual power and Lagrange multipliers.

We introduce the concept of virtual power:

dW = dx& 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, dfin = -x&&dm , to the applied forces results in the virtual power equation:

dW = òdx&(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:

dW = dx& 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

e 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 dx& i , as in

¶Dk (x i ) d x i d = Dk,i dx& i = 0 (4b) ¶x i d t

These subsidiary conditions are incorporated in the virtual power balance by the Lagrange multipliers (lk), as in

dx& i ( f i - M ij x&& j ) = lk Dk,i dx& i (5)

Multibody Dynamics B 1-4 R. Q. van der Linde, and A. L. Schwab The virtual velocities are now arbitrary hence we come up with i equilibrium equations:

f i - M ij x&&i = lk Dk,i (6)

The constraints on the accelerations are found by two times differentiation with respect to time of the constraints (4a), as in

Dk, 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 Dk,i ù éx&& ù é f i ù j = (8) ê ú ê ú ê- & & ú ëDk, j 0kk û ëlk û ë Dk , pq x p x q û

Compare this to (vb1.5) and we see that AT = B, the close relation between constraints and constraint forces.

Multibody Dynamics B 1-5 R. Q. van der Linde, and A. L. Schwab Example 2

We will now apply the systematic approach to the double pendulum problem. The constraints in vector form are 1 é x 1 - 2 l 1 c1 ù ê ú y - 1 l s D = ê 1 2 1 1 ú (vb2.1) k ê- x - 1 l c + x - 1 l c ú ê 1 2 1 1 2 2 2 2 ú 1 1 ëê- y1 - 2 l 1 s1 + y 2 - 2 l 2 s 2 ûú The partial derivatives or jacobian is 1 é 1 0 2 l 1 s1 0 0 0 ù ê ú 0 1 - 1 l c 0 0 0 D = ê 2 1 1 ú (vb2.2) k, j ê- 1 0 1 l s 1 0 1 l s ú ê 2 1 1 2 2 2 ú 1 1 ëê 0 - 1 - 2 l 1 c1 0 1 - 2 l 2 c 2 ûú

The convective acceleration terms are: Dk, pq x& p x& q .

1 & 2 é l 1 c1 j1 ù ê 2 ú 1 & 2 ê 2 l 1 s1 j1 ú Dk, pq x& p x& q = (vb2.3) ê 1 l c j& 2 + 1 l c j& 2 ú ê 2 1 1 1 2 2 2 2 ú ê 1 & 2 1 & 2 ú ë 2 l 1 s1 j1 + 2 l 2 s2 j 2 û

These can be compared to the results as in (vb1.5). The Lagrange multipliers lk 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

fi = Dk ,i lk (vb2.4)

We can write out these equations for the double pendulum in the upright vertical position, resulting in

- é f x 1 ù é 1 0 1 0 ù ê ú ê ú f 0 1 0 - 1 l ê y 1 ú ê ú é 1 ù ê ú ê 1 1 ú ê ú M 1 l 1 0 l 1 0 l2 ê ú = ê 2 2 ú ê ú ê ú (vb2.5) ê f x 2 ú ê 0 0 1 0 ú l3 ê ú ê ú ê ú l ê f y 2 ú ê 0 0 0 1 ú ëê 4 ûú ê ú ê 1 ú ëM 2 û ë 0 0 2 l 2 0 û

Multibody Dynamics B 1-6 R. Q. van der Linde, and A. L. Schwab

Every Langrage multiplier is interpreted by taking a value of one and taking all multipliers equal to zero. We will draw the free body diagrams for these four cases.

1

½l2 1

1 1 1 1

1 1 ½l1 1 1

1 1

1 1

l1=1 l2=1 l3=1 l4=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 lk. 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.

& dW = dx& i ( f i - M ij x&& j ) = s vde 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

e v = Dv (xi ) Þ e&v = Dv,i (xi )x&i (10)

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

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

{dx&i ( fi - &x&i M ij - s v Dv,i )}= 0 " {dx&i / Dk ,idx&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 D ù éx&& ù é f - s D ù ij k,i j = i v v,i (12) êD 0 ú ê ú ê- D x& x& ú ë k, j kk û ëlk û ë k ,pq p q û

Note the only difference with (8) being the extra term in the right-hand side and note how the element force s 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 l0 = l and a linear stiffness k.

C g

k, l0 -a 1 /2 l y j B A

x m, I

2 /3 l l

The elongation of the spring expressed in terms of the coordinates of the centre of mass of the body is

Dv (x i ) = l v - l 0 (vb3.1)

1 2 1 1 2 , with l v = (x+ 6 lcosj ) + (y+ 6 lsinj - 2 l)

Multibody Dynamics B 1-8 R. Q. van der Linde, and A. L. Schwab The partial derivatives are

1 é (x+ 6 l cosj ) ù 1 ê ú D = (y+ 1 lsinj - 1 l) (vb3.2) v ,i l ê 6 2 ú v ê 1 1 1 1 1 ú ë- 6 lsinj (x+ 6 l cosj ) + 6 l cosj y( 6 lsinj - 2 l) û

These partial derivatives describe the transformation from spring force sv to body forces fi. In the example the coordinates are : x = [ x, y, j ] = [ ½l, 0, 0]. Substitution of these coordinates in (vb3.1) and (vb3.2) yields

1 Dv = - 6 l

4 3 1 Dv ,i = [5 - 5 - 10 l]

1 The force in the spring is now - 6 lk , 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

é cosa ù 1 ê ú Dv ,i = ê sina ú (vb.3.3) l v ëê- l (sinj cosa + cos j sina)ûú

y+ 1 lsinj - 1 l tan a = 6 5 where we have used the angle alpha according to 1 for compact x+ 6 lcos j notation. Check these results.

Multibody Dynamics B 1-9 R. Q. van der Linde, and A. L. Schwab 1.4 Impact

The impact equations can easily be derived from the equations of motion. During an impact, which we assume takes a very short time, high contact forces will occur. When the time interval decreases the forces will increase. However the product of these two, the impulse, will be constant. We define the impulse as the limit case

t+ S = lim Fdt (13) t -®t + ò 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

FRETURNdt relatieve velocity after impact e = ò , of (14) F dt relatieve velocity before impact ò FORWARD

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 = Dc (x i ) Þ D = Dc ,i x& i (15)

Note D 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 l, we assume that the system is in contact, can be derived as

M ij x&& j + Dk,i lk + Dv ,is v + Dc ,i lc = 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 +

Si = lim (M ij &x&j + Dk ,ilk + Dv,is v + Dc,i lc )dt (18) t -®t+ ò 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 1-10 R. Q. van der Linde, and A. L. Schwab

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 lidt = ri , 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 + Dk,i rk + Dc ,i rc = 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 ù éx& j ù éM ij x& j + Si ù ê T ú ê ú ê ú êDk,i 0 ú êr k ú = ê 0 ú (20) ê T ú ê ú ê & - ú ëDc ,i 0 û ë rc û ë - eDc ,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 1-11 R. Q. van der Linde, and A. L. Schwab 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 1-12 R. Q. van der Linde, and A. L. Schwab

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 1-13 R. Q. van der Linde, and A. L. Schwab Chapter 2

Lagrange Equations†

† Turijn 1736 – Parijs 1813

Instead of describing the position and orientation of every individual body together with the constraints imposed by the joints on these coordinates we will use a minimum set of coordinates for which the constraints are inherent fulfilled; the set of independent generalized coordinates.

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 = mx&&yields

ò å fx&dt = ò mx&&x&dt Û ò å fdx = ò mx&dx& (1)

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

1 2 2 f (x2 - x1 ) = 2 m(x&2 - x&1 ) (2)

1 2 With the concept of potential energy V = mgh and Kinetic energy T = 2 mx& one could rewrite Newton's law as

d æ ¶T ö ¶V ç ÷ + = f i (3) dt è ¶x& i ø ¶x i

Inertia gravity the rest

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 2-1 R. Q. van der Linde, and A. L. Schwab Multiplying (3) on the left and the right with the partial derivatives from (4) yields

¶x i ì d æ ¶T ö ¶V ü ¶x i í ç ÷ + ý = f i (5) ¶q j îdt è ¶x& i ø ¶x i þ ¶q j

The first part in the left hand side can be derived from

d æ ¶x ¶T ö ¶x d æ ¶T ö ¶T d æ ¶x ö ç i ÷ = i ç ÷ + ç i ÷ (6) ç & ÷ ç & ÷ & ç ÷ dt è ¶q j ¶x i ø ¶q j dt è ¶x i ø ¶x i dt è ¶q j ø

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& = , en í i ý = i (7) & ¶q j ¶q j dt îï¶q j þï ¶q j

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

¶x d æ ¶T ö d æ ¶x& ¶T ö ¶T d æ ¶x ö i ç ÷ = ç i ÷ - ç i ÷ = (8) ç & ÷ ç & & ÷ & ç ÷ ¶q j dt è ¶x i ø dt è ¶q j ¶x i ø ¶x i dt è ¶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 ç ÷ - + = Q (9) ç & ÷ j dt è ¶q j ø ¶q j ¶q 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 2-2 R. Q. van der Linde, and A. L. Schwab Example 1

The first example is a model of a container crane, a pendulum with point mass hanging from a horizontal moving support. This system has two degrees of freedom, the horizontal displacement x of the cart and the pendulum angle j.

The generalized coordinates are qj = (x, j) met j=1..2.

x

A g

y

l x

j

m B

The coordinates of the point mass are

x = x + lsin j B (vb1.1) yB = -lcosj and the corresponding velocities

¶ x B x& B = q& j = x& + lj& cos j ¶q j (vb1.2) ¶ y B y& B = q& j = lj& sinj ¶q j

With the kinetic energy of the system (only one point mass)

1 2 2 T = 2 m {x& B + y& B } (vb1.3) expressed in the generalized coordinates and velocities as in

1 2 2 2 T = 2 m {x& + 2x& lj& cos j + l j& } (vb1.4)

The potential energy of the system is

V = - mglcosj (vb1.5)

Multibody Dynamics B 2-3 R. Q. van der Linde, and A. L. Schwab Plugging in these expressions (vb1.4) and (vb1.5) in the Lagrange equations (9) leads automatically to the equations of motion of the system expressed in terms of independent generalized coordinates. Moreover with the help of symbolic manipulation like MAPLE in MATLAB this can be done easy and almost error free. Here we will illustrate the derivation by hand in a step-by-step manner.

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

¶T é mx& + mlj& cos j ù = ê 2 ú (vb1.6) ¶q& j ëmx& l cos j + ml j&û

Taking the total differential with respect to time yields

¶ æ ¶T ö é mx&& + mlj&&cos j - mlj& 2 sin j ù ç ÷ = ê ú (vb1.7) ç & ÷ 2 ¶t è ¶q j ø ëmx&& lcos j - mx&j& lsin j + ml j&&û

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

¶T é 0 ù = ê & ú ¶q j ë- mlx&j sinjû (vb1.8) ¶V é 0 ù = ê ú ¶q j ëmglsinjû

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

2 é m mlcos jùéx&&ù éQx + mlj& sin jù = ê ú (vb1.9) ê 2 úê&&ú ëmlcos j ml ûëjû ëê Qj - mglsin j ûú

Note the mass matrix being singular at j=0+kp, can you explain this in physical terms?

Multibody Dynamics B 2-4 R. Q. van der Linde, and A. L. Schwab 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

1 2 VV (q j ) = 2 k Dl (10)

with the stiffness k and the elongation Dl 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

s vde&v =Q jdq& j (11)

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

e v = Dv (q j ) (12)

The virtual velocities are

¶Dv (q j ) de&v = dq& j (13) ¶q j

Substitution of these in (11) yields

¶Dv (q j ) Q j = s v (14) ¶q j

Adding these contributions to the equations of motion results in

d æ ¶T ö ¶T ¶V ç ÷ - + = Q - D s (15) ç & ÷ j v, j v dt è ¶q j ø ¶qj ¶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 (qi , t) = 0 (16)

Multibody Dynamics B 2-5 R. Q. van der Linde, and A. L. Schwab

For this last form of prescribed motion we will derive the equations of motion. We apply the same techniques as in chapter 1 resulting in the equations of motion

d æ ¶T ö ¶T ¶V ¶D ç ÷ - + = Qt - k l (17) ç & ÷ j k dt è ¶q j ø ¶qj ¶q j ¶q j

with the unknown Lagrange multipliers lk for the driving force from the prescribed motion. The first term from (17) can be expanded to

d æ ¶T ö ¶ æ ¶T ö ¶ æ ¶T ö ç ÷ = ç ÷q&& + ç ÷q& (18) ç & ÷ & ç & ÷ ç & ÷ dt è ¶q j ø ¶q è ¶q j ø ¶q è ¶q j ø

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

2 ¶Dk ¶ Dk &q& j + q& j q&i = 0 (19) ¶q j ¶q j ¶qi

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

é ù M D && ¶ æ ¶T ö ¶T ¶V é ij k, j ùéq j ù êQti - ç ÷q& + - ú = ¶q ç ¶q& ÷ ¶q ¶q (20) êD 0 úêl ú ê è i ø i i ú ë k , j kk ûë k û & & ëê - Dk,lmql qm ûú ¶ æ ¶T ö , with the mass matrix as in M ij = ç ÷ ¶q& j è ¶q&i ø

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

Multibody Dynamics B 2-6 R. Q. van der Linde, and A. L. Schwab 2.3 Impact

To end this chapter we will derive the impact equations from the Lagrange form. There is a lot of resemblance with the results from chapter 1. Starting point are the Lagrange equations of motion according to (17). In the case of impact we have t +

1. S j = lim Qt j dt , the generalized applied impacts. t -®t + ò t - t +

2. lim li dt = rc , the impacts at the contact points. t -®t + ò t - t + - + ¶V qi = q i Þ lim dt = 0 , forces from a potential are finite and have no contribution. t - ®t + ò ¶q t - i t + - + ¶T 3. qi = q i Þ lim dt = 0 , the coordinates do not change during the impact. t - ®t + ò ¶q t - i

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 - ri (21) è ¶q&i ø è ¶q& i ø ¶qi

with

¶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

+ - é Mij Dc,i ù éq& ù éMij q& j + Si ù j = ê ú (22) êD 0 ú ê ú &- ë c, j û ërc û ë - e Dc,l ql û

This corresponds to (12) from chapter 1.

Multibody Dynamics B 2-7 R. Q. van der Linde, and A. L. Schwab Chapter 3

A combination of methods; TMT

In chapter 1 we have seen that the dynamic behavior of multibody systems can be derived from the Newton-Euler equations of motion for a rigid body together with the constraint equations describing the ideal joints between the bodies. A major disadvantage of this approach is the numerical trouble we run into if we want to numerically integrate these DAEs. In chapter 2 we have shown that by choosing independent coordinates we can derive via the Lagrange equations the equations of motion in terms of these coordinates. These techniques work fine for small models but if we ran into more complex systems the symbolic computation of the partial derivatives becomes messy and cumbersome. There is a place called Walhalla! By going back to the basic ideas as formulated by Lagrange in his monumental work ``Méchanique analytique'' (1788), independent generalized coordinates, virtual power and inertia contribution via d'Alembert forces, we have 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

dx& i {å f i - 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

¶Ti x&i = q& k = Ti,k q& k , and the virtual velocities ¶qk (4)

dx&i = Ti,k dq& k

Substitution of this result in (2) yields

Ti ,kdq&k {å f i - M ij x&& j } = 0 (5)

The virtual velocities of the generalized coordinates dq& , are independent so every k equation must be zero as in

Ti ,k {å f i - M ij x&& j } = 0 (6)

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

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

&x&j = Tj,l q&&l + T j,pqq&pq&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&pq&q (8)

& Note the transformation from q&&l to x&& j is identical to the one from ql to x& j , they are described by the same Jacobean T j,l . Substitution of (7) and (8) in (6) yields the equations of motion in terms of independent coordinates

Ti,k {å fi - Mij{Tj,l q&&l + g j }} = 0 (9)

In matrix vector notation:

Mq&& = 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,l 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 3-2 R. Q. van der Linde, and A. L. Schwab 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

dx&i {å fi - M ij &x&j } = s vde&v (11)

With the element force sV and the virtual element deformation rate or virtual relative speed

de&v . The relative displacement of the element is expressed in terms of the independent generalize coordinates as in

e v = Dv (xi ) Þ e&v = Dv,i (xi )x&i

Substitution in (4) yields

Ti,k {å fi - M ij &x&j - Dv,i (xi )s v } = 0 (12)

Substitution of (8) in (12) and rearranging for the unknown accelerations yields in matrix vector notation

{T T MT} q&& = T T {å f - Mg - DT s} (13)

with the first order difference matrix D = Dv,i (xi ) of the additional element.

Multibody Dynamics B 3-3 R. Q. van der Linde, and A. L. Schwab 3.3 Impact

The derivation of the impact equations is analogue to the procedure of chapter 1 section 4.

With the additional contact force lc incorporated in the force integral we come up with the applied impulse as

t + t +

Sk = lim Fk d t = lim (Tik Mij&x&j + Dc,klc ) d t (14) t - ®t + ò t - ®t + ò t - t -

With the same three steps: - + 1. lim qi = qi , the coordinates do not change during the impact. t- ®t + t +

2. lim lidt = ri , the contact impulse. t -®t + ò t - t + - + + - 3. lim M ij &x&jdt = M ij (x& j - x& j ) = MijTjl (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 MijTjl Dc,l ùéq& ù éTik M ijT jl q&l + Sk ù ê ú l = ê ú (15) ê ú &- ë Dc,l 0cc ûërc û ë - e Dc,l ql û

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 3-4 R. Q. van der Linde, and A. L. Schwab Appendix A

Notations

Shorthand notations

cx = cos(x) sx = sin(x)

Symbols f = force vector g = gravitational field strength g = the vector of convective accelerations T = Transformation vector x = coordinate vector q = generalized independent coordinate vector m = mass M = mass matrix I = rotational inertia I = inertia tensor C = spring constant k = stiffness matrix k = viscous damping constant n = damping matrix

Multibody Dynamics B A-1 R. Q. van der Linde, and A. L. Schwab 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 repated we assume that we have to sum over this index. The matrix vector product y=Ax can be written as

yi = Aij x j with i=1..n and j=1..m, and summation over the index j.

Partial derivates ar 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 A-2 R. Q. van der Linde, and A. L. Schwab References

Dynamics in general 1. E.T. Whittaker, A treatise on the analytical dynamics of particles and rigid bodies, 4th edition, Cambridge University Press, Cambridge, 1937. 2. A. Sommerfeld, Vorlesungen ueber theoretische Physik, Band I: Mechanik, Klemm, Wiesbaden, 1949. 3. G. Hamel, Theoretische Mechanik, Springer-Verlag, Berlin, 1949. 4. L.A. Pars, A treatise on analytical dynamics, Heinemann, London, 1965. 5. C. Lanczos, The variational principles of , 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 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. 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. 1. 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 A-3 R. Q. van der Linde, and A. L. Schwab