Lagrange’s Equations of Motion


Lagrange’s Equations of Motion

Michael
Welcome in. Today we’re learning how to use Lagrange’s equations to build equations of motion, especially when a system has several parts or awkward motion. The central ideas are the Lagrangian, generalized coordinates, and generalized forces.

Corey
And the big advantage is that we don’t have to choose ordinary x-y-z coordinates or draw a separate force balance for every moving part. We can choose coordinates that fit the motion—as long as they meet some important requirements.

Michael
First, define the Lagrangian as L equals T minus V: the total kinetic energy of the system minus its total potential energy. For each generalized coordinate q sub j, Lagrange’s equation is the time derivative of the partial derivative of L with respect to q-dot sub j, minus the partial derivative of L with respect to q sub j, equal to the generalized force Q sub j.

Corey
So if a system has three degrees of freedom, we need three equations—one for each coordinate. The index j is just bookkeeping: work through the equation once for coordinate one, once for coordinate two, and once for coordinate three.

Michael
For ordinary mechanical systems, potential energy depends on position, not velocity. That means the partial derivative of V with respect to q-dot is zero. So a practical version to calculate is: the time derivative of partial T over partial q-dot, minus partial T over partial q, plus partial V over partial q, equals Q.

Corey
That form is less compact, but it makes the calculation easier to organize. You can label the three left-hand-side pieces as one, two, and three, and the generalized force on the right as four. Then add them for each coordinate.

Michael
There are situations involving things like moving electrons and magnetic fields where velocity-dependent potential terms can matter. But for the mechanical systems we’re focusing on here, that extra term vanishes.

Corey
Let’s pin down what counts as a good generalized coordinate. The coordinates need to be independent, complete, and appropriate for a holonomic system. They don’t have to be Cartesian, and they don’t have to be inertial coordinates.

Michael
Independent means that if you hold all but one coordinate fixed, the remaining coordinate still has a continuous range of motion. For a double pendulum, two angles work: hold the first angle fixed and the second mass can still swing, and vice versa.

Corey
By contrast, suppose you describe that double pendulum with x-one, y-one, x-two, and y-two. That’s four coordinates, even though the fixed-length strings leave only two degrees of freedom. Those four coordinates aren’t independent: fixing just some of them can freeze the system because the string constraints link their positions.

Michael
Completeness means the coordinates can locate every part of the system at every moment. The two pendulum angles are complete because, once you know both, you can determine where both masses are. In that example, the angles are both complete and independent.

Corey
Holonomicity is the third check. In the lecture’s terms, a holonomic system can have its motion completely described using as many independent coordinates as it has degrees of freedom. If describing its full configuration requires additional information beyond those coordinates, the system isn’t holonomic, and the usual Lagrange equations can’t be used in the way we’re developing here.

Michael
The rolling ball illustrates that distinction. A ball constrained to a plane, with no vertical motion, no rotation about the vertical axis, and no slipping, has two degrees of freedom in its position on the plane: x and y.

Corey
But rolling without slipping along different paths can leave the ball with different orientations, even when it ends at the same x-y position. The stripe painted on the ball might face one way after one route and another way after a different route. To describe that orientation, you need more information than just the two position coordinates, so this is a nonholonomic example.

Michael
Once the coordinates are chosen, the workflow is systematic. First, find the degrees of freedom and choose coordinates; check that they’re complete and independent and that the system is holonomic. Next, calculate total kinetic energy T and potential energy V, including the contributions from the system’s bodies.

Corey
Then take the Lagrange derivatives separately for each coordinate. Finally, find each generalized force from the nonconservative forces—forces that aren’t accounted for by the potential energy, such as damping or an externally applied force.

Michael
To find Q, use virtual work. Imagine a small allowed displacement in one generalized coordinate at a time, call it delta q. Add up the work done by the nonconservative forces during that virtual displacement. If that work is Q times delta q, then Q is the generalized force for that coordinate.

Corey
The dot product is crucial: only the component of a force along the virtual displacement does work. And a change in an angle isn’t itself a distance, so for a rotational coordinate you need the appropriate distance from the pivot—the moment arm—to turn delta angle into a displacement.

Michael
Here’s a simple check of the procedure: a mass on a spring and dashpot, moving along x, with an external force f of t. The coordinate x is complete and independent, and there’s one degree of freedom.

Corey
Its kinetic energy is one-half m x-dot squared. Its potential energy is one-half k x squared for the spring, along with the gravitational potential term, written as minus m g x for the chosen vertical convention. The nonconservative forces are the applied force f of t and the damper force, minus b x-dot.

Michael
The time derivative of partial T over partial x-dot gives m x-double-dot. Partial T over partial x is zero, because this kinetic energy doesn’t depend on position. Partial V over partial x gives kx minus mg.

Corey
For virtual displacement delta x, the nonconservative virtual work is f of t times delta x minus b x-dot times delta x. Therefore Q sub x is f of t minus b x-dot. Put the pieces together: m x-double-dot plus kx minus mg equals f of t minus b x-dot.

Michael
Rearranging gives m x-double-dot plus b x-dot plus kx equals mg plus f of t. That’s the familiar equation of motion. It’s a useful sanity check: Lagrange’s method agrees with the result you’d get from Newton’s laws.

Corey
Now let’s apply the method to a more involved planar system: a rod that swings about a fixed point A, with a sleeve sliding along the rod. The rod has mass m-one, and the sleeve has mass m-two. A spring connects to the sleeve, and a horizontal external force varies with time.

