home documentation

the hénon-heiles system

Hénon & Heiles + Strange Attractors

The Hénon-Heiles system was devised to define the non-linear motion of a star in galactic dynamics. The orbits are described as chaotic in the modern day. The system (HHS) is defined by four equations which I attempted to plot using Python. I chose this equation after learning about Strange Attractors. An attractor is defined as a system which has a wide variety of starting conditions, but which has states that said system tends to evolve towards. What makes an attractor Strange is when its dynamics are chaotic, changing wildly due to a sensitivity to its starting conditions, after any number of iterations. This dynamic system can be described as "locally unstable yet globally stable" (Gregbogi, Ott and Yorke, 1987).

I became interested in strange attractors due to their visual renderings - reminding me of deep sea creatures with their alien physiologies. There is a connection between the two subjects in that they both invoke mystery amongst the scholars in their respective fields.

visual references

Description from the artist/programmer: The attractor shown here is known as the Poisson Saturne attractor. It is a set in three-dimensional space and this video aims to give the viewer a fuller understanding of the set than what can be gained from one 2D image. The set consists of two separate parts; one is here colored in yellow/green and one in blue/magenta. 22 April 2021. by Bvsydow. (licensed under the Creative Commons Attribution-Share Alike 4.0 International license.)

images from the Monterey Bay Aquarium, CA

insert own sketches here

code outputs

I found a Python code by John Burkardt (distributed under the GNU LGPL license) that sets up the Hénon-Heiles ordinary differential equations (ODE) for the motion of a star moving around a galactic centre. The source code and original output images can be accessed here.

plotting in 2D...

I started with running the ODE program I had found with some minor adjustments so it would only output the plots I was interested in. Doing so helped me figure out the nature of the visuals I could extract from the equations. I want my final outcome to be animated, and so decided the euler Orbit plot could be useful within my own code.

plotting in 3D...

To familiarise myself with three-dimensional plotting in Python, I followed a quick Geeks For Geeks tutorial on the types of plots I liked and could imagine the HHS mapped onto.

combining with the HHS...

I used the techniques I had learnt from the ODE program and the Geeks For Geeks tutorial to create my own code which combined the two skillsets. I took the results of the equations and used them as points to plot on the graph. You can see in order the iterations it took to map the points onto three planes.

creating a 3D shape...

Lastly I modified the code to push the results of the equations through a function that would create an orbital shape.

In this last plot, I attempted to combine the orbital equation with the a surface-triangulation plot, but it ended up flattening back onto two dimensions.

The code looked like this:

After all the plotting I figured a way to animate everything would be to send the final values across to a JavaScript sketch. I managed to do this successfully but moved onto other tests. I didn't move forward with this system because ultimately I felt I didn't have a solid understanding of the mathematics behind it, at least not enough to stake my entire project on it. Further more the code was becoming more and more convoluted. I'm sure there were many opportunities for abstraction and optimisation that I was missing, so decided it wasn't worth it, especially for a visual output I wasn't pleased with.

sources