Chaos Demonstrations Explanations Driven Pendulum In this driven pendulum the restoring force is proportional to the sine of x rather than to x as in a simple harmonic oscillator: x'' + Bx' + sin x = A sin wt The resulting motion is complicated. With w=0.7, you see simple periodic motion for A=0.4, a more complicated but still periodic motion for A=0.5, and chaotic motion for A=0.6. The chaotic motion can be seen in the real-space view 1 and in the views of sin(x) or v versus time, but it is most easily seen in view 4 of angular velocity v (or x') versus angular position x. Such a plot is called a phase-space plot. Also shown is a Poincare section which shows the phase-space position at the instant when the phase of the drive crosses zero. Periodic motion produces distinct points the number of which is the period of the motion divided by the drive period. Chaotic motion fills in a large portion of the plane. The Poincare movie shows the Poincare section at successive phases of the drive. The return map provides similar information. The view 8 of potential energy shows a graph of 1-cos(x) versus x. A small damping term (Bx') has been added to allow initial conditions to damp away. The damping is caused by friction, which is always present in real oscillators. Wait for a few dozen cycles after each parameter change to allow the damping to occur. Nonlinear Oscillator In this nonlinear Ueda oscillator the restoring force is proportional to the cube of the displacement, rather than to the first power as in a linear oscillator that obeys Hooke's law: 3 x'' + Bx' + x = A sin wt Such an equation might model a mass on a very hard spring or an electrical RLC circuit with a highly nonlinear inductor. The resulting motion is complicated. With A=2.5, you see chaotic motion for w=0.7, periodic motion with period 1 for w=0.9, and periodic motion with period 3 for w=1.2. Vary the parameters A, B, and w and count the number of points in the Poincare section to see how many different periodic solutions you can find. The periodic and chaotic solutions are intermingled in a complicated way. A small damping term (Bx') has been added to allow the initial conditions to damp away. Wait for a few dozen cycles after each parameter change to allow the damping to occur. The various views are analogous to those described in the Driven Pendulum demonstration. The potential energy in this case is proportional to the fourth power of x (a quartic potential well). Duffing Oscillator The inverted Duffing oscillator is governed by the equation: 3 x'' + Bx' - x + x = A sin wt There are three equilibrium positions. The one at x=0 is unstable, and the ones at x = ñ1 are stable. An example of such a system would be a flexible rod rigidly clamped at the bottom and with a mass at the top. The equilibrium with the rod vertical is unstable, and the rod flexes to the right or left. When this system is driven sinusoidally, it exhibits either periodic or chaotic motion depending on the amplitude A and frequency w of the drive. The periodic and chaotic solutions are intermingled in a complicated way. A small damping term (Bx') has been added to allow the initial conditions to damp away. Wait for a few dozen cycles after each parameter change to allow the damping to occur. The various views are analogous to those described in the Driven Pendulum demonstration. The potential energy in this case is equal to 0.25 + 0.25 x^4 - 0.5 x^2. Van der Pol Equation The driven Van der Pol equation, given by x'' - h(1-xý)x' + x = A sin wt is solved here for 15 different combinations of initial velocities x' and positions x. The results are plotted in phase space (velocity versus position). Such an equation was first used by Van der Pol to represent an electrical resonant (RLC) circuit in which there is both a nonlinear resistance and an active component to overcome the resistance. The equation has also been used to model heartbeats and pulsating stars called Cepheids. For h=0 and A=0, the equation is just that of an undamped harmonic oscillator that has simple periodic orbits all of the same frequency. For h>0, large oscillations are damped and small oscillations grow as a result of the nonlinear damping term. All orbits are attracted to a closed curve, which is called a limit cycle or attractor. For h<0 the attractor becomes a repellor. With A>0, the solution may be either a limit cycle or a two-torus (quasi-periodic) or a chaotic attractor. See if you can find combinations of A, h, and w that give chaotic solutions. Toggle tracking on and off and look for solutions that do not approach a limit cycle. Three-Body Problem In this restricted three-body problem, N noninteracting planets move in the inverse-square-law gravitational field of two stars. The positions of these stars are fixed, but you can vary the ratio of their masses (m1/m2). The stars are indicated by circles on the screen. Note that the motion is generally chaotic, as can be shown by using two or more planets with the same initial position but with different initial velocities. Each time the motion is restarted, the initial position changes. The velocities vary over a range of one percent and cannot be changed. This sensitive dependence on initial conditions is a general characteristic of chaotic motion. To simplify the calculation, the stars' masses are spread uniformly over their volumes, and the planets are allowed to penetrate the stars. Outside the circles representing the stars, the attractive force varies inversely with the square of the distance of the planet from the center of the star. Can you show Kepler's result that the orbit of a planet in an inverse-square-law force field is an ellipse? You will have to set the mass of one of the stars (m1) to zero and avoid penetrating the star. Magnetic Quadrupole A quadrupole magnetic field is produced by two infinite line- currents flowing out of the screen at the top and bottom and two infinite line-currents flowing into the screen at the right and left. The resulting magnetic field vanishes on the magnetic axis at the center of the screen. Such a field null is characterized by an X-point at which two magnetic field lines cross. These lines form a separatrix. A group of N, noninteracting, charged particles are started at the same point (xi) with velocities that vary over a range of 1 percent. The orbits of the particles are followed in time. Note that the particles begin following the same trajectory, but after a time the orbits separate and the chaotic motion becomes evident. Try at least 32 particles, with tracking turned off, and watch the filamentation of their orbits. Magnetic fields like this one are used to confine charged particles in particle accelerators and plasma confinement devices for fusion research. Note that though the particles tend to remain on a field line, particles occasionally escape when they come too close to the X- point and begin moving nearly parallel to the field. Lorenz Attractor The Lorenz attractor arises from a solution of three nonlinear differential equations: x' = ay - ax y' = -xz + hx - y z' = xy - bz These equations were originally proposed by the meteorologist Edward Lorenz in 1963 to model fluid convection and are regarded as the first documented example of what is now called a strange attractor. The displays show the projection of the orbit in each plane and the variation of each variable with time. If your screen shows colors, the colors represent different values of the third variable, giving some sense of the three-dimensional nature of the trajectory, which never crosses itself. In the three-dimensional view 4, the color is changed every time x(t) changes sign. Can you find parameters that give point attractors and limit cycles? Rossler Attractor The Rossler attractor arises from a solution of three nonlinear differential equations: x' = - y - z y' = x + ay z' = b + z(x-h) These equations were proposed by Otto Rossler in 1976 and are often regarded as the simplest example of a chaotic flow. The equations also have periodic solutions for various values of the parameters. The displays show the projection of the orbit in each plane and the variation of each variable with time. If your screen shows colors, they represent different values of the third variable, giving some sense of the three-dimensional nature of the trajectory, which never crosses itself. In the three-dimensional view 4, the color is changed every time x(t) changes sign. Can you find parameters that give point attractors and limit cycles? One-Dimensional Maps One-dimensional maps predict the next value in a series of numbers from a function that depends only on the last value: x(n+1) = F[x(n)] For example, the Logistic map has F = Ax(n)[1-x(n)]. Depending on the value of A, the solution may go to a fixed value, oscillate, or become chaotic. View 1 shows a graph of each of the maps available by pressing M. In view 2, successive iterates are plotted beginning with xi, which you may change. In view 3, there are two initial conditions that differ by 1 part in 10^8, and the difference between the two values of x is plotted on a log scale. In view 4, many values of x are plotted versus A after a number of iterations. In view 5, the Lyapunov exponent, given by averaging log|dF/dx| over a large number of iterations, is plotted versus A. A negative Lyapunov exponent means the solution is periodic, and a positive exponent means it is chaotic. In view 6, the probability distribution P(x) is plotted. The logistic equation can be used to model population growth in a biological system for a case in which the growth is governed by the population at some previous time rather than by the present population. Predator-Prey The predator-prey problem is a simple ecological model described by the following two nonlinear differential equations, x' = ax - xy y' = -y + xy where x represents the number of prey (for example, rabbits), and y represents the number of predators (foxes) at time t. The equations might also naively model an oscillating chemical reaction. The growth of each species depends on the populations at each instant. The problem is discretized using the Heun method with a step size h. Such a discretization corresponds to growth rates that depend on the populations at a previous time rather than at the present. However, small h corresponds to an exact solution of the above equations, and the result is a simple periodic orbit. The point (x=1, y=a) is an unstable fixed point. For a=1 and h<0.6 there is an invariant circle to which orbits are attracted. For a=1 and h=0.6, a strange attractor is evident. For a=1 and h=0.7, there is a periodic attractor of period 9. For a=1 and h>0.8, there are no bounded orbits, and all orbits are attracted to infinity. Chirikov Map The Chirikov map (or standard map) is generated by starting with various initial values p(0) and q(0) and iterating as follows with J = 1: p(n+1) = Jp(n) - K sin q(n) q(n+1) = q(n) + p(n+1) This is a discretized form of the equation of motion of a pendulum in the limit as K approaches zero. Then p represents the angular momentum, and q the angle of the pendulum. The equation can also represent the motion of a bouncing ball, on successive bounces, when the floor oscillates sinusoidally. For small K, the plot shows an interior region, in which the pendulum swings back and forth, and an exterior region in which the pendulum swings in a full circle. The intermediate region, in which the pendulum nearly stalls at the top, is typically chaotic. For large K, the motion becomes chaotic for all amplitudes, but note that even in the extreme chaotic limit (K=6.4), there are holes in phase space that are inaccessible to the motion. Thus even chaotic motion is subject to rules. You can add dissipation by taking J < 1, in which case the trajectories approach attractors. Henon Map The Henon map is generated by starting with random points in the y-z plane and iterating according to the following: y(n+1) = 1 - ay(n)ý + bz(n) z(n+1) = y(n) Note that after just a few iterations, the points collect in the vicinity of a particular curve. This is an example of a strange attractor, and all points within a given region in the y-z plane are drawn to the attractor. Such a region is called a basin of attraction. Points outside the basin of attraction escape to infinity. The basin of attraction is shown in the background color in view 2. The other colors indicate the number of iterations required for |y| to exceed an arbitrary value of 135. Close examination reveals that the attractor and its basin of attraction are fractals. No matter how much a fractal is enlarged, there is always detail at a smaller scale. The separation of the individual lines within the attractor are proportional to b divided by the square root of a, all raised to an integer power. Strange Attractors A system of equations that has chaotic solutions will often produce an orbit that is attracted to a small region of the space whose coordinates are the variables of the equations. Such a chaotic attractor is called "strange" because it is neither point nor line nor surface nor solid, but rather a fractal object, generally with non- integer dimension. In view 1 of this demonstration, finite difference equations of the form x --> a + bx + cxý + dxy + ey + fyý y --> g + hx + ixý + jxy + ky + lyý are solved with random choices of the coefficients a through l. Cases that are not chaotic are discarded, and cases that are chaotic are displayed in the x-y plane. View 2 includes a third equation with an additional variable z, but the attractor is projected onto the x-y plane. Views 3 through 5 display the third variable in various ways. It is remarkable that the same simple equations produce so many different patterns, almost none of which have ever been seen before. Mandelbrot Set The Mandelbrot set is created by starting with a complex number Z (taken as zero), squaring it, and adding another complex number C: Z(n+1) = Z(n)ý + C The process is repeated until |Z|ý exceeds a value of 4 that ensures that the point is outside the set. Contours of the number of iterations required to exceed this value are plotted in the complex C-plane. Points in the interior region never escape, but points in the exterior region escape rapidly. The boundary between the two regions has visible structure at all magnifications and is a fractal. The interior region is a basin of attraction, and all parts of this region are connected to all other parts. The Mandelbrot set has been described as the most complicated mathematical object ever "seen," and yet it arises from one of the simplest equations. After you have a picture, press <+> or <-> to cycle among the color palettes supported by the computer. Julia Sets The Julia sets are created in a manner similar to the Mandelbrot set, by starting with a complex number Z, squaring it, and adding another complex number C: Z(n+1) = Z(n)ý + C The process is repeated until |Z|ý exceeds a value of 4 that ensures that the point is outside the set. Contours of the number of iterations required to exceed this value are plotted in the complex plane of the initial values of Z. Contrast this case with the Mandelbrot set in which the points are plotted in the complex C-plane. The various views (values of C) are chosen to correspond to values near the fractal boundary of the Mandelbrot set. View 19 performs a random search and produces a different pattern each time the program is restarted. Each figure is a basin of attraction. It is remarkable that such a diversity of shapes results from such a simple equation. After you have a picture, press <+> or <-> to cycle among the color palettes supported by the computer. Diffusion Shown here are N particles that at each iteration are moved randomly by a unit step either up or down or right or left. The resulting trajectory is a random walk or Brownian motion and is a fractal. A collection of such particles undergoing random motion exhibit diffusion--they gradually spread out from where they started. Unlike the previous examples in which chaotic motion results from deterministic equations, the motion here is derived using a random- number generator. The particles shown do not interact with one another. Imagine, instead, that the particles are colliding with invisible background particles and that the mean-free-path between collisions is a constant. A characteristic of a random walk is that the mean-square displacement of the collection of particles increases linearly in time. At the top of the screen, the value of /t is calculated continuously. With a sufficiently large number of particles, this normalized diffusion rate should approach 1.0, but fluctuations equal to the reciprocal of the square root of the number of particles are expected, as can be seen in the simulation. Noise The term "noise" generally denotes a quantity that varies randomly in time, in analogy with the random spatial motion that gives rise to diffusion. A noisy voltage connected to a loudspeaker produces audible noise. The simplest kind of noise is white noise, in which the value of the quantity at a given time is unrelated to its value at previous times. Like white light, white noise is made up of equal amounts of all frequencies, and thus its power spectrum is a constant independent of frequency. Brownian motion produces a spectrum that decreases with frequency according to 1/f^2 and appears much smoother than white noise. It is the result of integrating white noise over time. Another type of noise, intermediate between these two, is 1/f noise, sometimes called pink noise. Although poorly understood theoretically, 1/f noise is probably the most common type of noise. The distribution of notes in music closely follows a 1/f law. The integral of 1/f noise is 1/f^3 (sometimes called black noise) and is very smooth. Turn on the sound in the demonstration and see which type of noise seems most musical to you. Deterministic Fractals These deterministic fractals are formed by a variety of techniques. Views 1 through 7 are formed by recursively calling a function that replicates a pattern on successively smaller or larger scales. View 8 is a continuous but nowhere differentiable function. Views 9 through 18 are produced by the use of iterated function systems in which an initial point is moved a prescribed distance in one of several randomly chosen directions. The fractal tree (view 19) is formed by starting many times at the trunk and making a turn through a given angle in one of two randomly chosen directions after a given distance. Although random numbers are used, the resulting patterns are deterministic. Many of these fractals are self-similar--that is, they look the same at any magnification. The fern is self-affine, which means it looks the same under magnification if properly distorted. The complexity of such patterns can be characterized by the fractal dimension. The dimension of a fractal is defined here as twice the log of the number of occupied sites divided by the log of the number of available sites. A line thus has a dimension 1.0 and a surface has a dimension 2.0. The processes illustrated represent the way snowflakes form. You can produce an enormous variety of such patterns by varying the rules by which they are formed. Random Fractals In view 1, a point is initially illuminated at the center of the screen. A particle begins a random walk from a random point on a circle surrounding this point. If it contacts the point, it sticks, and is itself illuminated; and a new particle is started from a random point on the circle. If it intersects the circle, it is reflected so as to remain always inside the circle. The circle expands continuously as the pattern grows. In view 2, a line is initially illuminated at the bottom of the screen. Particles with random initial positions rain down from above and stick when they touch the line or another particle that has stuck to the line. The process is called diffusion-limited aggregation. It leads to a fractal whose dimension is continuously calculated and indicated at the top of the screen. Such a simulation would model the growth of a structure embedded in a fluid whose particles undergo random motion. It might also model the evolution of a lightning discharge. Perhaps you've seen patterns like this in the ice crystals that form on your windows in the winter. Iterated Function Systems In an iterated function system, a point is chosen arbitrarily in the x-y plane, and then a succession of new points is calculated from it and plotted by randomly choosing from among a group of N linear affine maps of the form x --> ax + by + e y --> cx + dy + f Each case is generated using a different random selection of the 6N coefficients of the system, producing a different pattern. Such a mapping scales, rotates, shears, and reflects the image, producing a variety of patterns with a high degree of self-similarity. The amount of contraction is controlled by the parameter F. In view 1 only contractions and rotations are allowed, and all N are equal, producing a regular polygon. View 2 shows irregular polygons. View 3 shows cases with constant contraction but with arbitrary rotations. View 4 allows all the coefficients to be arbitrary, but with a maximum contraction of F. View 5 adds a third coordinate z and hence 6N additional coefficients. It produces a 3-D fractal pattern that may be viewed with special red/cyan glasses. Coupled-Map Lattice Nature often exhibits spatial as well as temporal chaos. An example of spatio-temporal chaos is a turbulent fluid. One way to model such processes is to distribute a collection of iterated maps such as the logistic map on a regular lattice with each map coupled to a few of its nearest neighbors with random initial conditions. The demonstration here has a one-dimensional lattice of logistic maps, F = AX(1-X), each coupled to N identical maps on either side of itself according to N X(I) --> (1 - k) F(I) + k ä [F(I-J) + F(I+J)] / 2N J=1 The adjustable constant k determines the strength of the coupling. You may want to refer to the One-Dimensional Maps demonstration to review the properties of the logistic map for various values of A. You will observe that such coupled-map lattices have behavior very different from single isolated maps. For example, individually chaotic maps can lock together and produce patterns that are periodic in both space and time. See if you can observe other types of behavior. Try rotating the palette with the <+> and <-> keys to highlight features of the pattern. Mixing A set of initial conditions, which you can consider as a collection of individual particles, like drops of cream in a cup of coffee, is subjected to motion governed by two clockwise-rotating vortices with centers at Y=0 and X=ña as indicated by the small circles. The vortices are alternately turned on with the other turned off. With each iteration, every point is rotated through an angle h ln(r) where r is the distance of the point from the center of the vortex that is turned on. The strength of the rotation is controlled by the parameter h, which is measured in radians. Negative values of h cause the vortex on the left to rotate counter-clockwise. Such a motion might represent approximately the stirring of a cup of coffee with a spoon that makes a small circular motion and moves back and forth between two places in the coffee. Note that the curve never crosses itself, but that it becomes increasingly intertwined as it is repeatedly stretched and folded. You will observe the sensitivity to initial conditions that is characteristic of chaos. However, there are regimes in which the motion is periodic. See if you can find the chaotic and periodic regimes for various choices of h. Percolation A fluid seeps through a porous medium by the process of percolation. Perhaps the most familiar example is a coffee percolator. Percolation theory also describes many other similar phenomena such as the spread of forest fires and diseases, and the electrical and thermal conductivity of amorphous materials. This demonstration simulates the flow of a liquid through a rectangular lattice in which gaps are randomly distributed. The liquid starts at a cell at the top center and flows downward into all connecting cells, like a rat exploring a maze trying to find a way out at the bottom. You can change the fraction of gaps across (A) and down (D) from 0 to 1 and collect statistics on the probability that the fluid percolates through the lattice. You should observe that the probability is very small until the fraction approaches about 0.5, whereupon the probability rapidly rises to near 100%. This value is called the percolation threshold. The threshold depends weakly on the anisotropy (the ratio of A to D). Cellular Automata A cellular automaton is a pattern that evolves in such a way that each point in the pattern is governed only by a few of its nearest neighbors. A simple example is a row of positive integers all of which are initially zero except for N which are one. At the next time step, a new row is produced with each number dependent on its two nearest neighbors at the previous step. One possible rule is F(x,t+1) = [F(x-1,t) + F(x+1,t)] MOD k which gives rise to a complicated but periodic pattern called Pascal's triangle as shown in view 1. On a color monitor the k values of F are indicated by different colors. Another possible rule is F(x,t+1) = {F(x-1,t) + MAX[F(x,t),F(x+1,t)]} MOD k which gives rise to a chaotic pattern as shown in view 2. The pattern never repeats and exhibits extreme sensitivity to initial conditions. The necessary nonlinearity is provided by the MAX function which returns the larger of its two arguments. Each row constitutes a fractal with a dimension between zero and one. View 3 is identical to view 1, and view 4 is identical to view 2 except that the N initial points are located randomly along the first row. Game of Life The game of life is a classic demonstration of a two-dimensional cellular automaton in which the evolution of points on a grid is governed solely by their nearest neighbors. Local rules govern the global behavior. In the case shown here, the initial distribution of points is chosen randomly. In the classic game of life, a point survives to the next generation if two or three of its eight nearest neighboring points are populated. If fewer than two points are populated, it dies of isolation, and if more than three points are populated, it dies of overcrowding. This rule is indicated by D = 23. An unoccupied point with exactly three neighbors is a birth site, indicated by B = 33. There are over 2,000 combinations of D and B for you to explore. Simple rules allow order to emerge out of disorder, as with evolution. This phenomenon is called "self-organization." The resulting structures go by such descriptive names as gliders, blinkers, and traffic lights. Although the cellular automaton has obvious application to biology, it also models crystal growth, turbulence, ferromagnets, and galaxy formation (with appropriately changed rules). Cellular automata are ideal for computer simulation. Anaglyphs Anaglyphs are drawings that use contrasting colors to produce a three-dimensional effect when viewed through glasses with a corresponding colored filter over each eye. Most people require a brief period of adjustment to experience the effect, especially when the objects are unfamiliar. These anaglyphs of common objects supplement those found elsewhere among the demonstrations and are included to aid your acclimation and to amuse you. The two-torus in view 5 illustrates a quasiperiodic orbit (a superposition of two incommensurate frequencies) that is often incorrectly identified as chaos since it never repeats. Of course your computer must have a color monitor, and your glasses must be well matched to the color of the phosphors in your monitor. If you see a double image with either eye closed, the colors are not well matched. You might try altering any adjustments provided on your monitor or using different glasses. Sometimes the ghost image can be eliminated by looking through two pairs of glasses. The figures should appear to the correct scale when viewed from arm's length with a 12- to 15-inch monitor. If you still have trouble seeing the effect, try viewing from closer to the screen or use the magnify (M) command to make the object smaller.