Professional Documents
Culture Documents
θ l
" # " # " #
r1 (t) x(θ(t), u(t)) (l + u(t)) sin θ(t)
K u r(t) = = = (3)
r2 (t) y(θ(t), u(t)) −(l + u(t)) cos θ(t)
M
g and " # " #
q1 (t) θ(t)
x = (l+u)sin θ q(t) = = (4)
q2 (t) u(t)
so that r(t) is a function of q(t).
The potential energy, V , may be expressed in terms of r or in terms of q.
In Cartesian coordinates, the velocities are
" # " #
ṙ1 (t) u̇(t) sin θ(t) + (l + u(t)) cos θ(t)θ̇(t)
ṙ(t) = = (5)
ṙ2 (t) −u̇(t) cos θ(t) + (l + u(t)) sin θ(t)θ̇(t)
So, in general, Cartesian velocities ṙ(t) can be a function of both the velocity and position of
some other coordinates (q̇(t) and q(t)). Such coordinates q are called generalized coordinates.
The kinetic energy, T , may be expressed in terms of either ṙ or, more generally, in terms of
q̇ and q.
Small changes (or variations) in the rectangular coordinates, (δx, δy) consistent with all
displacement constraints, can be found from variations in the generalized coordinates (δθ, δu).
∂x ∂x
δx = δθ + δu = (l + u(t)) cos θ(t)δθ + sin θ(t)δu (6)
∂θ ∂u
∂y ∂y
δy = δθ + δu = (l + u(t)) sin θ(t)δθ − cos θ(t)δu (7)
∂θ ∂u
2 CEE 541. Structural Dynamics – Duke University – Fall 2016 – H.P. Gavin
In a dynamic situation, the forces fi can include inertial forces, damping forces, and external
loads. For example,
fi (t) = −M r̈i (t) + pi (t) , (11)
where pi is an external force collocated with the displacement coordinate ri . Substituting
equation (11) into equation (10), and rearranging slightly, results in the d’Alembert-Lagrange
equations, the same as equation (8) found from the principle of virtual displacements,
n
!
X ∂V
M r̈i (t) + − pi (t) δri = 0 . (12)
i=1 ∂ri
In equations (8) and (12) the virtual displacements (i.e., the variations) δri must be arbitrary
and independent of one another; these equations must hold for each coordinate ri individually.
∂V
M r̈i (t) + − pi (t) = 0 . (13)
∂ri
1
d’Alembert, J-B le R, 1743
2
In solid mechanics, internal strain energy is conventionally assigned the variable U , whereas the potential
energy of external forces is conventionally assigned the variable V . In Lagrange’s equations potential energy
is assigned the variable V and kinetic energy is denoted by T .
Now, consider the kinetic energy of a constant mass M . The kinetic energy in terms of
velocities in Cartesian coordinates is given by T (ṙ) = 12 M (ṙ12 + ṙ22 ), and
∂T
δri = M ṙi δri . (15)
∂ ṙi
P
Equation (18) is a step to getting the work of inertial forces ( i M r̈i δri ) in terms of a set of
generalized coordinates qj . Next, changing the derivatives of the potential energy from ri to
qj ,
m
∂V X ∂V ∂qj ∂ri
δri = δqj . (19)
∂ri j=1 ∂qj ∂ri ∂qj
Finally, expressing the work of non-conservative forces pi in terms of the new coordinates qj ,
n n m m X n m
X X X ∂ri X ∂ri X
pi (t) δri = pi (t) δqj = pi (t) δqj = Qj (t) δqj , (20)
i=1 i=1 j=1 ∂qj j=1 i=1 ∂qj j=1
where Qj (t) are generalized forces, collocated with the generalized coordinates, qj (t). Sub-
stituting equations (18), (19) and (20) into equation (12), rearranging the order of the sum-
mations, factoring out the common δqj , canceling the ∂ri and ∂ ṙi terms, and eliminating the
The variations δqj must be arbitrary and independent of one another; this equation must
hold for each generalized coordinate qj individually. Removing the summation over j and
canceling out the common δqj factor results in Lagrange’s equations,3
!
d ∂T ∂T ∂V
− + − Qj = 0 (21)
dt ∂ q̇j ∂qj ∂qj
5 The Lagrangian
Lagrange’s equations may be expressed more compactly in terms of the Lagrangian of
the energies,
L(q, q̇, t) ≡ T (q, q̇, t) − V (q, t) (22)
Since the potential energy V depends only on the positions, q, and not on the velocities, q̇,
Lagrange’s equations may be written,
!
d ∂L ∂L
− − Qj = 0 (23)
dt ∂ q̇j ∂qj
3
Lagrange, J.L., Mecanique analytique, Mm Ve Courcier, 1811.
with end points q1 = q(t1 ) and q2 = q(t2 ). Consider the true path of q(t) from t1 to t2 and
a variation δq(t) such that δq(t1 ) = 0 and δq(t2 ) = 0.
Hamilton’s principle:4
The solution q(t) is an extremum of the action potential S[q(t)]
⇐⇒ δS[q(t)] =0
Z t2
⇐⇒ δL(q, q̇, t) dt = 0
t1
Substituting the Lagrangian into Hamilton’s principle,
Z t2 (X " #)
∂T ∂T ∂V
δ q̇i + δqi − δqi dt = 0
t1 i ∂ q̇i ∂qi ∂qi
We wish to factor out the independent variations δqi , however the first term contains the
variation of the derivative, δ q̇i . If the conditions for admissible variations in position δq
fully specify the conditions for admissible variations in velocity δ q̇, the variation and the
differentiation can be transposed,
d
δqi = δ q̇i , (26)
dt
and we can integrate the first term by parts,
Z t2 " #t2 Z t2 !
∂T ∂T d ∂T
δ q̇i = δqi − δqi dt
t1 ∂ q̇i ∂ q̇i t1 t1 dt ∂ q̇i
The variations δqi must be arbitrary, so the term within the square brackets must be zero
for all i. !
d ∂T ∂T ∂V
− + = 0.
dt ∂ q̇i ∂qi ∂qi
4
Hamilton, W.R., “On a General Method in Dynamics,” Phil. Trans. of the Royal Society Part II (1834)
pp. 247-308; Part I (1835) pp. 95-144
7 A Little History
fi dt = d(mi vi )
(fi − mi ai )δri = 0
P
d ∂L ∂L
dt ∂ q̇i
− ∂qi
= Qi
G = 12 (q̈ − a)T M(q̈ − a)
δG = 0
R t2
S = t1 L(q, q̇, t)dt
δS = 0
CC BY-NC-ND HP Gavin September 6, 2018
Generalized Coordinates and Lagrange’s Equations 7
As can be seen, the inertial terms (involving mass) are more complicated than just
M r̈, and can involve position, velocity, and acceleration of the generalized coordinates. By
carefully relating forces in Cartisian coordinates to those in generalized coordinates through
free-body diagrams the same equations of motion may be derived, but doing so with La-
grange’s equations is often more straight-forward once the kinetic and potential energies are
derived.
> with(Physics):
> Setup(mathematicalnotation=true)
> v := diff(u(t),t);
d
v := -- u(t)
dt
> T := (1/2) * M * vˆ2;
/d \2
T := 1/2 M |-- u(t)|
\dt /
The lines above setup Maple to invoke the desired functional notation, define the ve-
locities v as the derivatives of time-dependent displacements u(t), and represent the kinetic
energy T, potential energy V, and the external and non-conservative forces p. The subsequent
lines evaluate the derivatives and combine the derivatives into Lagrange’s equations to give
us the equations of motion.
/ 2 \
|d | /d \
EOM := M |--- u(t)| + K u(t) = -C |-- u(t)| + f(t)
| 2 | \dt /
\dt /
> quit
v[t] = D[u[t], t]
u ’[t]
T[t] = 1 / 2 * M * v[t]ˆ2
(1/2) M u ’ [t] 2
V[t] = 1 / 2 * K * u[t]ˆ2
(1/2) K u[t] 2
ddTdvdt[t] = D[dTdv[t], t]
M u" [t]
For the elastic pendulum problem considered earlier, the first coordinate is θ(t), and is
called q(t) in the Maple commands and q[t] in the Mathematica commands.. The second
coordinate is u(t) . . . called u(t) in Maple and u[t] in Mathematica.
> with(Physics):
> Setup(mathematicalnotation=true)
> v1 := diff(q(t),t);
d
v1 := -- q(t)
dt
> v2 := diff(u(t),t);
d
v2 := -- u(t)
dt
> T := (1/2) * M * (( l+u(t))*v1)ˆ2 + (1/2) * M * v2ˆ2;
2 /d \2 /d \2
T := 1/2 M (l + u(t)) |-- q(t)| + 1/2 M |-- u(t)|
\dt / \dt /
2
V := M g (l - (l + u(t)) cos(q(t))) + 1/2 K u(t)
/ 2 \
/d \ /d \ 2 |d |
EOMq := 2 M (l + u(t)) |-- q(t)| |-- u(t)| + M (l + u(t)) |--- q(t)|
\dt / \dt / | 2 |
\dt /
+ M g (l + u(t)) sin(q(t))
/ 2 \
|d | /d \2
EOMu := M |--- u(t)| - M (l + u(t)) |-- q(t)| - M g cos(q(t)) + K u(t)
| 2 | \dt /
\dt /
Collect[EOMq = D[D[KE, D[q[t], t]], t] + D[PE - KE, q[t]], {q’’[t], q’[t], q[t]}]
g M Sin[q[t]] (l + u[t]) + 2 M (l + u[t]) q’[t] u’[t] + M (l + u[t])ˆ2 q"[t]
Collect[EOMu = D[D[KE, D[u[t], t]], t] + D[PE - KE, u[t]], {u ’’[t], u ’[t], u[t]}]
-g M Cos[q[t]] - l M q’[t]ˆ2 + u[t] (K - M q’[t]ˆ2) + M u"[t]
The Maple and Mathematica expressions EOMq and EOMu are the same equations of
motion as the previously-derived equations (35) and (36).
1 function [ dxdt , TV ] = e l a s t i c _ p e n d u l u m _ s y s (t , x )
2 % [ d x d t ,TV] = e l a s t i c p e n d u l u m s y s ( t , x )
3 % s ys t e m e q u a t i o n s f o r an e l a s t i c pendulum
4 % compute t h e s t a t e d e r i v a t i v e , d x d t , t h e k i n e t i c energy , T, and t h e
5 % p o t e n t i a l energy , V, o f an e l a s t i c pendulum .
6
7 % s ys t e m c o n s t a n t s a r e pre−d e f i n e d g l o b a l v a r i a b l e s ...
8
9 global l g K M
10
11 % define the state vector
12
13 theta = x (1); % r o t a t i o n angle , rad
14 u = x (2); % spring stretch , m
15 theta_dot = x (3); % r ot a ti on rate , rad / s
16 u_dot = x (4); % spring stretch r a t e , m/ s
17
18 % compute t h e a c c e l e r a t i o n o f t h e t a and u
19
20 theta_ddot = -(2* u_dot * theta_dot + g * s i n ( theta )) / ( l + u ); % eq ’ n ( 3 5 )
21
22 u_ddot = ( l + u )* theta_dot ˆ2 - ( K / M )* u + g * cos ( theta ); % eq ’ n ( 3 6 )
23
24 % assemble the s t a t e d e r i v a t i v e
25
26 dxdt = [ theta_dot ; u_dot ; theta_ddot ; u_ddot ];
27
28 TV = [ (1/2) * M * (( l + u ).* theta_dot ).ˆ2 + (1/2) * M * u_dot .ˆ2 ; % K. E . ( 2 5 )
29 M * g *( l -( l + u ).* cos ( theta )) + (1/2) * K * u .ˆ2 ]; % P.E. (26)
30
31
32 % −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− e l a s t i c p e n d u l u m s y s
0.5
θ(t) and u(t)
-0.5
swing, q1(t) = θ(t), rad
stretch, q2(t) = u(t), m
-1
0 5 10 15 20
time, s
6
K.E.
5 P.E.
energies, Joules
4 K.E.+P.E.
3
2
1
0
-1
-2
0 5 10 15 20
time, s
t = 36.000 s
-0.5
y position, m
-1
-1.5
-2 (x0, y0)
-1 -0.5 0 0.5 1
x position, m
11 Constraints
Suppose that in a dynamical system described by m generalized dynamic coordinates,
h i
q(t) = q1 (t), q2 (t), · · · , qm (t)
there are specific requirements on the motion that must be satisfied. For example, suppose the
elastic pendulum must move along a particular line, g(θ(t), u(t)) = 0, or that the pendulum
can not move past a particular line, g(θ(t), u(t)) ≤ 0. If these constraints to the motion of the
system can be written pureley in terms of the positions of the coordinates, then the system
(including the differential equations and the constraints) is called a holonomic system.
There are a number of intriguing terms connected to constrained dynamical systems.
• A system with constraints that depend only on the position of the coordinates,
g(q(t), t) = 0
is holonomic.
• A system with constraints that depend on the position and velocity of the coordinates,
g(q(t), q̇(t), t) = 0
(in which g(q(t), q̇(t), t) can not be integrated into a holonomic form) is nonholonomic.
is scleronomic.
• A system with constraints that are explicitely dependent on time, as in the constraints
listed under the first two definitions is rheonomic.
is pfafian.
QC · δq = 0.
Consider a constraint for the elastic pendulum in which the pendulum must move along
a curve g(θ(t), u(t)) = 0. For example, consider the constraint
Clearly the elastic pendulum will not follow the path g = 0 all by itself; it needs to be forced,
somehow, to follow the prescribed trajectory. In a holonomic system (in which the constraints
are on the coordinate positions) it can be helpful to think of a frictionless guide that enforces
the dynamics to evolve along a partiular line, g(q) = 0. The guide exerts constraint forces
QC in a direction transverse to the guide, but not along the guide.
For relatively simple systems such as this, incorporating a constraint can be as simple
as solving the constraint equation for one of the variables, for example, u(t) = l − lθ2 (t) and
using the constraint to eliminate one of the coordinates. With the substitution of u(t) =
l − lθ2 (t) into the expressions for kinetic energy and potential energy, Lagranges equations
can be written in terms of the remaining coordinate, θ. This is a perfectly acceptable means
of incorporating holonomic constraints into an analysis. However, in general, a set of c
constraint equations g(q) = 0 can not be re-arranged to express the position of c coordinates
in terms of the remaining (m − c) coordinates. Furthermore, reducing the dimension of the
system by using the constraint equation to eliminate variables does not give us the forces
required to enforce the constraints, and therefore misses an important aspect of the behavior
of the system. So a more general approach is required to derive the equations of motion for
constrained systems.
Recall that an admissible variation, δq must adhere to all constraints. For example, the
solution to the constrained elastic pendulum, perterbued by [δθ, δu], must lie along the curve
1 − θ2 − u/l = 0. In order for the variation δq to be admissible, the perturbed solution must
also lie on the line of the constraint. In other words, the variation δq must be perpendicular
to the gradient of g with respect to q,
" #
∂g
δq = 0 . (41)
∂q
The constraints at the perturbed solution are satisfied for infinitessimal pertubations as long
as equation (41) holds. Because admissible variations δq are normal to [∂g/∂q] and the
constraint force QC is normal to δq, the constraint force must lie within [∂g/∂q],
" #
C T ∂g
Q =λ .
∂q
q .
q
2 2
dg dg
dq .
dq
δq δq
q
. q
1 1
g(q , q ) = 0
. .
g(q , q , q , q ) = 0
1 2 1 2 1 2
Figure 2. Admissibile variations δq for holonomic (left) and nonholonomic (right) systems. In
holonomic systems δq adheres to the constraint g(q) = 0 since δq is normal to the gradient of
g with respect to q. In nonholonomic systems δq need only be normal to ∂g/∂ q̇.
in which
X ∂gi
λi
i ∂qj
is the generalized force on coordinate qj applied through the system of constraints,
g(q, t) = 0 . (43)
These forces are precisely the actions that enforce the constraints. Equations (42) and (43)
uniquely describe the dynamics of the system. In numerical simulations these two systems of
equations are solved simultaneously for the accelerations, q̈(t), and the Lagrange multipliers,
λ(t), from which the constraint forces, QC (t), can be found.
A system with m coordinates and c holonomic constraints can be reduced to a system
of m − c equations of motion by substituting constraint equations into the equations of
motion and eliminating coordinates. Alternatively, the Lagrange multipliers can be treated
as dynamic variables, and the constraint equations can be enforced in the acceleration form,
by differentiating them twice with respect to time. In either case, the initial conditions must
be admissible, and numerical integration errors that would lead to dynamic responses that
violate g(q, t) = 0 must be numerically corrected.
Let’s apply this to the elastic pendulum, constrained to move along a path
u(t) = l − lθ2 (t) ⇐⇒ g(θ(t), u(t)) = 1 − θ2 (t) − u(t)/l . (44)
The derivitives of T and V are as they were. The new derivitives required to model the
actions of the constraints are
∂g ∂g
= = −2θ (45)
∂q1 ∂θ
∂g ∂g
= = −1/l (46)
∂q2 ∂u
Note that these derivites are related to, but are not the same as, the gradient of g(q).
Equation (35) now includes a new term for the constraint moment in the θ direction, +λ(2θ),
and the new term for the constraint force in the u direction in equation (36) is +λ(1/l). (This
problem has one constraint, and therefore one Lagrange multiplier, but two coordinates, and
therefore two generalized constraint forces.) The Lagrange multiplier in this problem has
units of moment (N.m). There are no other non-conservative forces Qj applied to this system.
The problem now involves three equations (two equations of motion and the constraint) and
three unknowns θ, u (or their derivitives) and λ. In principle, a solution can be found. In
solving the equations of motion numerically, as a system of first-order o.d.e’s, we solve for the
highest order derivitives in each equation in terms of the lower-order derivitives. In this case
the highest order derivitives are θ̈ and ü. In the case of constrained dynamics, we also need
to solve for the Lagrange multiplier(s), λ. The constraint equation(s) give(s) the additional
equation(s) to do so. But in this problem the constraint equation is in terms of positions θ
and u. However, by differentiating the constraint we can put this in terms of accelerations θ̈
and ü. So doing, with some rearrangement,
2lθθ̈ + ü = −2lθ̇2 . (47)
Now we have three equations and three unknowns for θ̈, ü, and λ.
M (l + u)2 θ̈ + 2θλ = −M g(l + u) sin θ − 2M (l + u)u̇θ̇ (48)
1
M ü + λ = M (l + u)θ̇2 − Ku + M g cos θ (49)
l
2lθθ̈ + ü = −2lθ̇2 (50)
The constraint moment in the θ direction is λ(2θ) and the constraint force in the u direction
is λ/l. The constraint forces acting along g(q) = 0 are λ/l in the u direction and 2θλ/(l + u)
perpendicular to the u direction. The three equations may be written in matrix form . . .
M (l + u)2 0 2θ
θ̈ −M g(l + u) sin θ − 2M (l + u)u̇θ̇
0 M 1/l ü = M (l + u)θ̇2 − Ku + M g cos θ
(51)
2θ 1/l 0 λ −2θ̇2
Note that the initial condition of the system must also adhere to the constraints,
lθ02 + u0 = l (52)
2lθ0 θ̇0 + u̇0 = 0 (53)
These equations can be integrated numerically as was shown in the previous Matlab exam-
ple, except for the fact that in the presence of constraints, the accelerations and Lagrange
multiplier need to be evaluated as a solution of three equations with three unknowns.
0.5
-0.5
4 K.E.+P.E.
3
0
0 5 10 15 20
time, s
Figure 3. Free response of an undamped elastic pendulum from an initial condition uo = l and
θ̇o = 1 constrained to move along the arc u = l − lθ2 . The motion is periodic and the total
energy is conserved exactly.
t = 20.000 s
-0.5
y position, m
-1
-1.5
-2 (x0, y0)
-1 -0.5 0 0.5 1
x position, m
Figure 4. The constrained motion of the pendulum is seen to satisfy the equation u = l − lθ2
for l = 1 m. An animation of this motion and the dynamic constraint forces is here: http:
//www.duke.edu/∼hpgavin/cee541/elastic pendulum H sim.mp4
15
10
-5
θ constraint force, Qθ
u constraint force, Qu
-10
0 5 10 15 20
Figure 5. The constraint moment in the θ direction (blue) and force in the u direction (green)
required to enforce the constraint u(t) = l − lθ2 (t).
A nonholonomic system has internal constraint forces QC j which adhere the responses
to a non-integrable relationship involving the positions and velocities of the coordinates,
Including these constraint forces into Lagrange’s equations gives the nonholonomic form of
Lagrange’s equations,78
!
d ∂T ∂T ∂V X ∂gi
− + − λi − Qj = 0 , (56)
dt ∂ q̇j ∂qj ∂qj i ∂ q̇j
in which
X ∂gi
λi
i ∂ q̇j
is the generalized force on coordinate qj applied through the system of constraints g = 0.
Equations (54) and (56) uniquely prescribe the constraint forces (Lagrange multipliers λ)
and the dynamics of a system constrained by a function of velocity and displacement.
6
P.S. Harvey, Jr., Rolling Isolation Systems: Modeling, Analysis, and Assessment, Ph.D. dissertation,
Duke Univ, 2013
7
M.R. Flannery, “The enigma of nonholonomic constraints,” Am. J. Physics 73(3) 265-272 (2005)
8
M.R. Flannery, “d’Alembert-Lagrange analytical dynamics for nonholonomic systems,” J. Mathematical
Physics 52 032705 (2011)
As an example, suppose the dynamics of the elastic pendulum are controlled by some
internal forces so that the direction of motion arctan(dy/dx) is actively steered to an angle
φ that is proportional to the stretch in the spring, φ = −bu/l. The velocity transvese to the
steered angle must be zero, giving the constraint,
u̇
= tan(θ + bu/l) ⇐⇒ g(θ, u, θ̇, u̇) = u̇ cos(θ + bu/l) − lθ̇ sin(θ + bu/l) (57)
lθ̇
The additional derivitives required for the nonholonomic form of Lagranges equations are
∂g ∂g
= = −l sin(θ + bu/l) (58)
∂ q̇1 ∂ θ̇
∂g ∂g
= = cos(θ + bu/l) (59)
∂ q̇2 ∂ u̇
Equation (35) now includes a new term for the constraint moment in the θ direction, −λ(ls),
and the new term for the constraint force in the u direction in equation (36) is +λ(c), where
s = sin(θ + bu/l) and c = cos(θ + bu/l). Note that in this case, the constraint forces are
dependent upon the position of the pendulum (θ and u), but not on the velocities. The
constraint equation along with the equations of motion uniquely define the solution θ(t),
u(t), and λ(t). Since, for numerical simulation purposes, we are interested in solving for the
accelerations, θ̈(t) and ü(t), we can differentiate the constraint equation to transform it into
a form that is linear in the accelerations,
ġ = −bu̇2 s/l + üc − lθ̇2 c − lθ̈s − θ̇u̇(s + bc) (60)
Our three equations are now,
M (l + u)2 θ̈ − (ls)λ = −M g(l + u) sin θ − 2M (l + u)u̇θ̇ (61)
M ü + (c)λ = M (l + u)θ̇2 − Ku + M g cos θ (62)
−(ls)θ̈ + (c)ü = lθ̇2 c + θ̇u̇(s + bc) + bu̇2 s/l (63)
with an initial condition that also satisfies the constraint, u̇0 = lθ̇0 tan(θ + bu/l). The three
equations may be written in matrix form . . .
M (l + u)2 0 −ls
θ̈ −M g(l + u) sin θ − 2M (l + u)u̇θ̇
0 M c ü = M (l + u)θ̇2 − Ku + M g cos θ
(64)
−ls c 0 λ 2 2
lθ̇ c + θ̇u̇(s + bc) + bu̇ s/l
Note that the upper-left 2 × 2 blocks in the matrices of equations (51) and (64) are the
same as the corresponding matrix M in the unconstrained system (37). The same is true
for the first two elements of the right-hand-side vectors of equations (51) and (64) and the
right-hand-side vector Q of the unconstrained system (37). Furthermore, if the differentiated
constraint equations (47) and (60) are written as
ĝ = A(q(t), q̇(t)) q̈(t) − b(q(t), q̇(t), t)
then both equations (51) and (64) may be written
" #" # " #
M AT q̈ Q
= . (65)
A 0 λ b
This expression can be obtained directly from Gauss’s principle of least constraint, which
provides an appealing interpretation of constrained dynamical systems.
0 5 10 15 20 25 30 35 40
time, s
5
energies, Joules
4
3
2
K.E.
1
0 P.E.
-1 K.E.+P.E.
-2
0 5 10 15 20 25 30 35 40
time, s
Figure 6. Free response of an undamped elastic pendulum from an initial condition uo = l/2,
θo = 0.2 rad, θ̇o = 1 rad/s, with trajectory constrained by lθ̇/u̇ = tan(θ + bu/l), with b = 5.
The motion is not periodic but total energy is conserved exactly and the constraint is satisfied
at all times.
2
1.5
1
y position, m
0.5
0
t = 40.000 s
-0.5
-1
-2
-2 -1 0 1 2
x position, m
Figure 7. The constrained motion of the pendulum does not follow a fixed relation between u and
θ — the constraint is nonholonomic. An animation of this motion and the dynamic constraint
forces is here: http://www.duke.edu/∼hpgavin/cee541/elastic pendulum NH sim.mp4 (ying &
yang)
40
20
-20
-40
θ constraint moment, Q θ
u constraint force, Q u
-60
0 5 10 15 20 25 30 35 40
Figure 8. The constraint moment in the θ direction (blue) and the force u direction (green)
directions required to enforce the constraint lθ̇/u̇ = tan(θ + bu/l).
CC BY-NC-ND HP Gavin September 6, 2018
24 CEE 541. Structural Dynamics – Duke University – Fall 2016 – H.P. Gavin
G( q"1(t), q"2(t) )
Aq"=b
a2(t)
q"2(t) a1(t)
fC(t)=-AT y q"1(t)
The force of the constraints is now apparent, QC = −AT λ. While equation (65) is
sufficient for analyzing the behavior and simulating the response of constrained dynamical
systems, it is also useful in building an understanding of their nature. Solving the first of the
equations for q̈,
q̈ = M−1 Q − M−1 AT λ
and inserting this expression into the constraint equation,
AM−1 Q − AM−1 AT λ = b
the Lagrange multipliers may be found,
λ = −(AM−1 AT )−1 (b − AM−1 Q) ,
and substituting a = M−1 Q, the constraint force, QC = −AT λ, can be found as well,
QC = −AT (AM−1 AT )−1 (Aa − b) .
or
QC = K(Aa − b) .
The difference (Aa − b) is the amount of the constraint violation associated with the uncon-
strained accelerations a. If the unconstrained accelerations satisfy the constraint, then the
constraint force is zero. The matrix K = −AT (AM−1 AT )−1 is a kind of natural nonlinear
feedback gain matrix that relates the constraint violation of the unconstrained accelerations
(Aa − b) to the constriant force required to bring the constraint to zero, QC .
The constrained minimum of the quadratic objective G gives the correct equations of motion.