Analytical dynamics with constraint forces

that do work in virtual displacements
Robert Kalaba
*
, Firdaus Udwadia
Department of Biomedical Engineering, University of Southern California,
OHE-500 University Park, Los Angeles, CA 90089-1451, USA
Abstract
Lagrangian mechanics is extended to cover situations in which constraint forces are
permitted to do work on a system in virtual displacements. Ó 2001 Elsevier Science
Inc. All rights reserved.
Keywords: Lagrangian mechanics; Pseudoinverse of a matrix; Principle of virtual work
1. Introduction
Much of analytical dynamics is studied under the assumption that the
constraint forces do no work on the system in any virtual displacement. Yet, it
is clear that constraint forces such as friction do do work on the system in
virtual displacements. The purpose of this paper is to show how such
constraint forces may be taken into account in a systematic and convenient
manner. A new physical principle which generalizes the principle of virtual
work must be adduced.
Let the con®guration of the system be described by the n generalized
coordinates q
1
; q
2
; . . . ; q
n
. Then the Lagrange equations of motion may be
written as
Mq = Q; (1)
Applied Mathematics and Computation 121 (2001) 211±217
www.elsevier.com/locate/amc
*
Corresponding author. Tel.: +1-213-740-0347; fax: +1-213-740-0343.
0096-3003/01/$ - see front matter Ó 2001 Elsevier Science Inc. All rights reserved.
PII: S0096- 3003( 99) 00291- X
where M is a positive de®nite symmetric matrix having dimensions n by n and
depending on t and q. The generalized force vector Q is a function of t, q and _ q,
and is n-dimensional. The generalized acceleration vector q is
q = (q
1
; q
2
; . . . ; q
n
)
T
; (2)
and, of course,
q = (q
1
; q
2
; . . . ; q
n
)
T
:
The n-dimensional vector _ q is the generalized velocity vector.
Next assume that m constraints are speci®ed of the form
u
j
(t; q; _ q) = 0; j = 1; 2; . . . ; m: (3)
Then di€erentiation of both sides of these equations with respect to t yields the
di€erentiated form of the constraint equation
Aq = b; (4)
where A, a function of t; q and _ q, is m by n, and b, also a function of t; q, and _ q,
is an m-dimensional vector. Holonomic constraints are di€erentiated twice and
nonholonomic constraints are di€erentiated once with respect to time to obtain
Eq. (4). Together with initial conditions at some time these are equivalent to
Eq. (3). We assume that the rank of A is r 6m. The number of equality con-
straints m need not be less than n. We assume, though, that they are consistent.
The actual equation of motion then assumes the form
Mq = Q ÷ Q
c
; (5)
where Q
c
is the generalized constraint force vector called into existence to
maintain the constraints but do no work on the system in a virtual displace-
ment. In Eqs. (4) and (5) there are 2n unknowns, the components of q and Q
c
,
but there are only n ÷ r prescribed conditions. The needed n ÷ r additional
linear relations are provided, conventionally, by the principle of virtual work,
which requires that the constraint force Q
c
do no work in a virtual displace-
ment. This amounts to requiring that
v
T
Q
c
= 0 (6)
for all virtual displacements vectors v, of dimension n, for which
Av = 0:
The solution of the system of Eqs. (4)±(6) is [1]
q = a ÷ M
÷1=2
(AM
÷1=2
)
÷
(b ÷ Aa); (7)
where a = M
÷1
Q. The n-dimensional vector a is the generalized acceleration of
the system that is free of constraints. Eq. (7) may be written as
212 R. Kalaba, F. Udwadia / Appl. Math. Comput. 121 (2001) 211±217
Mq = Q ÷ M
1=2
(AM
÷1=2
)
÷
(b ÷ Aa); (8)
so that
Q
c
= Q
N
= M
÷1=2
(AM
1=2
)
÷
(b ÷ Aa); (9)
is the generalized constraint force called into play to maintain the constraints
while doing no work on the system in any virtual displacement.
2. Constraints forces that do work on the system
Now let us consider the incorporation of constraint forces which may do
work on the system in a virtual displacementÐfriction is an example. We
denote the n-dimensional vector of such forces as c = c(t; q; _ q). In any dis-
placement v such forces do the work v
T
c. Therefore, in a virtual displacement v,
for which Av = 0, the actual constraint force, Q
c
, will have to do the same
amount of work, so that
v
T
Q
c
= v
T
c; (10)
which is a new physical principle. It generalizes Eq. (6), the principle of virtual
work. Under the new principle the work done by the constraint forces in a
virtual displacement may be positive or negative as well as zero.
The vectors q and Q
c
are thus to be determined by the relations
Mq = Q ÷ Q
c
; (11)
Aq = b; (12)
and
v
T
Q
c
= v
T
c (v such that Av = 0): (13)
The task now is to solve these equations for q and Q
c
. (It can be shown that a
solution exists and is unique.) Needed background concerning pseudoinverses
is available in [1, Chapter 2].
3. Derivation of the new explicit equation of motion
We introduce
B = AM
÷1=2
; (14)
r = M
1=2
q; (15)
R. Kalaba, F. Udwadia / Appl. Math. Comput. 121 (2001) 211±217 213
so that Eq. (12) becomes
Br = b: (16)
The general solution of this equation is
r = B
÷
b ÷ (I ÷ B
÷
B)w; (17)
where B
÷
is the n by m pseudoinverse of the matrix B, and w is an arbitrary
n-dimensional vector. We wish to determine this vector. The equation Av = 0
can be rewritten as
Bu = 0; (18)
where u = M
1=2
v. It follows, then, from Eqs. (13) and (11), that for all u such
that Bu = 0,
u
T
M
÷1=2
[Mq ÷ Q[ = u
T
M
÷1=2
c: (19)
But this equation can be rewritten as
u
T
M
÷1=2
[Mq ÷ Q ÷ c[ = 0; (20)
or
u
T
[r ÷ Q ÷ c[ = 0; (21)
where
M
÷1=2
Q = Q; (22)
and
M
÷1=2
c = c: (23)
The general solution of Eq. (18) has the form
u = (I ÷ B
÷
B)z; (24)
where z is an arbitrary n-dimensional vector. Eq. (21) becomes
z
T
I ( ÷ B
÷
B) B
÷
b
Â
÷ I ( ÷ B
÷
B)w ÷ Q ÷ c
Ã
= 0; (25)
where we have used Eq. (17). It follows that
z
T
I ( ÷ B
÷
B) w
Â
÷ Q ÷ c
Ã
= 0: (26)
From this it follows that the vector
w ÷ Q ÷ c = B
÷
z
1
; (27)
where z
1
is again arbitrary. Upon substituting the value w = Q ÷ c ÷ B
÷
z
1
into
Eq. (17) we ®nd
r = B
÷
b ÷ (I ÷ B
÷
B)(Q ÷ c): (28)
214 R. Kalaba, F. Udwadia / Appl. Math. Comput. 121 (2001) 211±217
From this it follows that
M
1=2
q = B
÷
b ÷ (I ÷ B
÷
B)(M
÷1=2
Q ÷ M
÷1=2
c);
q = M
÷1=2
B
÷
b ÷ M
÷1
Q ÷ M
÷1=2
B
÷
BM
÷1=2
Q ÷ M
÷1=2
(I ÷ B
÷
B)M
÷1=2
c:
(29)
Finally, we have the desired equation of motion
q = a ÷ M
÷1=2
B
÷
(b ÷ Aa) ÷ M
÷1=2
(I ÷ B
÷
B)M
÷1=2
c; (30)
which may be rewritten in the form
Mq = Q ÷ M
1=2
B
÷
(b ÷ Aa) ÷ M
1=2
(I ÷ B
÷
B)M
÷1=2
c: (31)
The ®rst two terms on the right side have been seen before in Eq. (8). They are
the applied force Q and the constraint force Q
N
that does no work in any
virtual displacement but maintains the constraints, Aq = b. The third term is
occasioned by the speci®ed constraint force c that does work in a virtual dis-
placement. We may denote it by Q
W
, so that Eq. (31) assumes the elegant form
Mq = Q ÷ Q
N
÷ Q
W
; (32)
with
Q
W
= M
1=2
(I ÷ B
÷
B)M
÷1=2
c; (33)
and
Q
N
= M
1=2
B
÷
(b ÷ Aa): (33
/
)
Thus the constraint force Q
c
has two components and may be written
Q
c
= Q
N
÷ Q
W
; (34)
where the forms of Q
N
and Q
W
are as shown above.
Equation (31) is the explicit equation of motion for mechanical systems that
have constraint forces that may do work on the system in a virtual displace-
ment. Equation (30) is the form that is used for numerical integration.
4. An example
Consider a bead of unit mass that moves along a vertical circle of unit radius
under the in¯uence of gravity. We introduce the rectangular coordinates x
1
and
x
2
. Then
M =
1 0
0 1

and a =
0
÷g

:
R. Kalaba, F. Udwadia / Appl. Math. Comput. 121 (2001) 211±217 215
The constraint equation x
2
1
÷ x
2
2
= 1 leads, through two di€erentiations with
respect to t, to the linear constraint on the acceleration components
x
1
x
1
÷ x
2
x
2
= ÷(_ x
2
1
÷ _ x
2
2
). From this we see that A = (x
1
x
2
), a 1 by 2 matrix
and b = ÷(_ x
2
1
÷ _ x
2
2
), a scalar. If no friction is present, the equation of motion is
simply
x =
x
1
x
2

::
= a ÷ A
÷
(b ÷ Aa): (35)
Since A = (x
1
x
2
), its pseudoinverse, A
÷
, is
A
÷
=
1
x
2
1
÷ x
2
2
x
1
x
2

: (36)
The equation of motion is thus
x
1
x
2

::
=
0
÷g

÷
1
x
2
1
÷ x
2
2
x
1
x
2

gx
2
h
÷ (_ x
2
1
÷ _ x
2
2
)
i
=
0
÷g

÷ Q
N
; (37)
since
÷Aa = ÷(x
1
x
2
)
0
÷g

= ÷gx
2
:
Let us assume that the force of friction, the usual Coulomb friction force, c,
is speci®ed as being ``proportional to the normal thrust''. This means that
c = ÷l
1

_ x
2
1
÷ x
2
2
p
_ x
1
_ x
2

[Q
N
[; (38)
where, according to Eq. (37), the normal thrust, Q
N
, is given by
Q
N
=
1
x
2
1
÷ x
2
2
x
1
x
2

gx
2
h
÷ (_ x
2
1
÷ _ x
2
2
)
i
: (39)
The constant l is the coecient of friction. If follows from Eq. (30) that the
equation of motion, including friction, is
x
1
x
2

::
=
0
÷g

÷
1
x
2
1
÷ x
2
2
x
1
x
2

gx
2
h
÷ (_ x
2
1
÷ _ x
2
2
)
i
÷ I
&
÷
1
x
2
1
÷ x
2
2
x
1
x
1
x
1
x
2
x
2
x
1
x
2
x
2
'
c; (40)
where c is speci®ed in Eq. (38).
In view of the fact that one di€erentiation of the constraint x
2
1
÷ x
2
2
= 1 gives
x
1
_ x
1
÷ x
2
_ x
2
= 0, we see that the last term on the right in Eq. (40) simpli®es to
¦I ÷ O¦c = c, in this special case. In general, Eq. (33) shows that if the vector
216 R. Kalaba, F. Udwadia / Appl. Math. Comput. 121 (2001) 211±217
M
÷1=2
c lies in the null space of the matrix B, then Q
W
= c; if M
÷1=2
c lies in the
range space of B
T
, then Q
W
= 0.
5. Discussion
A simple and comprehensive method for incorporating into Lagrangian
mechanics the e€ects of constraint forces that may do work on a system in a
virtual displacement has been given. First, a generalized form of the principle
of virtual work was given in Section 2. Then the new equations of motion were
given in Section 3, and an example was adumbrated in Section 4. Since modern
computing environments, such as MATLAB, contain commands for obtaining
pseudoinverses of matrices, numerical experiments are now under way, and
results will be reported subsequently.
Reference
[1] F. Udwadia, R. Kalaba, in: Analytical Dynamics, Cambridge University Press, New York,
1996.
R. Kalaba, F. Udwadia / Appl. Math. Comput. 121 (2001) 211±217 217

and q. and is n-dimensional. . q q q q and. Math. Holonomic constraints are di€erentiated twice and nonholonomic constraints are di€erentiated once with respect to time to obtain Eq. Udwadia / Appl. . j ˆ 1. q and q. (3). We assume that the rank of A is r 6 m. a function of t. qn † : _ The n-dimensional vector q is the generalized velocity vector. . The generalized acceleration vector  is q  ˆ …1 . . The number of equality constraints m need not be less than n. 121 (2001) 211±217 where M is a positive de®nite symmetric matrix having dimensions n by n and _ depending on t and q.212 R. q† ˆ 0. (4) and (5) there are 2n unknowns. (4)±(6) is [1]  ˆ a ‡ M À1=2 …AM À1=2 †‡ …b À Aa†. 2. by the principle of virtual work. 2 . The actual equation of motion then assumes the form M ˆ Q ‡ Qc . q2 . F. q ˆ …q1 . (7) may be written as …6† T …2† . . . Eq. (4). n †T . for which Av ˆ 0: The solution of the system of Eqs. q and q. . is m by n. q. Next assume that m constraints are speci®ed of the form _ uj …t. q but there are only n ‡ r prescribed conditions. q. m: …3† Then di€erentiation of both sides of these equations with respect to t yields the di€erentiated form of the constraint equation A ˆ b. of course. This amounts to requiring that vT Qc ˆ 0 for all virtual displacements vectors v. also a function of t. . the components of  and Qc . and b. that they are consistent. The generalized force vector Q is a function of t. though. . q …4† _ _ where A. . q …7† where a ˆ M À1 Q. . We assume. q …5† where Qc is the generalized constraint force vector called into existence to maintain the constraints but do no work on the system in a virtual displacement. Comput. In Eqs. is an m-dimensional vector. conventionally. of dimension n. The n-dimensional vector a is the generalized acceleration of the system that is free of constraints. . The needed n À r additional linear relations are provided. Together with initial conditions at some time these are equivalent to Eq. which requires that the constraint force Qc do no work in a virtual displacement. Kalaba.

for which Av ˆ 0. Qc . q A ˆ b. q and vT Qc ˆ vT c …v such that Av ˆ 0†: …13† …11† …12†  The task now is to solve these equations for q and Qc . the principle of virtual work. …10† which is a new physical principle.) Needed background concerning pseudoinverses is available in [1. Therefore. Constraints forces that do work on the system Now let us consider the incorporation of constraint forces which may do work on the system in a virtual displacementÐfriction is an example. (It can be shown that a solution exists and is unique. 121 (2001) 211±217 213 M ˆ Q ‡ M 1=2 …AM À1=2 † …b À Aa†. Under the new principle the work done by the constraint forces in a virtual displacement may be positive or negative as well as zero. The vectors  and Qc are thus to be determined by the relations q M ˆ Q ‡ Qc . ‡ ‡ …8† …9† is the generalized constraint force called into play to maintain the constraints while doing no work on the system in any virtual displacement. 2.  ˆ M 1=2 . Derivation of the new explicit equation of motion We introduce B ˆ AM À1=2 . r q …14† …15† . Math. In any displacement v such forces do the work vT c. (6). F. We _ denote the n-dimensional vector of such forces as c ˆ c…t. so that vT Qc ˆ vT c. It generalizes Eq. Kalaba. 3. q. Comput. will have to do the same amount of work. Chapter 2]. q†. in a virtual displacement v. the actual constraint force. Udwadia / Appl.R. q so that Qc ˆ QN ˆ M À1=2 …AM 1=2 † …b À Aa†.

Upon substituting the value w ˆ Q ‡ c ‡ B‡ z1 into Eq. q or r uT ‰ À Q À cŠ ˆ 0. and M À1=2 c ˆ c: The general solution of Eq. We wish to determine this vector. (17) we ®nd  ˆ B‡ b ‡ …I À B‡ B†…Q ‡ c†: r …28† . (21) becomes  à zT … I À B‡ B† B‡ b ‡ … I À B‡ B†w À Q À c ˆ 0. (12) becomes B ˆ b: r The general solution of this equation is  ˆ B‡ b ‡ …I À B‡ B†w. 121 (2001) 211±217 so that Eq. Comput. where z1 is again arbitrary. and w is an arbitrary n-dimensional vector. where M À1=2 Q ˆ Q. Math. that for all u such …19† …20† …21† …22† …23† …24† …25† …26† …27† uT M À1=2 ‰M À QŠ ˆ uT M À1=2 c: q But this equation can be rewritten as uT M À1=2 ‰M À Q À cŠ ˆ 0. Eq. It follows. (18) has the form u ˆ …I À B‡ B†z. r …17† where B‡ is the n by m pseudoinverse of the matrix B. Udwadia / Appl. 1=2 …16† …18† v. where z is an arbitrary n-dimensional vector.214 R. The equation Av ˆ 0 can be rewritten as Bu ˆ 0. (17). F. where we have used Eq. (13) and (11). Kalaba. where u ˆ M that Bu ˆ 0. from Eqs. then. It follows that  à zT … I À B‡ B† w À Q À c ˆ 0: From this it follows that the vector w À Q À c ˆ B‡ z1 .

121 (2001) 211±217 215 From this it follows that M 1=2  ˆ B‡ b ‡ …I À B‡ B†…M À1=2 Q ‡ M À1=2 c†. They are the applied force Q and the constraint force QN that does no work in any virtual displacement but maintains the constraints. with QW ˆ M 1=2 …I À B‡ B†M À1=2 c. and QN ˆ M 1=2 B‡ …b À Aa†: Thus the constraint force Qc has two components and may be written Qc ˆ QN ‡ QW . so that Eq. Udwadia / Appl. 4. (8). A ˆ b. An example Consider a bead of unit mass that moves along a vertical circle of unit radius under the in¯uence of gravity. Math. we have the desired equation of motion  ˆ a ‡ M À1=2 B‡ …b À Aa† ‡ M À1=2 …I À B‡ B†M À1=2 c. (31) assumes the elegant form q M ˆ Q ‡ QN ‡ QW . …34† where the forms of QN and QW are as shown above. Then     1 0 0 Mˆ and a ˆ : 0 1 Àg …33 † H …32† …33† . We may denote it by QW . F. Equation (31) is the explicit equation of motion for mechanical systems that have constraint forces that may do work on the system in a virtual displacement. Kalaba. The third term is q occasioned by the speci®ed constraint force c that does work in a virtual displacement. We introduce the rectangular coordinates x1 and x2 . q  ˆ M À1=2 B‡ b ‡ M À1 Q À M À1=2 B‡ BM À1=2 Q ‡ M À1=2 …I À B‡ B†M À1=2 c: q …29† Finally. Comput. Equation (30) is the form that is used for numerical integration.R. q which may be rewritten in the form M ˆ Q ‡ M 1=2 B‡ …b À Aa† ‡ M 1=2 …I À B‡ B†M À1=2 c: q …31† …30† The ®rst two terms on the right side have been seen before in Eq.

its pseudoinverse. c. Eq. is given by  h i 1 x1 N Q ˆ 2 x1 _ 2 gx2 À …_ 2 ‡ x2 † : 2 x1 ‡ x2 x2 …39† The constant l is the coecient of friction. This means that   1 _ x1 …38† c ˆ Àl p jQN j. Kalaba. 121 (2001) 211±217 The constraint equation x2 ‡ x2 ˆ 1 leads. (37). a scalar. In view of the fact that one di€erentiation of the constraint x2 ‡ x2 ˆ 1 gives 1 2 _ _ x1 x1 ‡ x2 x2 ˆ 0. the equation of motion is x1 _ 2 simply  :: x1 ˆ ˆ a ‡ A‡ …b À Aa†: …35† x x2 Since A ˆ …x1 x2 †. (33) shows that if the vector . If follows from Eq. is   1 x1 A‡ ˆ 2 : x1 ‡ x2 x2 2 …36† The equation of motion is thus    ::   h i  1 0 0 x1 x1 ˆ ‡ 2 ‡ QN . QN . in this special case. the normal thrust. Udwadia / Appl. A‡ . x1 _ 2 gx2 À …_ 2 ‡ x2 † ˆ Àg Àg x2 x1 ‡ x2 x2 2 since ÀAa ˆ À…x1 x2 †  0 Àg  ˆ ‡gx2 : …37† Let us assume that the force of friction. is   ::   h i 0 x1 x1 1 ˆ ‡ 2 x1 _ 2 gx2 À …_ 2 ‡ x2 † x1 ‡ x2 x2 Àg x2 2 &  ' x1 x1 x1 x2 1 ‡ IÀ 2 c. (38). F. (30) that the equation of motion. through two di€erentiations with 1 2 respect to t. Math. according to Eq. In general. a 1 by 2 matrix x1 _ 2 x x and b ˆ À…_ 2 ‡ x2 †. including friction. is speci®ed as being ``proportional to the normal thrust''. From this we see that A ˆ …x1 x2 †. Comput. to the linear constraint on the acceleration components x11 ‡ x22 ˆ À…_ 2 ‡ x2 †. we see that the last term on the right in Eq. …40† x1 ‡ x2 x2 x1 x2 x2 2 where c is speci®ed in Eq.216 R. If no friction is present. _ _ x2 ‡ x2 x2 1 2 where. the usual Coulomb friction force. (40) simpli®es to fI À Ogc ˆ c.

contain commands for obtaining pseudoinverses of matrices. then QW ˆ c. then QW ˆ 0. Reference [1] F. and results will be reported subsequently. Math. . in: Analytical Dynamics. a generalized form of the principle of virtual work was given in Section 2. Comput. numerical experiments are now under way. 121 (2001) 211±217 217 M À1=2 c lies in the null space of the matrix B. Then the new equations of motion were given in Section 3. such as MATLAB. New York. Udwadia / Appl. Udwadia. Kalaba. Cambridge University Press. Discussion A simple and comprehensive method for incorporating into Lagrangian mechanics the e€ects of constraint forces that may do work on a system in a virtual displacement has been given.R. F. First. Since modern computing environments. 5. 1996. Kalaba. R. and an example was adumbrated in Section 4. if M À1=2 c lies in the range space of BT .