370 Introduction to numerical methods
2 Define the stabilizing function U
j
U
j
=−αg
j
(q,
˙
q, t) − β
t
0
g
j
dt ( j = 1,...,m) (6.332)
As before, α and β are constants which depend on the step size.
3 Differentiate each constraint function g
j
(q,
˙
q, t) once with respect to time and set the
resulting function equal to the corresponding U
j
˙
g
j
(q,
˙
q,
¨
q, t) = U
j
( j = 1,...,m) (6.333)
4 Substitute the
¨
q
i
expressions from (6.331) into (6.333) and solve for the m λs
λ
j
= λ
j
(q,
˙
q, U, t)(j = 1,...,m) (6.334)
5 Substitute these λ expressions back into (6.331) and obtain the final dynamical equations
¨
q
i
=
¨
q
i
(q,
˙
q, U, t)(i = 1,...,n) (6.335)
The Us are given by (6.332). Usually the dynamical equations are written as 2n first-order
equations.
In general, α should be chosen to be inversely proportional to h, and β should be inversely
proportional to h
2
. Acceptable accuracy can be obtained with β set equal to zero. For
improved accuracy, however, one should choose β to be nonzero at the cost of an additional
numerical integration for each constraint.
Example 6.4 Let us apply the Baumgarte method to a nonholonomic system whose dynam-
ics have been analyzed previously. In these instances, however, the question of numerical
stability was not considered.
The system consists of two particles, each of mass m, which are connected by a massless
rod of length l, and which move on the horizontal xy-plane. There is a knife-edge constraint
at particle 1, as shown in Fig. 6.6, resulting in a nonholonomic constraint of the form
g(q,
˙
q) =−
˙
x sin φ +
˙
y cos φ = 0 (6.336)
This equation states that the velocity component of particle 1 in a direction normal to the
rod is always zero.
Let us use Lagrange’s equation in the form
d
dt
∂T
∂
˙
q
i
−
∂T
∂q
i
=
m
j=1
λ
j
∂g
j
∂
˙
q
i
(i = 1,...,n) (6.337)
The generalized coordinates are (x, y,φ) and the kinetic energy, assuming no constraints,
is
T = m(
˙
x
2
+
˙
y
2
) +
1
2
ml
2
˙
φ
2
+ ml
˙
φ(−
˙
x sin φ +
˙
y cos φ) (6.338)