An amateur’s take on the Lorenz system

Some things in life are chaotic. Let’s think of a blossom’s beautiful petal carried by a late spring day’s soft and soothing winds. Let’s think of a droplet of black ink being dropped into a glass of water and how it disperses and dissolves smoothly. The trajectory of the leaf, the way the ink spreads and thins out – they are basically impossible to predict. Why is that so? Well, the easy answer would be to say because they are chaotic, and that’s that. End of this blog post.

But wait, not so fast!


Sweet, sweet chaos


Can’t those things be calculated after all? The aerodynamics of a petal should be computable. So should the air movement it has to travel through. Or the density of the ink given its and the water’s current temperature, its velocity when it hits and enters the water, etc… Such aspects can indeed be calculated. So, in theory at least, the petal’s trajectory or the ink drop’s way of dissolving would be predictable. And maybe, in a hypothetical, perfect laboratory setting, they could even be reproduced. But once we exit the realm of the hypothetical and enter the real world… well, chaos already awaits us. Chaos, and countless situations and scenarios that affect our lives way more than a petal in the wind or an ink droplet. The spread and evolution of diseases or vermin would be a good example (I think we all remember COVID-19 vividly, or let’s think about the several locust plagues that repeatedly have haunted regions in Africa and the Middle East). Or what about the financial crises we have had over the last decades, the bursting of the housing bubble in 2007/2008, or the inflation surge the world is experiencing as I write these lines? And as a last example – and a bridge to the Lorenz system – let’s take the weather. Have you ever been surprised by a summer thunderstorm that seemingly came out of nowhere? Every spring, Austrian farmers are worried about short-term cold snaps because frost overnight can be fatal for the blossoms and hence destroy a significant percentage of the year’s crops. Some years, the cold snaps come, some years, they don’t.

So, what do these scenarios have in common? Well, chaos, obviously. Unpredictability. Uncertainty. But they also have in common – just like the examples of the petal or the droplet – that they (to some extent, at least) are based on systems whose properties can be calculated, modeled, and analyzed. As is often the case, the devil is in the details. And in the initial conditions. Because that’s what it boils down to essentially: a dynamic system with deterministic properties can end up in wildly diverging states even after the shortest amount of time if the initial conditions are just slightly different. This is what Edward Lorenz found and described in the 60s. Admittedly, the word “found” is a bit far-fetched. The first studies of such systems go back to the late 1800s. But it was Lorenz who (with the help of computer scientists Ellen Fetter and Margaret Hamilton) gave the study of chaos a face and a name. And no, the face is not his face, and the name is not his name. The Lorenz attractor, which you will see in just a bit, has become a common symbol representing chaos theory.


Pop culture loves chaos


His idea of the “butterfly effect” was probably one of the biggest success stories regarding scientific ideas taken and adapted by pop culture. Just look for it on IMDb. Besides the 2004 blockbuster are countless other movies, tv shows, and episodes. The same goes for songs, artists, and even podcasts if you look it up on Spotify or YouTube. I would have never imagined ordinary differential equations (ODE/ODEs) so popular! Well, probably most of the 415 Million people who have listened to Travis Scott’s song “Butterfly Effect” on YouTube don’t really know what ODEs are, nor what the butterfly effect actually is about and where it comes from. But still. Pretty impressive.


Let’s get nerdy


So, what is it all about then? It is not about some sort of time travel, as the movie suggests, but about atmospheric convection. But the message is mostly the same. However, let’s keep in mind that the butterfly effect is merely a take-away message from the Lorenz system, a byproduct of sorts, a revelation. And the Lorenz system, in turn, is but a set of three ODEs with a cool look when plotted:

This is what a Lorenz attractor can look like. The parameters are set close to the ones originally used.

I have a very poor math background; even worse is my physics knowledge. I chose the title for this post for a reason. So, please, take what I am about to write with a grain of salt (or maybe two grains even), and feel free to contact me if anything needs to be clarified or corrected!

Having said that, let’s talk ODEs; more specifically, let’s talk Lorenz equations:

{dx\over dt} = {\sigma(y-x)},
{dy\over dt} = {x(\rho-z)-y},
{dz\over dt} = {xy-\beta z}.

So, what do we have here? Some Latin and some Greek letters. Very mathy. The Latin letters – x, y, z – refer to, as most readers probably have figured on their own, coordinates in a 3D cartesian coordinate system. The Greek letters – 𝜎 (sigma), Ξ² (beta), 𝜌 (rho) – are constants and the system’s parameters. More precisely, they constitute “system parameters proportional to theΒ Prandtl number,Β Rayleigh number, and certain physical dimensions of the layer itself” (layer refers to a layer in the atmosphere). I took that from Wikipedia and will not be able to go into detail. This is physics stuff that is way above my pay grade. What I do know, though, is that originally those parameters were set to

𝜎 = 10;
Ξ² = 8/3;
𝜌 = 28;

which results in something like this:

Now, when you look at this plot, try not to picture it as a peace of red thread laid out in this particular way. Rather, imagine it as the trajectory of a moving object. Imagine you would turn on a GPS tracker and have it monitor and save where you are going. This is what is happening in this plot (there is an animation in this blog post by Geoff Boeing that shows that quite neatly). We see where a little red dot went from starting at the coordinates x = 0.1; y = 0; z = 0. The differential equations mentioned above tell it where to go. Indeed, the little red dot is predestined to walk a certain path. The Lorenz system is what is called “deterministic.” But wait. If the Lorenz system is the showcase model of chaos (theory)… how can it be deterministic? How can it be that the red dot’s trajectory follows a strict, replicable pathway? Well, let me tell you this: Chaos is not always as chaotic as it seems. But to understand that better, we have to look at the equations again.


