# Lagrangian mechanics and generalized coordinates

In Lagrangian mechanics, we use what is called the generalized coordinates (gc's) as the variable of the machanics problem in hand. These gc's represent the degrees of freedom that the studied system has. Lagrangian mechanics deals with the energies of the system (kinetic $$T$$ and potential $$U$$ energies) through the so-called Lagrangian function $$L(q,\dot{q})$$, where $$q$$ ('s) are the generalized coordinate(s) and $$\dot{q}$$ ('s) the corresponding generalized velocities. This is why people say that Lagrangian mechanics is easier to deal with than Newtonian mechanics, because the quantities are only scalars and not vectors. But by saying only this we are leaving something very important without mentioning it. The determination of the generalized coordinates is not that simple.
The question is: Is there any systematic/clever/cheating way that could be used to determine these gc's?

Example:

The picture tells everything. mass $$m_1$$ connected to the spring moves on the x-axis, and mass $$m_2$$ swings left and right. The generalized coordinates, in many references, are $$x$$ and $$\theta$$. But are $$\theta$$ and $$x$$ really independent? Since $$m_2$$ has inertia, its movement will influence that of $$m_2$$, and vice versa. In other words, there exists some coupling between the two variables, and the motion could even be chaotic. So how could we set these two as the gc's of the system anyway, and what's the reasoning here?

• Practice practice practice… Sep 23, 2023 at 14:59

Is there any systematic/clever/cheating way that could be used to determine these gc's?

Not really. This is kind of an art. On the one hand, it doesn’t matter, any coordinates will do. On the other hand, a clever choice of coordinates can mean the difference between an analytical solution and a numerical solution.

But are θ and x really independent?

That doesn’t matter. The Lagrangian method will work regardless. You could even use $$x_1$$ as the $$x$$ coordinate of $$m_1$$ and similarly $$x_2$$ and $$y_2$$ where the length of the rod constrains the variables and makes the variables explicitly interdependent. There is no requirement of independence.

As stated in an earlier answer, there is no general algorithm for arriving at the most suitable generalized coordinates (in cases where using some form of generalized coordinates is beneficial). By nature it's a custom job, there will always be cases with unique properties.

Incidentally, when doing mechanics it is the choice of generalized coordinates that is the actual workhorse. You mention the distinction between scalars and vectors, but that is actually not that important a factor.

Take the Euler-Lagrange equation, and examine the operation that it performs on the expression for the potential energy: the EL-equation takes the derivative with respect to the position coordinate.

That position coordinate may be in terms of cartesian coordinates, or in terms of suitably chosen generalized coordinates.

If the potential is stated as a function of cartesian coordinates then taking the derivative with respect to position recovers the newtonian force $$F$$ (As in $$F=ma$$)

If the potential is stated as a function of some suitably chosen generalized coordinates then taking the derivative with respect to position gives an expression in terms of generalized force

In case you are not yet familiar with the concept of generalized force I very much recommend that you absorb that concept.

In short: the idea of generalized force is that while it does not have dimensions of force, the integral of a generalized force with respect to its corresponding generalized position coordinate does have the dimensions of work.

The most familiar instance of a generalized force is the concept of torque. The integral of a torque over an angular displacement has dimensions of work.

So:
When you have (re)stated a problem in terms of rotational kinetic energy and potential-as-a-function-of-angle, then after applying the Euler-Lagrange equation your equation of motion is in terms of torque (a generalized force), and angular acceleration.

More generally: why is it that a force (a vector quantity) can be recovered from the expression for potential-as-a-function-of-position?

That is because the expression for potential covers the entire space. Taking the derivative of the potential with respect to the position coordinate means that you obtain the gradient of the potential energy, and that gradient is a vector quantity. The expression for the potential-as-a-function-of-position-coordinate carries all of the information that you need to recover the force.

That demonstrates: judicious choice of generalized coordinates is the crucial factor in solving the problem efficiently.