ME3120 · Dynamic Modelling
Theme 3 · Energy / Lagrange

Generalized forces & damping

So far the right-hand side was zero. Real machines have motors and friction — here is how a push, a torque, and a damper enter as the generalized force \(Q\).

Source: course notes, Week 2 (the energy method).

Before you start

What you need first

  • Lagrange's equation with its right-hand side \(Q\) (Topic 12).
  • The pendulum EOM \(mL^2\ddot\theta + mgL\sin\theta = 0\).
  • Damping \(F=-c\dot x\) from the mass–spring–damper.

What you'll be able to do

  • Say what belongs in the generalized force \(Q\).
  • Add a motor torque and damping to a model.
  • Write the full driven, damped pendulum equation.

What goes into \(Q\)?

The Lagrangian \(\mathcal{L}=T-V\) already captures inertia, gravity, and springs. Anything not already inside \(T\) or \(V\) goes on the right-hand side, collected into the generalized force \(Q\):

$$\frac{d}{dt}\!\left(\frac{\partial \mathcal{L}}{\partial \dot q}\right) - \frac{\partial \mathcal{L}}{\partial q} = Q$$
Goes inside \(\mathcal{L}=T-V\)Goes into \(Q\) (right side)
inertia (masses, \(I\))applied forces (a hand, an actuator)
gravity \(mgh\)motor / joint torques \(\tau\)
springs \(\tfrac12 kx^2\)damping / friction \(-c\dot q\)
If nothing external acts, \(Q=0\) (the free systems we did last topic). Add a motor or a damper, and they appear in \(Q\).

A push that drives

A motor torque on a joint

If a motor applies a torque \(\tau\) at the pendulum's pivot, that torque is exactly the generalized force for the coordinate \(\theta\). It goes on the right:

$$mL^{2}\ddot\theta + mgL\sin\theta = \tau$$
🔭 Looking ahead: this is exactly how a joint motor enters a robot model — as the \(\tau\) on the right-hand side. The left side is the machine; the right side is the drive.
m τ θ mg
A motor adds a torque \(\tau\) at the pivot — the generalized force for \(\theta\).

A force that resists

Adding damping

A damper (oil, friction at the joint) gives a torque that opposes motion, sized by the angular speed. It contributes \(-c\dot\theta\) to the generalized force. Moving it to the left side, it joins the equation as a new term:

$$mL^{2}\ddot\theta + c\,\dot\theta + mgL\sin\theta = \tau$$
the new pieces:
SymbolMeaningSI unit
\(\tau\)applied (motor) torqueN·m
cdamping coefficient (rotational)N·m·s/rad
\(\dot\theta\)angular speedrad/s

Read every term — the same cast as the spring

TermNameWhere it comes from
\(mL^2\ddot\theta\)inertiakinetic energy \(T\)
\(c\dot\theta\)dampinggeneralized force \(Q\)
\(mgL\sin\theta\)gravitypotential energy \(V\)
\(\tau\)inputgeneralized force \(Q\)
Exactly the cast of the mass–spring–damper \(m\ddot x + c\dot x + kx = F\): inertia, damping, a restoring term, and a drive. Energy gave us all of it — and the rod tension still never appeared.
📐 Worked example

Where does a driven pendulum settle?

A pendulum (bob \(m = 0.5\ \text{kg}\), rod \(L = 1.0\ \text{m}\)) is held by a motor giving a constant torque \(\tau = 2.0\ \text{N·m}\). Take \(g = 9.81\ \text{m/s}^2\). At what angle does it finally come to rest?

m τ θ mg
At rest, the motor torque \(\tau\) balances the gravity torque \(mgL\sin\theta\).
1At rest, \(\dot\theta=\ddot\theta=0\), so the equation collapses to a torque balance:
$$mgL\sin\theta = \tau$$
2Solve for \(\theta\):
$$\sin\theta = \frac{\tau}{mgL} = \frac{2.0}{(0.5)(9.81)(1.0)} = 0.408 \;\Rightarrow\; \theta = 24.1^\circ$$
The motor lifts the bob until gravity's pull-back exactly matches the drive. (If \(\tau\) ever exceeded \(mgL=4.9\ \text{N·m}\), \(\sin\theta>1\) has no solution — the motor overpowers gravity and the pendulum spins right over.)

✏️ Try it yourself

A pendulum (bob \(m = 0.8\ \text{kg}\), rod \(L = 0.5\ \text{m}\)) is driven by a constant motor torque \(\tau = 1.5\ \text{N·m}\). Take \(g = 9.81\ \text{m/s}^2\). Find the rest angle.

Balance. \(mgL\sin\theta = \tau\), with \(mgL = (0.8)(9.81)(0.5) = 3.92\ \text{N·m}\) Solve. \(\sin\theta = \dfrac{1.5}{3.92} = 0.382 \Rightarrow \theta = 22.5^\circ\) Check. \(\tau=1.5 < mgL=3.92\), so a real rest angle exists ✓

Common mistakes to avoid

MistakeFix
Putting a motor torque inside \(\mathcal{L}\)Applied torques are not energy stored — they go into \(Q\) on the right.
Giving damping a \(+c\dot q\) on the rightDamping opposes motion: \(Q\) gets \(-c\dot q\), so it lands as \(+c\dot q\) on the left.
Forgetting to move \(-c\dot\theta\) acrossBringing \(Q\)'s damping to the left flips its sign to \(+c\dot\theta\) beside the inertia term.
Expecting a rest angle for any \(\tau\)If \(\tau>mgL\) there is no equilibrium — the drive beats gravity.

Recap — the whole topic on one screen

$$\frac{d}{dt}\!\left(\frac{\partial \mathcal{L}}{\partial \dot q}\right) - \frac{\partial \mathcal{L}}{\partial q} = Q \qquad\Rightarrow\qquad mL^{2}\ddot\theta + c\,\dot\theta + mgL\sin\theta = \tau$$
IdeaWhat you own now
What \(Q\) isEverything not in \(T\) or \(V\): pushes, torques, damping
A motorTorque \(\tau\) goes on the right as \(Q\)
Damping\(-c\dot q\) in \(Q\) → \(+c\dot q\) on the left
The full modelInertia + damping + gravity = drive — same cast as the spring

Next topic

Lagrange on one DOF

You now have the whole machine: \(\mathcal{L}=T-V\), the crank, and \(Q\). Next we put it all together — re-deriving the spring and the pendulum end to end by energy, side by side with the Newton results.

→ Lagrange on one DOF