JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Two Roads to the Same Equation: Lagrange vs Newton–Euler

Energy bookkeeping or force-by-force accounting — two classic methods derive the same dynamics, and the recursive form is what real robots compute.

The same destination from two starting points

Suppose you want the robot equation of motion — the formula that says, given where the joints are and how fast they move, exactly how much joint torque each motor must produce. There are two famous ways to derive it. The first, the Lagrangian formulation, is an accountant's approach: track the robot's energy and let calculus hand you the answer. The second, the Newton–Euler formulation, is an engineer's approach: walk through the mechanism link by link, balancing every force and torque as you go.

Here is the surprise that makes this lesson worth your time: both roads end at the *identical* equation. Not similar — identical, term for term. The two methods feel completely different to set up, yet physics forces them to agree, because they are describing the very same machine obeying the very same laws. Knowing both gives you a check on your work and a feel for which tool to reach for.

Road one: Lagrange, the energy accountant

The Lagrangian method starts by ignoring forces entirely and looking only at energy. You write down two scalars: the kinetic energy (how much motion is stored in the moving links) and the potential energy (how much is stored by gravity acting on raised masses). The Lagrangian is simply their difference, L = T − V — kinetic minus potential.

Then you "turn the crank": you feed L into the Euler–Lagrange equation and grind through the derivatives. Out the other side, almost magically, fall the exact torques. The beauty is that energy is a scalar — it does not care about coordinate axes or which way a frame points — so you never have to draw a free-body diagram or chase a vector through space. The cost is abstraction: you are differentiating an energy expression, and it can be hard to see the physical force behind any single term until the algebra is finished.

L  =  T(q, q̇)  −  V(q)          # Lagrangian: kinetic minus potential

d/dt ( ∂L/∂q̇ )  −  ∂L/∂q  =  τ   # Euler–Lagrange: turn the crank → torques τ
Write one energy expression, apply one formula, and the joint torques τ fall out.

Road two: Newton–Euler, the force bookkeeper

The Newton–Euler route refuses to leave the physical world for even a moment. It applies two laws to every single link: Newton's law (net force equals mass times the acceleration of the link's center of mass) and Euler's law (net torque equals the rate of change of angular momentum, which involves the link's inertia tensor). Two equations per link, written out honestly in vectors.

The catch is that the links are coupled: the hand pushes on the forearm, which pushes on the upper arm, all the way down to the base — and gravity and inertia act on every piece at once. So you cannot solve one link in isolation. You have to bookkeep the forces and momenta passing between neighbors, link by link, frame by frame. It is concrete and physically transparent — you can point at every term and say what it *is* — but it is also fussy, and a single mislabeled frame or wrong sign quietly corrupts everything downstream.

What robots actually run: the recursive algorithm

Naively building the full symbolic equation and then plugging in numbers costs work that grows faster than the joint count — too slow to run a thousand times a second on a real arm. The fix is the recursive Newton–Euler algorithm (RNEA), and it is what production controllers genuinely execute for inverse dynamics: given desired joint positions, velocities, and accelerations, compute exactly the torques needed.

  1. Outward pass (base → tip): starting from the fixed base, propagate velocity and acceleration up the chain, one link at a time, so each link knows how it is moving and accelerating.
  2. From each link's motion, compute the force and torque acting on it, using Newton's and Euler's laws with the link's mass and inertia tensor.
  3. Inward pass (tip → base): starting from the end-effector, sum forces and torques back down the chain, so each joint collects everything the links beyond it impose on it.
  4. Project each joint's total force and torque onto its motion axis to read off the required actuator torque — done in time linear in the number of joints, i.e. O(n).

That two-sweep structure is why the recursive form is so fast: each link is visited a fixed number of times, so doubling the joints only doubles the work. The same machinery also underpins forward dynamics (predicting motion from given torques, used inside simulators) and feeds model-based controllers such as computed-torque control.