You are on page 1of 8

NCTU Department of Electrical and Computer Engineering 2015 Spring Course

<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen

7. Lagrange’s Equations

To derive the dynamic equations of a mechanical system, we often apply the

Lagrange’s equations which is based on an energy-balance relation and expressed in

terms of the kinetic energy T, the potential energy U, and a set of independent

coordinates. Before introducing the Lagrange’s equations, let’s consider the simplest

mechanical MBK system and adopt the Newton’s second law to obtain its dynamic

systems.

x0=0 x(t)

K
f(t)
B M

Figure7-1

In engineering, most of the systems are constructed by mechanical components

such as damper and spring. Figure7-1 shows the simplest mechanical system, called

the mass-damper-spring system or MBK system in brief, where M is the mass of the

moving object, B is the damping coefficient of the damper and K is the stiffiness of

the spring. Let f(t) be an extra force exerted on the object and assume x(t) is the

resulted deviation of the spring referred to its unforced status x0=0. Then, there are

two forces reacted to restrain the motion of the object, expressed as

f B (t ) = − Bx& (t ) (7-1)

f K (t ) = − Kx(t ) (7-2)

where fB(t) is caused by the damper and fK(t) is the spring force. According to the

Newton’s second law of motion, we have

f (t ) + f B (t ) + f K (t ) = M&x&(t ) (7-3)

i.e.,

7-1
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen

M&x&(t ) + Bx& (t ) + Kx(t ) = f (t ) (7-4)

which is the dynamic equation of the MBK system.

For the mechanical system, the external force f(t) is the input and the deviation

x(t) is commonly chosen as the output. Let the Laplace transforms be F(s) and X(s),

then the system (7-4) can be described as

(Ms 2
)
+ Bs + K X (s ) = F (s ) (7-5)

The transfer function is then obtained as


X (s ) a0
H (s ) =
1
= = k0 2 (7-6)
F (s ) Ms + Bs + K
2
s + a1 s + a 0
B K 1
where a1 = , a0 = and k 0 = . Clearly, it is a low-pass filter and can reject
M M K

high-frequency inputs. For convenience, we define a 0 = ω n2 and a1 = 2ξω n and

rewrite the transfer function in (7-6) as


ω n2
H (s ) = k 0 (7-7)
s 2 + 2ξω n s + ω n2
where ωn is the natural frequency and ξ is the damping ratio. The analysis of (7-7) has

been introduced in some fundamental courses.

x20=0 x2(t) x10=0 x1(t)

k2 k1
f(t)
b2 m2 b1 m1

Figure7-2

Let’s further consider a more complicated mechanical structure depicted in

Figure7-2 where two masses m1 and m2 are linked to two dampers b1 and b2 and two

springs k1 and k2. Let f(t) be the extra force and assume x1(t) and x1(t) are the

deviations of the springs referred to their unforced cases x10=0 and x20=0. According to

the Newton’s second law of motion, we have


7-2
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen

f (t ) + f b1 (t ) + f k 1 (t ) = m1 &x&1 (t ) (7-8)

f b 2 (t ) + f k 2 (t ) − f b1 (t ) − f k 1 (t ) = m 2 &x&2 (t ) (7-9)

where

f b1 (t ) = −b1 ( x&1 (t ) − x& 2 (t )) (7-10)

f k 1 (t ) = − k1 (x1 (t ) − x 2 (t )) (7-11)

f b 2 (t ) = −b2 x& 2 (t ) (7-12)

f k 2 (t ) = − k 2 x 2 (t ) (7-13)

Therefore, (7-8) and (7-9) can be rewritten as

m1 &x&1 (t ) = −b1 x&1 (t ) + b1 x& 2 (t ) − k1 x1 (t ) + k1 x 2 (t ) + f (t ) (7-14)

m2 &x&2 (t ) = b1 x&1 (t ) − (b1 + b2 )x& 2 (t ) + k1 x1 (t ) − (k1 + k 2 )x 2 (t ) (7-15)

which are the dynamic equations of two-mass system.

From (7-14) and (7-15), we may know that the dynamic equation of a

mechanical system will become much more complicated if the number of masses are

further increased. To deal with the modeling of a system with n masses, the famous

Lagrange’s equations

d  ∂L  ∂L
  − = Qi , i=1,2,…,n (7-16)
dt  ∂q& i  ∂qi

are often employed to simplify the procedure, where qi is the i-th generalized

