
Double Pendulum Visualization - SiempreViernes
https://jnafzig.github.io/2018/02/05/double-pendulum.html
======
gus_massa
Nice graphics!

In the bottom graph of the time to flip:

The point of the white eruption to the right looks like a fractal. Is it a
fractal or it's only an artifact of the simulation? Can you post a zoom of
that part? Can you run that part with more precision in the simulator and
compare them?

What is the white smooth quarter/parabola at the bottom? Is this the zone
where the energy is not enough for a flip? Is there an easy way to
calculate/approximate it analytically?

Image version of the questions:
[https://imgur.com/a/siyEy](https://imgur.com/a/siyEy)

~~~
rocqua
I had the same thoughts.

There definitely is an easy way to calculate a lower bound on the amount of
energy required for a flip. It is simply the gravitational energy with the top
pendulum on the lowest position and the bottom pendulum upright.

The total energy of an initial condition can be calculated very similarly,
because it starts of stationary. For the exact calculations it matters whether
the pendula have a point mass at the bottom or matter throughout the stick.
This matters a lot more for the actual simulations though, due to moment of
inertia.

Let's presume point masses at the pendula, a weight of 1 unit for both and a
length of 1 for both. Similarly, we set the gravitational acceleration to 1.
We set the energy where both masses are level with the pivot as 0. We call the
angle of the top pendulum A and that of the bottom pendulum B. Angles are
measured against the horizontal (doesn't match the image but is easier to
calculate with)

Then the potential energy of an initial condition is: sin A for the top
pendulum and (sin A) + (sin B) for the bottom one leading to 2 sin A + sin B
in total. The minimal energy for a flip is -1.

Thus the threshold energy for a flip would be the curve [2 sin A + sin B = -1]
wolfram alpha tells us this:

[http://www.wolframalpha.com/input/?i=2+sin+x+%2B+sin+y+%3D+-...](http://www.wolframalpha.com/input/?i=2+sin+x+%2B+sin+y+%3D+-1)

That curve seems to match the image if you take into account the rotated angle
(I took angles with the horizontal, the image uses angles with the vertical,
with an angle of 0 pointing down).

So I'd guess that indeed when there is enough energy for a flip, it tends to
happen. This is kind of expected when you know that chaotic systems are often
'ergodic' (not sure how that works in Hamiltonian systems, i.e. those with a
preserved energy). This vaguely means that movement is so erratic as to reach
every single point it could. Thus when it can flip, it probably does. The real
interesting question is why it doesn't flip in that seemingly fractal part. It
would be even more interesting if we could have some formulation of that
fractal kind of like the julia or mandelbrot fractal.

~~~
ThrustVectoring
The fractal part looks to me like it's probably better colored as a very deep
green. It likely would flip eventually, but reached a simulation time limit
first. There's a few other small areas that are near green streaks that are
also colored in white, too.

------
user2994cb
Another visualization, using JS to solve the Langrangian:
[https://matthewarcus.github.io/lagrange/](https://matthewarcus.github.io/lagrange/)

------
euler_
I really like the animation, but I'm confused by it. I thought that the whole
thing with chaotic systems is that extremely slight differences in starting
positions lead to very different outcomes. The continuity of the gif is
surprising.

~~~
aaachilless
You'll see the chaotic behavior if you look around the vertical initial state
at the top center of the graph. The initial states nearby evolve quite
differently than each other.

"Chaotic" describes a system only locally around specific initial states. So a
system can be chaotic near one initial state and stable near another.

------
happyguy43
Using automatic differentiation is very cool. Kudos