Michael
We can describe the system with two coordinates: theta, the rod’s angle, and x-one, the position of the sleeve’s center of mass measured along the rod from A. They’re complete because they locate both the rod and sleeve; they’re independent because either the rod can swing with the sleeve position fixed or the sleeve can slide with the angle fixed.

Corey
Before differentiating, write the energy carefully. The spring’s extension is x-one minus l-zero minus l-two over two, where l-zero is its unstretched length and l-two is the sleeve length. So its potential energy is one-half k times that extension squared.

Michael
Gravity contributes another potential term for each body. Taking the rod’s hanging-down position as its reference gives m-one g l-one over two times one minus cosine theta, where l-one over two is the rod’s center-of-mass distance from A.

Corey
For the sleeve, track the change in its height from the chosen reference. Its gravitational potential energy is m-two g times the reference height, l-zero plus l-two over two, minus m-two g x-one cosine theta. Splitting out the reference and final heights makes the geometry easier to check.

Michael
The kinetic energy also has to include each kind of motion. For the rod, which rotates about fixed point A, it’s one-half I-one about A times theta-dot squared. For the sleeve, include rotation about its center of mass and translation of its center of mass.

Corey
The sleeve’s rotational contribution is one-half I-two about its center of mass times theta-dot squared. Its center of mass has two perpendicular velocity components: x-one-dot along the rod, and x-one theta-dot perpendicular to the rod. So its translational kinetic energy is one-half m-two times the sum of x-one-dot squared and x-one squared theta-dot squared.

Michael
That distinction matters. The rod is pinned at a fixed point, so its rotational energy can be expressed using its inertia about A. But the sleeve is sliding, so its motion includes both rotation and translation; using only rotational energy would miss part of its kinetic energy.

Corey
For the x-one equation, the time derivative of partial T over partial x-one-dot gives m-two x-one-double-dot. The negative partial of T over partial x-one gives minus m-two x-one theta-dot squared. That second term is the centripetal contribution associated with the sleeve’s swinging motion.

Michael
The x-one derivative of the spring energy gives k times x-one minus l-zero minus l-two over two. The sleeve’s gravitational term contributes minus m-two g cosine theta. So the left-hand side for sliding is m-two x-one-double-dot minus m-two x-one theta-dot squared, plus the spring term, minus m-two g cosine theta.

Corey
Now take the horizontal applied force, f-zero cosine omega t, and project it onto the sleeve’s sliding direction. With theta defined as in the lecture, the component along the rod is f-zero cosine omega t sine theta. That’s the generalized force Q sub x-one.

Michael
So the complete sliding equation is: m-two x-one-double-dot minus m-two x-one theta-dot squared, plus k times x-one minus l-zero minus l-two over two, minus m-two g cosine theta, equals f-zero cosine omega t sine theta.

Corey
It passes several physical checks. There’s a linear acceleration term because the sleeve slides, a centripetal term because the rod swings, a spring force, gravity projected along the rod, and the applied force projected along the same direction.

Michael
You can also check static equilibrium. Set the time derivatives to zero, take the rod hanging down so cosine theta is one, and remove the time-dependent excitation. The equation says the spring force balances the sleeve’s weight, which is exactly what static balance should require.

Corey
For the theta equation, the acceleration terms tell a different story: this is the swinging motion, so we expect an angular-acceleration term. And because the sleeve can slide while the rod rotates, we should also expect a Coriolis-type term involving x-one-dot and theta-dot.

Michael
Differentiating the angular kinetic energy gives an effective rotational inertia: I-one about A, plus I-two about the sleeve’s center of mass, plus m-two x-one squared. That whole quantity multiplies theta-double-dot. The changing sleeve position also produces the term two m-two x-one x-one-dot theta-dot.

Corey
That mixed term is the Coriolis contribution. It appears because the sleeve is moving along the rod while the rod rotates. This is the kind of term you can predict before finishing the algebra, then check that your calculation actually produces it.

Michael
The gravitational potential derivatives contribute m-one g l-one over two sine theta for the rod and m-two g x-one sine theta for the sleeve. The spring has no theta dependence in this coordinate description, so it doesn’t contribute to this part of the angular equation.

Corey
For the generalized force in theta, the horizontal applied force does work through the sleeve’s rotational displacement. The relevant point is a distance x-one plus l-two over two from A, so a virtual angle change delta theta produces a displacement of that distance times delta theta.

Michael
Only the component of the horizontal force along that displacement contributes. That gives Q sub theta equal to f-zero cosine omega t times cosine theta times x-one plus l-two over two.

Corey
Putting those pieces together, the angular equation is: the quantity I-one about A plus I-two about the sleeve’s center of mass plus m-two x-one squared, multiplied by theta-double-dot, plus two m-two x-one x-one-dot theta-dot, plus m-one g l-one over two sine theta, plus m-two g x-one sine theta, equals f-zero cosine omega t cosine theta times x-one plus l-two over two.

Michael
Notice the units and meaning: this is a torque equation, while the x-one equation is a force equation. The inertia multiplying angular acceleration acts like the total moment of inertia about A, including the sleeve’s changing distance from the pivot.

Corey
The overall habit is to keep the bookkeeping clean: choose valid coordinates, write all of T and V, then calculate every term for each coordinate, and find generalized forces with virtual work. Finally, ask whether the equation has the accelerations, force directions, and units that the physical motion demands.

Michael
That’s the heart of the method. Lagrange’s equations turn energy and virtual work into equations of motion, and good coordinate choices can make even a multi-part system manageable.

Ask anything
We've read this whole study set, so questions about it get the best answers.