coordinate, q&i is its derivative, Qi is the i-th generalized force and L = T − U is a

scalar function called Lagrangian. Clearly, the Lagrangian L is the difference between

the total kinetic energy T and the total potential energy U. Note that the kinetic energy

T depends on the generalized coordinates qi and their derivatives q&i , i=1,2,…,n,

while the potential energy only depends on the generalized coordinates qi. Hence,

substituting L = T − U into (7-16) yields

7-3
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen

d  ∂T  ∂T ∂U
  − + = Qi , i=1,2,…,n (7-17)
dt  ∂q& i  ∂q i ∂q i

∂U
where the truth of = 0 is used.
∂q& i

Now, instead of Newton’s second law, let’s derive (7-14) and (7-15) by the

Lagrange’s equations (7-17). First, the total kinetic energy is

m1 x&12 (t ) + m2 x& 22 (t )
1 1
T= (7-18)
2 2
and the total potential energy is

k1 ( x1 (t ) − x 2 (t )) + k 2 x 22 (t )
1 1
U=
2
(7-19)
2 2
From (7-17), we need to calculate the following terms:

d  ∂T 
  = m1 &x&1 (t ) (7-20)
dt  ∂x&1 

d  ∂T 
  = m2 &x&2 (t ) (7-21)
dt  ∂x& 2 
∂T
=0 (7-22)
∂x1
∂T
=0 (7-23)
∂x 2
∂U
= k1 ( x1 (t ) − x 2 (t )) (7-24)
∂x1
∂U
= −k1 ( x1 (t ) − x 2 (t )) + k 2 x 2 (t ) (7-25)
∂x 2

Since the mass m1 encounters the external force f(t) and the force caused by the

connected damper − b1 ( x&1 (t ) − x& 2 (t )) along the coordinate x1, we have

Q1=f(t) − b1 ( x&1 (t ) − x& 2 (t )) (7-26)

As for the mass m2, it encounters the forces caused by the connected dampers

− b1 ( x& 2 (t ) − x&1 (t )) and − b2 x& 2 (t ) . This results in

Q2= − b1 ( x& 2 (t ) − x&1 (t )) − b2 x& 2 (t ) (7-27)

7-4
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen

Hence, according to (7-17)

d  ∂T  ∂T ∂U
  − + = Qi , i=1,2 (7-28)
dt  ∂x& i  ∂xi ∂xi

the dynamic equations of the two-mass system are

m1 &x&1 (t ) + k1 ( x1 (t ) − x 2 (t )) = f (t ) − b1 (x&1 (t ) − x& 2 (t )) (7-29)

m2 &x&2 (t ) − k1 ( x1 (t ) − x 2 (t )) + k 2 x 2 (t ) = −b1 (x& 2 (t ) − x&1 (t )) − b2 x& 2 (t ) (7-30)

i.e.,

m1 &x&1 (t ) = −b1 x&1 (t ) + b1 x& 2 (t ) − k1 x1 (t ) + k1 x 2 (t ) + f (t ) (7-31)

m2 &x&2 (t ) = b1 x&1 (t ) − (b1 + b2 )x& 2 (t ) + k1 x1 (t ) − (k1 + k 2 )x 2 (t ) (7-32)

both similar to (7-14) and (7-15).

Now, let’s derive the Lagrange’s equations for N masses, denoted as m1, m2, …,

mN, and their positions are described by the Cartesian coordinates. Since each mass is

given by three coordinates, the total coordinates are xi, i=1,2,…,3N. For simplicity, we

assume the first mass m1 is located at (x1, x2, x3), the second mass m2 is located at (x4,

x5, x6), and so on. As a result, the total kinetic energy is


1 3N
T= ∑
2 i =1
mi′ x& i2 (7-33)

where mi′ = m[( 2+i ) / 3] . Further assume the system will be represented in terms of

generalized coordinates qj, j=1,2,…,n. This implies each coordinate xi can be

expressed as a function of qj, j=1,2,…,n. Hence, we have


n
∂xi ∂x
x& i = ∑ q& j + i (7-34)
j =1 ∂q j ∂t

which leads to
2
1 3 N  n ∂xi ∂x 
T = ∑ mi′ ∑ q& j + i  (7-35)
2 i =1  j =1 ∂q j ∂t 

If we define the generalized momentum with respect to qk, k=1,2,…,n, as

7-5
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen

