# Lagrange's Equations for a Tetherball

1. Mar 17, 2014

### hanyas

I'm trying to write down the equations of motion for a tetherball moving in 3D around a pole while the string is getting shorter.

I've started with lagrange equations:

$x(t)=l(t) \sin (\theta) \cos (\phi)\\ y(t)=l(t) \sin (\theta) \sin (\phi)\\ z(t)=h(t)+l(t) \cos(\theta)\\ \\ T = \frac{1}{2}m(\dot x^2 +\dot y^2+\dot z^2)\\ U=m g l(t)(1-\cos(\theta)) + mg(S-(h(t)+l(t)))$

where $l(t)$ is the length of the string. Here only I am assuming the radius of the pole is really small compared to $l$. The polar angle is $\theta(t)$. $h(t)$ is the change in height due to the string wrapping on the pole. $S$ is the length of string when unwrapped.

The change in length along is given by:
$\dot l(t) = -\frac{r\dot\phi}{ \sin(\theta)}$

where $r$ is the radius of the pole. And the sliding pivot point is given by:
$\dot h(t) = \frac{r\dot\phi}{ \tan(\theta)}$

After plugging those in $T$ I apply the Lagrange derivative to $L = T-U$ and solve for $\ddot \theta$ and $\ddot \phi$

Now when I simulate the results I get a linear velocity that is some how increasing which is not supposed to happen for a tetherball because no new energy has been introduced to the system and the angular momentum is not conserved.

I would appreciate some feedback

Last edited: Mar 17, 2014
2. Mar 17, 2014

### BvU

Hello hanyas, and welcome to PF. The template is there for good reasons (see guidelines), so don't edit it away.

Can you explain the U equation ?

3. Mar 17, 2014

### hanyas

Oh I'm sorry I thought the template was just there for guidance.

Well the first part of $U$ is the normal pendulum like potential energy. I might have chosen a weird zero point though. I thought I want the minimum of potential energy when the ball is hanging down. The maximum would be then when you move the ball the way all the way up to $\theta=π/2$.

I'm not sure about the second part. Here too I am saying the potential energy when the ball has not wrapped around the pole at all is equal to zero. And when you take the extreme case of the $l(t)$ being equal to zero (completely wrapped) you have to have some potential energy in order for the ball to swing in the opposite direction.

4. Mar 17, 2014

### BvU

Wouldn't it be easier to take U = mgz ?

You say you assume r << l. Where do you need that ?

Also, h is not "the change in ..." but simply the position of the point where the wire separates from the pole.

5. Mar 17, 2014

### hanyas

yes I guess U = mgz would be easier. But isn't it just a convention issue? I've actually already tried that with similar results. I know only the difference in energy is actually what matters. it is that just at some point i wanted to have it in a form I could imagine. And maximum potential energy when the ball is up seemed good.

About h(t): I agree and this is what I wrote or what I meant to communicate. The differential equation for h(t) only describes how the "pivot" is moving down the pole.

6. Mar 17, 2014

### BvU

Sorry, I meant U = - mgz in case you want to have g = 9.81 m/s[sup2[/sup]. You have z and g pointing down. Difference is indeed what matters, but the sign simply has to be correct.

So now there is a differential eqn. Apparently you have some simulator that comes with uneexpected results? Can you show or describe some in a bit more detail ? (initial conditions, numerical values, etc.)

7. Mar 17, 2014

### hanyas

I have a small Mathematica script that solves the equations numerically. Another thing that I'm not sure about is how to use the differential equations of l(t) and h(t). Do they come in the Lagrangian as constraints?

But you can see what I did clearly in the script: http://pastebin.com/wUMj0Zyr

If you can run the script you will see the that angle theta keeps growing. Depending on the initial value it could even go over pi/2. Which does not really make sense. Also the energy is increasing over time.

8. Mar 17, 2014

### BvU

Don't have Mathematica here. Do I see line 12 active ? And what is the l(t) doing in line 13 ?

If you write your Lagrangian in terms of $\theta$ and $\phi$ there are no l and h any more !

So what does L look like when fully written out ?
And the equations of motion?
Having such a tool is nice, but you learn a lot more when you do it by hand (*). Whatever, a lot of checking is essential!

I'm not sure what to think of the coordinates. You have x, y, z and l(t) (**) as a constraint, so that leaves you with two generalized coordinates $\theta$ and $\phi$.

h and l are found once $\theta(t)$ and $\phi(t)$ are known from solving the equations of motion.

Only genuine constraint I see would be S but it's quite a difficult one ( l + some integral of h = S)! A good second is then l, which you have already processed.

(*) This is the place where I would make use of l >> r to keep it reasonable. Later on, if it all works, you can let Mathematica do the work of seeing the effect of bigger r.

(**) Only genuine constraint I see would be S but it's quite a difficult one ( l + some integral of h = S)! A good second is then l, which you have already processed.

9. Mar 17, 2014

### hanyas

line 12 is active. That's where U is being calculated. I've just checked and it does not matter if I use line 12 or 13 for U. The l(t) in line 13 is an error.

In lines 14,15 I am practically plugging the differential equations of l(t) and h(t) into T because it contains the derivatives. Is that the right way to do it or do I have to introduce the equations of l(t) and h(t) somehow as extra constraints with lagrangian multipliers maybe?

I'm not sure what you mean here. I can only substitute the derivatives of l(t) and h(t). But l(t) and h(t) still come up in the Lagrangian. Here is T and L while taking into consideration that l>>r.

$T = 0.5 m \left(l(t)^2 \left(\phi '(t)^2 (0.5\, -0.5 \cos (2 \theta (t)))+ \theta '(t)^2\right)+ \\ h'(t) \left(2l'(t) \cos (\theta (t))-2 l(t) \theta '(t) \sin (\theta (t))\right)+ h'(t)^2+ l'(t)^2\right) \\ L = m \left(l(t)^2 \left(\phi '(t)^2 (0.25\, -0.25 \cos (2 \theta (t)))+0.5 \theta '(t)^2\right)+g h(t)+ \\ l(t) \cos (\theta (t)) \left(g- r \theta '(t) \phi '(t)\right)+0.5 r^2 \phi '(t)^2\right)$

10. Mar 17, 2014

### hanyas

I am uploading plots from Mathematica for a result of simulation. The plots are for [theta, phi, l , T, U, L] respectively. You can see how theta keeps growing and how the energy is also increasing.

#### Attached Files:

File size:
7.7 KB
Views:
80
File size:
5.1 KB
Views:
77
File size:
5.4 KB
Views:
75
File size:
8.1 KB
Views:
81
File size:
7.6 KB
Views:
88
• ###### tetherball-sym6.jpeg
File size:
6.8 KB
Views:
72
11. Mar 17, 2014

### BvU

You're right. So you end up with four equations of motion and two Lagrange multipliers. Awkward...

12. Mar 17, 2014

### BvU

Nice plots. I'll have to sleep over it and might chew on it some more tomorrow.
Perhaps others are listening in and have something constructive to say ? (I hope so..")

13. Mar 18, 2014

### hanyas

I made some progress if you are interested. Instead of plugging the differential equations of l(t) and h(t) I built the extended Lagrangian with the constraints and the multipliers. Now the energy is conserved and the angle theta does not increase randomly.

Here is link to the new mathematica code: http://pastebin.com/MZ2zEpZ7

There still seems to be a a problem that l(t) does not converge to 0 (not wrapped completely). Which is something new.