Professional Documents
Culture Documents
Lagrange's Equations: T X B T F T KX T F
Lagrange's Equations: T X B T F T KX T F
7. Lagrange’s Equations
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
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
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
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
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),
(Ms 2
)
+ Bs + K X (s ) = F (s ) (7-5)
k2 k1
f(t)
b2 m2 b1 m1
Figure7-2
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
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 k 1 (t ) = − k1 (x1 (t ) − x 2 (t )) (7-11)
f k 2 (t ) = − k 2 x 2 (t ) (7-13)
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
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
while the potential energy only depends on the generalized coordinates qi. Hence,
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
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
As for the mass m2, it encounters the forces caused by the connected dampers
7-4
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 (7-28)
dt ∂x& i ∂xi ∂xi
i.e.,
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,
where mi′ = m[( 2+i ) / 3] . Further assume the system will be represented in terms of
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
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
∂x& i n
∂ 2 xi ∂ 2 xi
=∑ q& j + (7-39)
∂q k j =1 ∂q j ∂q k ∂t∂q k
d ∂xi ∂x& i
= (7-40)
dt ∂q k ∂q k
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
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
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
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
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
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
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
7-8