Monday, November 14, 2016

Lorenz attractors, fluids, chaos and climate.

I have written two posts (here and here) on chaos, fluid dynamics and the Lorenz attractor. The context is a series of articles (eg here) which continue a common belief encountered that there is something basically wrong with climate models because they solve Navier-Stokes equations that are inherently chaotic, because of their non-linearity. Chaos is an inappropriately pejorative word here. Computational Fluid Dynamics (CFD) has been dealing with chaos (turbulence) since its beginning about fifty years ago. It is just part of the scene, and actually fits with what we want to know. Chaos is the inability to make solutions correspond to initial conditions. The initial information is lost, and does not recognisably affect the outcome. But that is a plus, because we usually weren't able to measure an initial state anyway. Often it is hard to even say what it would mean, as in flow past an aircraft.

The key to this is the existence of attractors. Trajectories wander, but not randomly. And it is the attractor we want to know about. Weather varies, but climate is the attractor. It is that which attracts people to Miami, not the weather forecast.

In my second post, in which I showed a WebGL device for generating and examining (in 3D) the famous Lorenz butterfly chaotic solution, I also showed a Wiki visualisation of an attractor. It was one of several there, but I am now convinced that it is wrong. The mathematical papers, from Lorenz on, refer to attractor surfaces. I found this out when trying to calculate attractors myself. In the process, I found out a lot more about the working of the Lorenz butterfly, and how the attraction works, without making everything just converge to one place. I'll describe that in another post. My purpose is to show that nonlinearity and "chaos" is no cause for despair; at least in this simple case, we can figure out everything we need to know.

The 1963 Lorenz paper gave the equations thus:

He used σ=10, β=8/3, ρ=28.

Importantly, it is an autonomous (no t on RHS) first-order differential equation. This means that the state (X,Y,Z) at any point entirely determines the following trajectory. Trajectories can't cross, and if they stably follow a surface, then representative values will show it. Regions where trajectories are curved are important, and since the equation is polynomial (quadratic, with well-behaved higher derivatives) fast change of direction is possible only if the first detivatives are small. Zeroes are especially significant, and Lorenz shows two of them - C and C' at the centers of the wings. The third is the origin, which is significant not because it attracts trajectories, but because the z-axis is a trajectory leading to it, which does not stably attract, but is responsible for the transition between the wings.

The wings are in fact logarithmic spirals, rather slowly evolving. So my plan for showing the attractor is to originate a set of trajectories across one period of this evolution. Because of the first-order properties, that means that those trajectories then should sweep out the whole spiral, and any trajectories attracted to the wings should be swept up with them. So I did that, starting near C. Since I only want the shape of the trajectories, not the time course, I varied the times steps to keep them advancing as a steady front. The result was:

Now it doesn't look so chaotic. I colored the 16 parallel trajectories near the spiral center (the smaller hole, on the right) with rainbow colors, black marking the red end. You can see that on that wing they evolve with that rainbow band. I have marked the origin with a red dot, and the z-axis with a red line. When the expanding band reached the z-axis, it behaves like a fluid stream meeting a wall. There is a stagnation point, and the lines separate. I chose the original band to ensure that it would not be split here; the trajectories eventually peel off and go into the other half-plane where they are attracted to the other wing. They smoothly merge with it, but at a big spread of points on the evolution of that spiral. So in timing, the trajectories are dramatically separated, but in shape, the surface behaves smoothly. You can see the blue trajectory came closest to the center, and had to wind around many times to emerge. I made the other trajectories wait. Then the whole process was repeated the other way, although no longer in rainbow order. No trajectory is periodic, but the attractor is.

That is the important weather/climate analogy. Weather, on times scales up to ENSO and even "pauses" etc, happens in an unpredictable time sequence. My band of trajectories is like an ensemble of GCM solutions. Looked at individually, they are a tangle, but together, they establish a pattern which is not (here) dependent on time, but does depend on the externally imposed parameter values.

