# Time it takes for a mass in a linked pendulum to flip?

I have created Mathematica code that simulates a double pendulum. So I've numerically solved for $\theta_{1}(t)$ and $\theta_{2}(t)$. I have also found the momentum from the Lagrangian as well.

My question is: what is the determining factor of when the farthest mass (i.e., $\theta_{2}(t)$) flips? I've read that this is not an easy question to answer, but if I can numerically solve for everything, is there a way of "figuring it out"?

So below are two graphs, the first one is the angle of the farthest mass, and the second one is the momentum. (Don't worry about the three different curves; these were just to show chaos):

Now, by actually watching the simulation, I can see that the second mass flips at around the 10 second mark. You can kind of guess at a few things by looking at $t=10$ on each graph, but what actually defines "flipping over" from just the angle and/or the momentum? How can I "ask my Mathematica code" to tell me when the second mass flips?

The question basically is: if I gave you only the two graphs above, could you figure out the time that the mass flipped? And how did you come to that conclusion?

Aside: With this, I am trying to determine, or at least HINT, to when the system is going to start changing completely. Interestingly, I've also created a function that determines approximately when the system "becomes totally different". I define "totally different" as the angle between the second mass being 1 radian more or less than it was with other initial conditions. With that, I can plot "the time it takes for the system to be totally different" vs. "small changes in initial condition of the farthest mass". The plot looks negative logarithmic. The only problem with this is that 1. I have arbitrarily defined "totally different", and 2. "varying initial conditions" is ambiguous--do I change both angles? One angle? The other? Would all of those curves look similar? If not, then perhaps the fact that this plot of "time to change" vs. initial conditions looks negative logarithmic is simply an intrinsic property of how I've coded everything, and not the physics behind the actual pendulum.

Anyways, my main question is how to determine when the pendulum flips from the angle and the momentum. I am looking for as many ways as possible to guess at when the system will change from some alteration in initial conditions.

• Yes, but because the solutions are chaotic, the actual solution will differ from the simulated one, specially for longer times. Halving the times and getting the same solution stells you that your simulation is faitfhul enough. – Wolphram jonny Nov 29 '14 at 14:58
• There are various arguments you can feed into the function NDSolve, but I don't see that as being important here. Those graphs you see above (except the last one) use time steps that are infinitesimally small (practically). It's as if we had an explicit function for theta. For now, let's just assume that the time to flip over is correct. – Sultan of Swing Nov 29 '14 at 15:02
• Maybe I'm misunderstanding. Let me phrase the question this way: if I give you the two graphs I posted above, could you tell me when the second pendulum flipped? – Sultan of Swing Nov 29 '14 at 15:04
• Since the time increment is infinitely small, then I agree that the results are predictable. I'm going to erase my earlier comments. – LDC3 Nov 29 '14 at 15:13
• This question is probably not what this site is used to: I was contemplating asking on Mathematica Stack Exchange but I figured I would ask here as the question, fundamentally, is pure physics, and not dependent on any programming language or how the graph was obtained. We can safely assume the simulation is sufficiently correct. – Sultan of Swing Nov 29 '14 at 15:24

So I figured it out--wasn't too hard.

First, we need to decide what it means for the mass to have "flipped over" The point where the mass flips is the point where the absolute angle it makes with the normal is bigger than 180 degrees:

So when all we need to do is find the first time when $|\theta_{2}|>\pi$. That can be done with any programming language by looping through time $t$ for some defined time period. For initial conditions that are between $\pi/4$ and $\pi/8$, the first flip of the second mass usually happens within 20 or 30 seconds. So you'll have to work with it to figure out over what time frame you want to look for that time. I chose from $t=0$ to $t=30$, and I used intervals $\delta t = 0.01$ for some decent accuracy.

Now create a loop that starts at $t=0$ and continues to go up and evaluates whether $|\theta_{2}|>\pi$ is true or not. When it is TRUE, the code should catch and throw the first time that $|\theta_{2}|>\pi$. Throw will exit the loop. Mathematica does this; see their Catch documentation.