Lagrangian Mechanics Example: Motion of a Half Atwood Machine

I’m in the process of working through some mechanics examples that use the Lagrangian to find a solution. In case you missed it, here is my introduction to Lagrangian Mechanics.
For this physics example, I’m going to look at a half Atwood machine. That’s just a fancy name for two blocks connected by a string. One block (mass 1) sits on a horizontal frictionless table. The other block (mass 2) hangs vertically off the table and is connected to mass 1 with a string. Oh, the pulley at the edge of the table is massless and frictionless. The string is also massless (you can get these frictionless and massless objects at the local physics store).
Yes, you can solve this problem without using the Lagrangian — but that’s why it’s a great example. Since we already know the solution, it’s a great way to build up confidence.
Let’s get started. I’m going to break this into the important steps.
Degrees of Freedom and Generalized Coordinates.
I want to describe this whole system by picking some coordinates. But to do that, I need to know how many coordinates are even needed. In this case, there are two objects that are moving (mass 1 and mass 2). However, if mass 1 moves 1 cm to the right, then mass 2 must move 1 cm down. So, I don’t really need to describe the location of both objects — one position will work.
This system has only one degree of freedom so that we only need one coordinate to calculate the motion. I’m going to use the variable, s, and set this as the distance from the edge of the table to mass 1. Let me call the length of the string, l.

That’s it for this step. Oh, I should add that you could pick a different coordinate — this will still work.
Kinetic Energy and Potential Energy
Since the Lagrangian is the difference in the kinetic and potential energy. That means we need an expression for both energies in terms of our generalized coordinate (s). I’m going to do this the long — but formal way. No short cuts.
The problem is that sometimes it’s not so easy to see how to write the energies in these new coordinates (yes, it’s simple here). So, the solution is to use Cartesian coordinates because the kinetic energy is much easier that way.
For this situation, mass 1 moves in the x-direction and mass 2 moves in the y-direction. With this, I can write the kinetic (T) and potential energy (U) as:

Yes, we use T to represent the kinetic energy — it has something do with its Latin origin (probably). Also, here I am using the dot-notation. A single dot above a variable is equivalent to the derivative with respect to time.

This means that x1-dot and y2-dot are the two velocities of the blocks (yes, they have the same magnitude of velocity — but remember I am doing this the long way). Hopefully, it’s clear that x1 is the x-position of block 1 and y2 is the y-position of block 2. For the potential energy, I am going to define y = 0 as the level of the table. This means that the potential for block 1 is zero. The location of x = 0 will be at the edge of the table.
Now I need to get a relationship between the Cartesian coordinates (x’s and y’s) to my generalized coordinate (s).

I think the x1 expression makes sense. If the distance from the edge of the table to m1 is s, then the x-value is just the negative of that. For y2, the total length of the string is l. That means the distance down from the edge of the table would be l-s. There is an negative sign because it’s below the origin.
Now to find the kinetic energy, I need the x1 and y2 velocities (the time derivatives). These aren’t too hard to find. Remember that s is a variable that changes, but l is just a constant length of the string. This gives:

See! The two blocks have the same velocity (well, at least the same magnitude). We didn’t even have to take a short cut. Now we can put this into the kinetic energy.

The potential energy is fairly simple. Just put in my value for y2.

Notice that this is a negative potential energy since s is less than l. This gives a Lagrangian of:

Yes, this step could have been much shorter if we just used common sense — but it’s great practice.
Euler-Lagrange Equation
Now that we have the Lagrangian, we can find the “least action” by using the Euler Lagrange equation. Since there is only one variable (s) we just get one equation.

Let’s take this in two parts. I’ll start with just the partial derivative of L with respect to s. Remember, this is just a partial derivative so the only thing we need to worry about changing is the variable s. There is only one term with an s in it, the potential term. Taking the partial, I get:

For the other term, I’m going start by just taking the partial of L with respect to s-dot.

Again, this is not too difficult since there is only one s-dot term in the Lagrangian (using the power rule). Next I need to take the time derivative of this partial derivative. Again, the only variable that depends on time is s-dot.

Remember, s-double dot is the second derivative of s with respect to t. Now I can put the whole Euler-Lagrange thing together and solve for s-double dot.

Wait. Why is s-double dot negative? Remember, s is the measured distance from the edge to mass 1. Since the mass 1 will be increasing in speed this way, the acceleration should be “negative”. It’s all good.
Also, this is the same expression for the acceleration you would get by using Newtonian mechanics. Just in case you can’t remember how to do that, here is a video.
Equation of Motion
We have one more step — finding the equation of motion. Since the acceleration is constant, this is fairly trivial. However, I’m going to go through the whole process anyway.
Let’s assume that this whole system starts at a position s0 at time t = 0 (note, those are supposed to be subscripts) with a velocity so s-dot0. Since I have an expression for s-double dot, I can integrate both sides to find an expression for s-dot.

Or, I could write this as:

Integrating both sides again:

Yes. This is just your standard kinematic equation. I know that was a little anti-climatic. Don’t worry, I’ll do another problem soon that will be more entertaining.