Of course, we have a WebGL interactive version, below. It doesn't generate the solutions, but you can examine them from angles and restrict time subsets. I'll give details of using it below the jump.

The gadget, like its predecessor, is a development of my Earth-visualizing system. You can use left mouse button to rotate it, as if trackballing a sphere, and move right button vertically to zoom. Left mouse with shift key down makes it translate instead of rotate. In zooming, you should be aware that WebGL displays the content of a sub-box, normally surrounding the whole scene. Zooming displays a sub-box on full screen, and so contract in depth as well. You can use this to advantage by carefully placing the center red dot (which now doesn't signify (0,0,0) but the center of view). You need to do this in at least two views to place it in 3D.

There are buttons to set the rotations to show the yz, zx and xy plane views. These also reset the zoom and translate, so can restore if things have got messy. There is also a text box marked N. This gives a timestep at which the evolution is cut off. The initial value is the full number in the sequence; cutting back can make some things clearer. N=2520 is good for a transitional stage. Here is a snapshot showing the transition from one wing to the other:

The red line is the z-axis - note how it acts as a stagnation point, and the trajectories leave the first wing smoothly and transit to various levels of the second.

Appendix - How a trajectory fits in.

For completeness, I should show how an actual real-time trajectory is sucked into the attractor, and thereafter takes its place among the travelling band. This time I use just rainbow for the band, so the visiting trajectory is in thick black.

Appendix - time durations.

I've been plotting static paths of trajectories. Here is a version which shows with a sequence of graded dots (see key) the number of timesteps that have passed. Note that this does not apply to an individual trajectory, but to the collective front - essentially reduced to the slowest member. But it gives an idea of how they get faster at the outer wings. The scaling of the dots helps with choosing N values to stop the plot in the interactive gadget.


  1. Probably an inaccurate analogy, but even since watching Gavin Schmidt's lecture on chaos and climate I've wondered if the two attractors of the Lorenz equations might be analogous to the two quasi-steady states of a glaciated Arctic and Antarctic vs. their ice-free equivalents.

    There is a surprising amount of details that seem to be necessary to have our current ice-age prone climate state, including a southern polar continent, a restricted northern polar ocean basin, the rise of the Tibetan Plateau and the closing of the Panama Isthmus.

    1. "Probably an inaccurate analogy, but even since watching Gavin Schmidt's lecture on chaos and climate I've wondered if the two attractors of the Lorenz equations might be analogous to the two quasi-steady states of a glaciated Arctic and Antarctic vs. their ice-free equivalents."

      This is likely true. On a much finer time scale, the ENSO "attractor" is a biennial Mathieu modulation of the wave equation, which is forced by angular momentum wobbles of the Earth and due to lunar gravitational forcing. The wobble is partly the Chandler wobble measured at the North Pole which is a flattening of the pole. There is also a wobble due to the triaxial nature of the earth and that is related to an equatorial flattening. That wobble is ~14 years. These wobbles are both sensitive to distribution of mass. The lunar forcing is of course not related to the distribution of mass.

  2. If you want to see pretty pictures, head over here:

    The model is a biennial "attractor" (sorry that I have to condescend to that terminology) of ENSO. The beauty is that two completely non-overlapping intervals reveal precisely the same underlying periodic process.

    Lorenz may have hampered progress in modeling physical processes for generations as he implied that climate followed such extremely non-linear modes. The truth lies somewhere in-between the purely linear and highly nonlinear. This is the world of the Mathieu and Hill equations which are widely known in solid-state physics, astrophysics, and in (lo-and-behold) engineering hydrodynamics. In many regimes these are solvable and deterministic.

    Perhaps time to give up the toy models and move to something more practical.

    In particular, this premise is arguable:

    "Importantly, it is an autonomous (no t on RHS) first-order differential equation."

    This implies that the process is a completely resonant phenomenon, not subject to boundary conditions. What would make one think that spontaneous processes would occur on the scale of the Pacific Ocean?