∂T 3N
∂x& 3N
∂x
pk = = ∑ mi′ x& i i = ∑ mi′ x& i i (7-36)
∂q& k i =1 ∂q& k i =1 ∂q k
∂x& i ∂x
where the truth of = i can be obtained from (7-34). Differentiating pk with
∂q& k ∂q k
3N
∂xi 3 N d  ∂x 
p& k = ∑ mi′&x&i + ∑ mi′ x& i  i  (7-37)
i =1 ∂q k i =1 dt  ∂q k 
∂xi
where is also a function of t and qj j1,2,…,n. Thus,
∂qk

d  ∂xi  n ∂ 2 xi ∂ 2 xi
  = ∑ q& j + (7-38)
dt  ∂q k  j =1 ∂q j ∂q k ∂t∂q k

From (7-34), we have

∂x& i n
∂ 2 xi ∂ 2 xi
=∑ q& j + (7-39)
∂q k j =1 ∂q j ∂q k ∂t∂q k

Both (7-38) and (7-39) are the same, i.e.,

d  ∂xi  ∂x& i
  = (7-40)
dt  ∂q k  ∂q k

which will change (7-37) into


3N
∂xi 3 N ∂x&
p& k = ∑ mi′&x&i + ∑ mi′ x& i i (7-41)
i =1 ∂q k i =1 ∂q k
3N
∂x& i
Its last term ∑ m′x&
i =1
i i
∂q k
can be also shown related to the kinetic energy (7-33) as

below:
∂T 3N
∂x&
= ∑ mi′ x& i i (7-42)
∂q k i =1 ∂q k
Therefore, we have
3N
∂xi ∂T
p& k = ∑ mi′&x&i + (7-43)
i =1 ∂q k ∂q k
According to the Newton’s second law, the mass mi should obey the following

equation

mi′&x&i = Fi + Ri (7-44)

7-6
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen

where Fi represents the sum of the applied forces and Ri is the sum of the workless

constraint forces. Now, (7-43) is written as


3N
∂xi 3 N ∂x ∂T
p& k = ∑ Fi + ∑ Ri i + (7-45)
i =1 ∂q k i =1 ∂q k ∂q k
For the sum of the workless constraint forces Ri, we assume it has done a virtual work

δW by moving a virtual displacement, expressed as

n
 3N ∂xi 
δW = ∑  ∑ Ri δq j = 0 (7-46)
j =1  i =1 ∂q k 

Note that the virtual work δW done by constraint forces should be zero for any
3N
∂xi
independent virtual displacement δq j . This implies the term ∑ R ∂q
i =1
i in (7-46)
k

should be zero, i.e.,


3N
∂xi
∑R
i =1
i
∂q k
=0 (7-47)

Consequently, (7-45) becomes


∂T
p& k = Qk + (7-48)
∂q k

where
3N
∂xi
Qk = ∑ Fi (7-49)
i =1 ∂q k
is defined as the generalized force Qk with respect to qk. Further from the definition of
∂T
pk = in (7-36), we rewrite (7-48) as
∂q& k

d  ∂T  ∂T
  − = Qk , k=1,2,…,n (7-50)
dt  ∂q& k  ∂q k

whish are known as the fundamental form of Lagrange’s equations.

Under the condition that the system only encounters the conservative forces, all

the generalized forces Qk can be obtained by the gradient of the potential energy V

with respect to qk. The generalized forces Qk, k=1,2,…,n, are then expressed as

7-7
NCTU Department of Electrical and Computer Engineering 2015 Spring Course
<Dynamic System Simulation and Implementation> by Prof. Yon-Ping Chen

∂V
Qk = − , k=1,2,…,n (7-51)
∂q k

As a result, the Lagrange’s equations under conservative forces are governed by

d  ∂T  ∂T ∂V
  − + = 0 , k=1,2,…,n (7-52)
dt  ∂q& k  ∂q k ∂q k

In case that there are non-conservative forces applying to the system, the Lagrange’s

equations will be described as

d  ∂T  ∂T ∂V
  − + = Qk , k=1,2,…,n (7-53)
dt  ∂q& k  ∂q k ∂q k

where Qk, k=1,2,…,n, are the non-conservative forces. The standard form of

Lagrange’s equations are then shown as

d  ∂L  ∂L
  − = Qk , k=1,2,…,n (7-54)
dt  ∂q& k  ∂q k

where L=T−V is called the Lagrangian. Note that here uses the truth that the potential

energy V is independent to q& k , the derivative of generalized coordinates q k .

7-8

You might also like