I’m working through some examples of physics problems that use Lagrangian Mechanics. Oh, what’s that? You aren’t sure about this whole Lagrangian thing? Well, here you go — my introduction to this physics method. Also, here is a more basic example finding the motion of a half-Atwood machine.
The Moving Wedge Problem
OK, so here is the problem:
A 100 gram block starts from rest on top of a frictionless wedge. The wedge can also slide. It has a mass of 431 grams (see how I used an unexpected value) with an incline of 34 degrees. The distance from the block down the incline is 14 cm. Find the equation of motion for the two objects once the block is released.
Although this is a pretty nice example to use Lagrangian mechanics — you can actually find the final speed of both objects by using the Momentum Principle and the Work-Energy Principle. But that’s not as much fun as using the Lagrangian.
Let’s start with a diagram, that’s usually a great place to begin.
Degrees of Freedom and Generalized Coordinates
The next step is to determine the degrees of freedom for this system (how many different things can change). Think of it this way. If you were to describe exactly how everything was arranged, how many variable would you need? The wedge can move back and forth on the surface — so that’s one degree of freedom. The block can move up and down, that’s two different directions.
But wait! The block can’t actually do whatever it wants (because real blocks don’t have emotions or desires — they are just blocks). OK, I’m serious now. Since the block is constrained to stay mainly on the plane (think of My Fair Lady) then the total number of generalized coordinates would be 3 variables minus 1 constraint = 2. I only need two coordinates.
The beautiful thing about Lagrangian Mechanics is that you don’t have to use Cartesian coordinates or polar coordinates or any other Officially Certified coordinate system. You can use whatever variables work the best. In fact, there’s not just one right answer — but here is the right answer (just kidding, you can pretty much use whatever you want but this is easier).
Let’s talk about these two variables. The easy one is “x”. This is the position of the wedge in the horizontal direction as measured from some arbitrary point. Yes, it’s the same as the Cartesian coordinate of the same name. No big deal.
The other coordinate is “s”. This is the location of the block as measured from the top of the wedge. But wait! The wedge is moving too. That means the variable s doesn’t tell the whole story. You need both x and s to fully determine the position of the objects.
Finding the Lagrangian
That’s cool and all, but what about this Lagrangian stuff? Fine, here is your super short description of Lagrangian mechanics. The Lagrangian is defined as the kinetic energy (T) minus the potential energy (U).
From that, the equations of motion can be found by finding the “Least Action”. This means that the Euler-Lagrange equation works.
Yes, that skips over all the important details — but like I said, I already went over all of this in a previous post. Oh, I guess I should say that “qi” is just a generic variable and qi-dot is the derivative of q with respect to time.
OK, but now we actually have to get an expression for the Lagrangian. This means we will have to find the kinetic and potential energy for both the wedge and the block. Let’s start with the wedge (since it’s easier).
If I assume the zero of the gravitational potential energy is at the ground, then the potential energy of the wedge is just zero — and it stays at zero since it doesn’t move up or down. Also, for the kinetic energy we have a Cartesian coordinate for the position of the wedge. This means that its velocity in the x-direction would just be x-dot (time derivative of x).
Here is the kinetic energy for just the wedge.
No problems there. Now, what about that block? That’s more difficult. Yes, I could use s-dot for the velocity of the block, but that’s not an independent variable. The best way to find the kinetic energy (and potential) for the block is to write the coordinate in terms of the x and y Cartesian coordinates. Note that since I have already used “x”, I am going to write the position of the block using x2 and y2 (since I labeled it mass-2).
Here is a diagram to show the relationship between s and x2, y2:
Let me just be clear. The real x-position of the block is the sum of the position of the wedge (x) and the horizontal position from the top of the wedge to the block — which is the adjacent side of the right triangle above. The real y-value is some constant minus the amount it has moved down (the opposite side of the triangle). Note: “s” is a positive value in this diagram.
Now that I have x-y values for block 2, I can find the velocity by taking the time-derivative of both x2 and y2. Remember, that in these expressions, both x and s can change with time. With that, here are the derivatives (using dot notation).
Here are some notes:
- The angle θ is constant. So, cos(θ) and sin(θ) are just constants and you don’t need to take the derivatives of these.
- That constant y-value, y0, doesn’t matter here since it’s a constant and goes away when I take the derivative.
I can use these expressions of velocity to find the kinetic energy of block 2. Since there is a velocity in both the x and y-direction, the kinetic energy will depend on the sum of the squares of these two velocity components.
Squaring those velocity terms (yes, there is some messy algebra here):
Factoring out the s-dot squared:
But cosine squared plus sine squared is equal to 1. OK, I will write the simplified version when I put it all into the Lagrangian. Let me first jump into the potential energy for mass 2. Since there is a constant gravitational field, the potential will just be m2*g*y (the real y).
Finally, we can get the whole Lagrangian.
Still not done.
Using the Euler-Lagrange Equation
Now for the fun stuff. Let’s use the Euler-Lagrange equation to find the “least action”. Since there are two generalized variables, we get to to do this twice. I’m going to start the equation for “x”.
I like to start with the partial of L with respect to x. But look! There are no terms with “x” in there. So, the partial of L with respect to x is just zero. See, that was easy.
For the next part, I will first take the partial of L with respect to x-dot.
Now, I’m going to use a trick that will be useful later. Since the partial of L with respect to x-dot is zero, then the following must be true (from the Euler Lagrange equation).
If the time-derivative is zero, then the term (partial of L with respect to x-dot) must be constant. So, I don’t actually need to take the time derivative of this thing. I just get this:
Like I said, this will be useful later.
Moving on the other variable (s), let’s do the same thing. Starting with the partial of L with respect to s.
There was only one term with an “s” in it, so that wasn’t so bad. The y0 term is a constant and it went away.
For the next term, I will start with the partial of L with respect to s-dot.
Taking the derivative with respect to time.
Putting these two terms into the Euler-Lagrange equation:
Finding Equations of Motion
So, now I have two equations:
I want to get x and s as functions of time. But I don’t have two equations with two unknowns — I have two differential equations. The key to solving any differential equation is to already know the answer. If you don’t already know the answer, just plan on doing it wrong a couple of times until you do know the answer.
In this case, I am going to take that first equation and solve for s-dot.
That’s just plain algebra — but I split it into two terms so that the first term is just a constant. Now I can take the derivative of both sides with respect to time to get:
Now I have two equations and both are in terms of s-double dot and x-double dot. Since I have an expression for y-double dot, I can substitute that into the other equation.
This only has x-double dot in it, so I can factor the x-double dot out and solve for it.
Boom. Notice that x-double dot is constant. That means the wedge has a constant acceleration. I already have an expression for s-double dot (above) and it only depends on x-double dot. That means the sliding block also has a constant acceleration.
Wait. Let’s make a quick check. What if the mass of the wedge (m1) is much, much greater than the mass of the block (m2)? In that case, the wedge shouldn’t really move at all as the block slides down — it will turn the problem into a very basic “block sliding down a plane” problem.
So, let’s look at what happens with a very large value for m1. For the x-double dot expression, m1 only appears in the denominator. Letting m1 get really large would make x-double dot get really small — almost zero. That’s what we would expect.
What about s-double dot for a massive wedge? Now I need to get the full expression for s-double dot (I thought I could avoid that). Here you go.
But of course this need to be simplified. The one of the cosines cancel. Also, I can let m1 + m2 = m1 since m1 is so much larger. Then I have this term on the bottom with the cosine squared:
I know that looks crazy, but that whole thing is just basically m1. Now I have s-double dot as:
And yes, that is the acceleration of a block sliding down a frictionless plane. Honestly, I’m sort of surprised it worked — normally I would make some algebraic mistake somewhere and it would all get messed up. Perhaps I still made two mistakes that accidentally fixed it. Well, you can go over this to make sure it’s correct.
Finally, there is one other check on this problem. You can use conservation of momentum and energy to find the final speeds of the objects and compare that to this Lagrangian solution. Here is how to do that.