Being dynamic

Being sensitive


Okay. Now we already know quite a bit. But the really juicy stuff still is ahead of us. So, differential equations, put in simple terms (really simple. Simplistic even. At least simple enough that even I can wrap my head around them), are a way of describing change over time. We have seen above that they are written as dx/dt (dx over dt), where x is the variable we look at, t is time, and d stands for derivative and represents the rate of change. In the present context, we have the coordinates for each axis, x, y, and z, as our variables that change over time. Hence, three equations, one for each dimension our little red dot can move in. Looking at the equations again

dx/dt = 𝜎(yx)
dy/dt = x(𝜌-z)-y
dz/dt = xy-Ξ²z

it strikes that every equation includes at least two of the coordinates. The trajectory of x depends on its own value but also the value of y and the parameter 𝜎. And so on and so forth for the other equations. This is really cool! And, depending on how you phrase it also incredibly trivial: The change of position of our red dot at every time point depends on its position in the coordinate space at the previous time point. Wow. You have read all that just for that epiphany…

But bear with me because this property is as exciting as it is important! It means that the system is dynamical. That is, any given state of the system depends on previous states and influences its future states. The state of our dot at t depends on its properties at t-1 (and due to the deterministic nature, every state at t-1 has exactly one state at t it can transition to). And remember, the properties at every point t are not only its position in the coordinate space but also the parameters (𝜎, β, 𝜌) set for the system. If we follow this line of thought, we come to realize that if we were to go back to the very beginning and played around a bit with the initial conditions, the whole thing would result in a unique new system. It is not only dynamical, but it is also sensitive to initial conditions.

And to illustrate this, I did indeed go back to the beginning to play around with the parameters. In the following video, you see the system (or rather the plotting of the dot’s trajectory) under various conditions. As there are six things to play with, three coordinates, and three parameters, there is plenty of possibility to change things. I chose to change the values of the three parameters by increments of 10%. I did this by simply multiplying the parameter settings by a scaling value. This is what the parameter “scale” in the plot legend refers to. For the video, I started with the lowest scaling factor and increased it. Hence, it goes from 0.1 to 2, and a scaling factor of 1 corresponds to the original parameters, as described above. The number of steps the system iterates through is the same for all conditions plotted. Just grab some popcorn, lean back, and be amazed by how strongly these simple changes affect the system’s behavior:

The little red dot had a little identity crisis. It realized that deep inside, it had never really been truly red. So it is blue now.

Back to the butterfly


In my humble opinion, how the system evolves with increasing values for Οƒ, Ξ², and ρ is pretty neat. Especially the jump from one attractor on the left to two attractors at a scaling factor of around 0.8. But also, the form of the system – the two attractors, the typical butterfly figure – then more or less seems to stabilize in its form and only increases in size until it exceeds the standardized space it evolves in. At least until a scaling factor of 2. Who knows what happens past that point?

So, I just mentioned the resemblance of the attractor with a butterfly. And I talked quite a bit about the butterfly effect in the beginning. Now, the thing is this: it is actually not this typical form that coined the term butterfly effect. It is a combination of two properties of the system. On the one hand, the trajectory never repeats. At each time step, the dot will be situated somewhere in the coordinate space it has never been before. And on the other hand, as discussed above, each time step determines the subsequent one. It follows that different initial conditions evolve in a way that never repeats. This means, in turn, that all chaos is unpredictable. Even the chaos that evolves from a deterministic system. The slightest changes in initial conditions can lead to grand alterations in the development of the system that cannot be foreseen. To exemplify this, Lorenz used the analogy of a butterfly flapping its wings somewhere in Brazil, thereby causing a tornado in Texas. Hence, the name butterfly effect.

This is also why there is all this fuss about the increase in global temperature. What could 1Β°C or 2Β° (Celsius, that is) possibly do when temperatures around the globe range from roughly -90Β°C (in Antarctica) to about 50Β°C (e.g., Death Valley)? Well, that is the point. It is impossible to predict. But it is quite obvious that the global climate is a very delicate and subtle system consisting of countless interconnected and mutually dependent subsystems. So, chances are that any disruption of that will have dire consequences.


Some last remarks


I hope to have sparked some interest in and fascination for this cool system, its properties, and its implications, to have inspired you to dig deeper into it and discover and appreciate all the facets it has to offer. That’s all I can ask for, really. Admittedly, I myself do still not grasp every detail about it, so that’s what you get from this article. Which doesn’t mean that I want to downplay everything here. It was a fun adventure diving into the Lorenz system, and let me carry away by the beautiful chaos it represents.

Also, I am aware that the way I animated the system is unconventional. At least compared to what I have seen so far during my research.

The code I used to create the plots and the animation can be found on my GitHub repository.


Sources


The main source of inspiration for this blog post was a short lecture series at the Interdisciplinary College 2023 by Prof. Herbert Jaeger from the MINDS group at the Rijksuniversiteit Groningen. The course had the title “A Dynamical Systems Primer” – and it was as fabulous as it sounded. In fact, he decided to add an additional 5th lecture which took place in the evening, after dinner, in addition to all the leisure time activities the event had to offer. And despite all that, the lecture room was filled to the brim with people, and he continued talking about dynamical systems until around 11:30 p.m. That’s how inspirational this course was!

Apart from that, I took some information from Wikipedia (who doesn’t, really?), but mostly also from the two blogs you’ll find below. Especially for the code I used to create the plots and animation. Also, YouTube is always a nice resource for some basic research and for getting an overview of a topic. You also find two videos on the Lorenz attractor and the Butterfly Effect below. Furthermore, ChatGPT helped me out with the coding.