# Lagrangian Problem that I'm stuck on.

1. Jul 5, 2006

### finchie_88

This is the problem (exact wording):
An infinitely long rod is being rotated in a vertical plane at a constant angular velocity w about a fixed horizontal axis (the z-axis) passing through the origin. The angular velocity is maintained at the value w for all times by an external agent. At t = 0 the rod passes through zero-inclination, i.e., q = 0 at t = 0 where q is the angle the rod makes with the x-axis. There is a mass m on the rod. The mass' coordinates and velocity components at t=0 are

$$r(0) = \frac{g}{2 \omega^2}$$
$$\theta(0) = 0$$
$$\dot{r}(0) = 0$$
$$\dot{\theta}(0) = \omega$$

where g is the acceleration due to gravity. The mass m is free to slide along the rod. Neglect friction. Hint: Recall that in plane polar coordinates the unit vectors and are not constant.

http://electron6.phys.utk.edu/phys594/archives/mechanics/images/1997m/Image509.gif [Broken]

(a) Find an expression for r(t), the radial coordinate of the mass, which holds as long as the mass remains on the rod.

This is what I tried:

Let T be the kinetic energy of the 'system', so that in polar coordinates,
$$T = \frac{1}{2}m(\dot{r}^2 + r^2\dot{\theta}^2) = \frac{1}{2}m(\dot{r}^2 + r^2\omega^2)$$. (I wasn't given the expression for the speed, so had to derive it from first principles, so it is right?)
Let U be the potential energy of the system, so that:
$$U = mgrsin\theta = mgrsin(\omega t)$$
Therefore, the Lagranian is:
L = T - U, so: $$L = \frac{1}{2}m(\dot{r}^2 + r^2\omega^2) - mgrsin(\omega t)$$
$$\frac{d}{dt} ( \frac{\partial L }{\partial \dot{r}} ) = \frac{\partial L}{\partial r}$$, so:
$$m \ddot{r} = mr\omega^2 - mgsin(\omega t)$$
My last question is this: To solve the problem, do I need to solve this differential equation? If so, how? - I've had an attempt, but I'm quite sure that my answer is wrong. I won't post it on here unless someone wants to see it. I've never actually solved a second order differential equation before (first order, yes). Thanks in advance.

Last edited by a moderator: May 2, 2017
2. Jul 6, 2006

### Mute

Well, I was thinking at first the problem might be that you didn't differentiate with respect to theta in the lagrangian to get another differential equation to add to your system, but since the angular velocity is maintained at omega I guess it's not really a variable, so that's fine. (It's also good, because I don't think you can solve for r(t) otherwise!)

So, if you got the lagrangian and corresponding differential equation correct, then yes, you would have to solve that ODE to get r(t). The way to do that is to first solve the homogeneous equation:

mr" - mw²r = 0

If you're not sure how to do this, guess r(t) = exp(a*t), where a is some constant. This reduces the problem to a quadratic equation which you solve for a. This will give you two solutions for a, and thus two solutions for r(t): r1(t) = exp(a1*t) and r2(t) = exp(a2*t). Add those two solutions together to get the "homogeneous solution": r[h](t) = A*r1(t) + B*r2(t). Use your inital conditions to pin down A and B.

Then, guess a particular solution of the form r[p](t) = C*sin(wt) + D*cos(wt) and plug it into the ODE. Group the result into (stuff)*sin(wt) + (otherstuff)*cos(wt) = -mgsin(wt) and solve the linear system {stuff = -mg, otherstuff = 0} for the coefficients C and D.

r(t) = r[h](t) + r[p](t)

I hope that helps (and that it's all correct!)

3. Jul 6, 2006

### finchie_88

Thanks Mute, although I still have a few questions...
How come you can assume that mgsin(wt) = 0 for the above solution part?
Are you simply using educated guesses to reduce the problem so that it can be solved?

4. Jul 6, 2006

### BoTemp

You might want to pick up a book on differential equations. Or, if you have one, read the part on second-order ones. Educated guessing is the only guaranteed method, in fact, and what Mute is saying is correct.

Re-arranging your equation as $$m \ddot{r} - mr\omega^2 = -mgsin(\omega t)$$ is a standard first step. This is a linear differential equation: if r1 and r2 are both solutions, then a*r1 + b*r2 is a solution (a&b scalars). Equations of this type have what are called "homogeneous solution" and a "particular solution". Placing all terms with r(t) on one side and the "forcing function" (sin(wt) here) on the other makes it a bit easier to see. If r1 solves $$m \ddot{r} - mr\omega^2 = -mgsin(\omega t)$$ and r2 solves $$m \ddot{r} - mr\omega^2 = 0$$, then because the equation is linear, plugging r1 + r2 into the equation will give you -mgsin(wt) + 0 = -mgsin(wt).

Linear homogenous difeqs will always have exponential solutions, so using Mute's method will give you the homogenous solution. The particular solution can be found by guessing a solution of the form D*sin(wt) + E*cos(wt); the forcing function and it's derivatives. Sinusoids are easy to work with because their derivatives repeat, you might not always be so lucky. But for an n-th order equation, the a sum of the forcing function and it's first n derivatives are a good guess. Plug the above guess into the difeq and see what D and E need to be.

The reason for the homogenous solution is that the particular solution won't be able to fit arbitrary boundary conditions. D&E will end up being fixed by the mg necessity.

By the way, this is a pretty basic second-order. You should be able to solve it from here; it'll be a good learning exercise. Solving this problem a different way would probably be a great deal more difficult.

Last edited: Jul 6, 2006
5. Jul 7, 2006

### Mute

I think BoTemp explained it well, so I'll just add a couple of comments on ordinary differential equations here:

For the nonhomogeneous 2nd order equation

y" + p(t)y' + q(t)y = g(t)

with solutions Y1 and Y2, and if y1 and y2 are two different solutions to the associated homogeneous equation

y" + p(t) + q(t)y = 0,

then Y1 - Y2 = a*y1 + b*y2. (a and b are real numbers). This is easy to show; plug Y1 into the homogeneous equation and Y2 into the homogeneous equation (separately) and subtract the two; by the linearly of the derivative operation You'll find Y1 - Y2 satisfies the homogeneous equation, which means that it's equal to some linear combination of y1 and y2. Thus, Y1 = a*y1 + b*y2 + Y2.

This is why we solve the homogeneous equation first (it's important to note that I wasn't setting mgsin(wt) = 0, but rather mr" - mw²r = 0); once we've found the homogeneous solution it simply suffices to find some particular solution to the equation, and the full solution is just homogeneous + particular.

As for the educated guessing, yes, that is pretty much what we do. (It's more formally called "The method of undetermined coefficients", but as even my ODE professor admits, it should be called "the method of educated guessing"). There is a more general method called "Variation of Parameters", but for simple forcing functions (g(t)) like sin(a*t), cos(a*t), exp(a*t), a polynomial, a constant, it's easiest just to guess the form of Y2 being something that looks like a linear sum of the g(t) and its integral or derivatives. Once you plug the guessed Y2 into the ODE, you rearrange the terms so that they look like the forcing function side and then try to solve for the coefficients so that that two sides match. (A textbook might explain this more clearly... Plus they usually have a table of typical easy forcing functions and the standard types of Y2 to guess for the particular solution).

Last edited: Jul 7, 2006
6. Jul 9, 2006

### finchie_88

Thank you both, I think I'm getting the basics of solving these types of equations.