[To run this program, please see the end of this page.]
One of my chaos-related programs is this Java applet which I wrote to exercise two difference equations x = cx(1 − x) and x = x² + c. It demonstrates how merely changing the value of the constant c changes the entire behaviour of the equation. The applet illustrates a mathematical process which is thought to be the key to the next phase of man's quest to understand nature. This same process is also understood to be the driving force of national economies — and indeed the global economy as a whole. Consequently it is of critical significance to those who seek to set economic and social policies for the future.
You should find this applet easy to operate and adequate for its purpose. However, if you are keen to explore further the behaviour of these and other equations, you can modify and recompile the source code provided, but having done so you are politely requested to acknowledge my work in writing this original version of the applet. If with Microsoft Windows a Security box pops up saying that the application has been blocked because it's untrusted please click here. If you get warning messages with Linux, please click here.
This comprises calculating the value of y from a non-linear equation y = f(x), plotting it, then feeding y back into the equation in place of x and repeating the process endlessly. It is what is known as a positive feed-back process. Practical examples are: the life process, and the supply and demand processes in a free market.
The applet makes visible this iteration process through the bounce graph shown in the bottom right quarter of its display area. The applet draws the curve of y = f(x) and the diagonal straight line y = x. The iteration process starts from the point on the diagonal corresponding to the initial value of x. It then draws a line from this point vertically to hit the curve y = f(x). This yields the corresponding value of y. From this point it then projects a line horizontally until it hits the diagonal. This in effect feeds this value of y back into the equation as x for the next iteration. Neat! It draws the current iteration's bounce lines in dark green and then re-draws the previous iteration's bounce lines in bright green. If you slow the iteration rate down to plot every 2 seconds you will clearly see this process working. The applet plots a Time graph of x versus time concurrently with its plotting of the bounce graph.
As iterations mount up on the bounce graph, the bright green lines build up into an attractor in the two-dimensional phase space formed by plotting xn versus xn-1. For values of c producing linear and periodic behaviour, the attractor is simply a point or square. If the variables x and t were continuous instead of discrete, the squares would be circles or ellipses as produced by my Lissajous Figures applet. When the behaviour becomes chaotic the attractor becomes 'strange' — a succession of changing rectangles. Although within the precision of the pixel raster of the screen, some rectangles seem to repeat and overlay each other, in the closer reality of the IEEE double floating point arithmetic used in the program, they in fact never quite overlay exactly. Again, if the variables x and t were continuous instead of discrete, the trace would resemble something akin to the owl mask or butterfly trace which has become know as Lorenz's strange attractor.
Surprisingly, whatever type of function f may be does not seem to affect the fundamental behaviour of the iteration process. It doesn't have to be either of the two functions embodied by the equations chosen for the applet. Other functions exhibit the same kind of behaviour so long as they are non-linear (ie they produce curves not lines). All that changing the function seems to do is reposition, rescale and ever so slightly reshape the path traced out by successive values of x with respect to the origin of the co-ordinate system on which they are plotted.
Whatever particular function is used for the difference equation, it exhibits one of three types of behaviour according to the current value of the constant c, namely:
For c < 2·1 iterating this equation produces the familiar sigmoid curve used to represent the growth of plants and trees, populations, market demand and a myriad other things. For 2·1 < c < 2·9 the curve climbs to a maximum then follows a dying oscillation which eventually settles to a constant value. For 2·9 < c < 3·4 the curve climbs as usual but settles down to a regular oscillation. For 3·4 < c < 3·6 the oscillation becomes increasingly complex, at one point adopting a kind of waltz rhythm. From 3·7 < c < 4 regular oscillations give way to chaotic behaviour. For c > 4 this becomes so extreme that the 'population' soon makes a chaotic dive to zero from which it cannot recover — like a population becoming extinct.
This is mathematically equivalent to the other equation above, so its behaviour will be the same, and it can equally well represent the natural processes represented by the other one.
This equation may be thought of as a real-axis only version of the complex difference equation z = z² + c which generates the Mandelbrot Set.
Both equations are parabolic functions. When plotted, they produce parabolas. The differences between the equations is not to do with the nature of what they describe. It is merely to do with the position from which what they describe is observed. Changing the position and angle from which you observe a thing does not change the thing itself.
The essence of a parabola is described completely by the equation y = x². All other terms in the mathematician's general form of the equation of a parabola are simply to do with where the observer chooses to observe it from. That is, where he chooses to place his centre of the frame of reference, and the scalings he will use to measure what he observes. The observer, by definition, always resides at the origin (point 0, 0) of his co-ordinate system.
The general form of the equation for a parabola is ax² + bx + c where:
'a' is the magnification factor which determines the parabola's size or scale relative to the observer's unit of measure,
changing 'b' moves the co-ordinate origin (and hence the observer) around the actual curve of the parabola,
'c' is the vertical shift factor which determines how far up or down the parabola is shifted relative to the observer.
The effects of these 3 variables are superimposed on each other. For instance, when c is not zero, changing b moves the point y = c (not the co-ordinate origin y = 0) around the curve of the parabola. The essential point of all this is that a parabola is a parabola, namely y = x². All the other paraphernalia in the generalised form of the equation is simply to do with where the observer is. And where the observer is cannot affect the intrinsic nature and behaviour of what is observed. So in studying the behaviour of the equation it does not matter what particular equation you use so long as it is a parabola.
All the forms of the equation can all be mapped onto each other simply by changing the observer's position. To change from seeing a parabola as y = cx(1 − x) to seeing it as y = x² + c, you do the following:
Move half a unit to your right. The equation is now y = c(½ + x)(½ − x) which simplifies to y = c(¼ − x²)
Go round the back and turn yourself upside down. The equation is now y = c(x² − ¼)
Put on a pair of astigmatic spectacles which reduce the y-scale by a factor of c. The equation is now y = x² − ¼c. Then let the constant c in the new equation be what ¼c was in the old one. Thus the equation becomes y = x² + c.
The equation — the way you are seeing what it represents — has changed. Nevertheless, what you are looking at is itself unchanged. The reason for changing your position of observation is that the second equation is simpler and therefore easier to build into a computer program and faster to compute. In iterative programs, time is of the essence.
Scientists often bend, fold, scale and twist graphical representations of phenomena in order to make them more viewable. Hénon's strange attractor is a prime example. The difficulty is that they may no longer be able to correlate easily the new form of their equations to the real-world phenomenon they are trying to simulate and from which they concocted their original equations. It is all a matter of compromise — and a most interesting aspect of relativity.
The applet's first equation x = cx(1 − x) is known as the Standard Logistics Difference Equation. It models, among other things, the way in which populations of reproductive life-forms wax and wane. In this context, the constant c represents the fecundity of the life-form concerned — that is, the ferocity with which it reproduces. This is moderated by a factor representing the degree of ease or difficulty with which the species is able to acquire its needs of life from its environment. The population is thus held in balance by a mechanism analogous to an amplifier with negative feed-back, or an engine with a torque-sensitive speed regulator, or a market economy regulated by interest rates.
Human and animal populations follow a smooth sigmoid curve like that produced by the applet for c < 2·1 in the equation x = cx(1 − x). Try c = 1·85 for a good example of a population sigmoid. Currently, human world population is thought to be at about 0·4 on the Time Graph's vertical scale. This corresponds [at the time of writing] to about 6,000 million. But this doesn't mean that the Earth cannot support more than 6750 million (0·45 on the graph, the point at which it levels off). It simply means that it cannot do so under the present level of technology and under the currently dominant socio-economic régime.
In complex dynamical systems especially, there is a delay between cause and effect. For human population this delay is very short compared with the reproduction cycle. That is why the curve it follows is a smooth sigmoid. But with insects, due to their high fecundity, the delay is significant. Effects of changes thus trail well behind their causes. This makes some insect populations wax and wane chaotically, corresponding to the behaviour of the equation for c = 3·6 or thereabouts. This has a future significance for humanity in a way which is more immediate and less obvious than one may suppose.
The applet's first equation x = cx(1 − x) is known as the Standard Logistics Difference Equation. It models, among other things, the way in which the population of a product grows within its potential market. In this context, the constant c is an amalgam of two factors. The first represents productivity — the number of product units which can be realised by one unit of human effort. This is amplified by production technology. The second represents the number of product units which can be sold into the market by one unit of human effort. This is amplified by communications technology. However, it is diminished by competition. The population of a product within a market is thus held in balance by a mechanism similar to that which holds life-form populations in balance with their environments.
Nature yields bounteously the needs of life in return for human labour. In the absence of war, oppression and exploitation all could therefore live in comfort and well-being. The value of c provided by nature (let us suppose it's around 1·3 or 1·4) is more than adequate for the needs of mankind. It creates an economy with a smooth productivity curve. But the human life-form then started to develop technology. First tools then the wheel, then machines, then automation, computers, communications and mass-media.
The smooth sigmoid reached to ever-greater heights. Once c passed 2·34 the curve started to 'ring' as it reached the top. That is, production over-shot and then fell back to its stable rate. The ringing became more pronounced until at c = 2·9 it gave birth to an almost steady (albeit shallow) rhythm of boom/bust which Western economies have gradually seen emerge from the end of World War II. Nevertheless, as the applet's Time Graph shows, the ratio between boom and bust gradually fades away (proving every time of course that government economic policy is working!?). But technology keeps on advancing, driving productivity and marketing reach ever higher and further.
The result is that the ratio between boom and bust gets larger but now ceases to fade away. As c increases further, so does the boom-bust ratio until eventually its rhythm becomes more complex. We will probably leave the 20th century with many national economies booming and busting to this mesmerising 'waltz rhythm'. But of the future? What does the new millennium hold in store for national economies? In a word: chaos. Technical progress will not stop. On the contrary, its rate of progress will accelerate. The boom-bust cycle will probably soon be following the profile of c = 3·68 which is what was being traced out by the applet when you first saw it.
Chaotic economic cycles are unlikely to hurt national economies or those who control them. However, they will ruin and destroy the economic lives of ordinary people. That is, unless the rules of engagement between the individual and the body-corporate are substantially re-engineered.
The applet's control panel is the collection of buttons etc. in the bottom left quarter of the applet's display area.
The Difference Equation Iteration Demonstrator applet is made up of the following classes:
Long before it was enhanced and re-written in Java, this difference equation iteration demonstrator began life as three separate programs written in MS QuickBASIC 2.0 (which shows how long ago that was!). To the software archaeologists among you these three original programs: stdLog.bas, stdLog1.bas and stdLog2.bas should prove to be most interesting artefacts. They do however provide a somewhat different presentation from the applet.
You need Java installed on your computer. Then:
Note: mainstream warnings notwithstanding, this program will neither blow up your computer nor wreak any other kind of fanciful mischief. It simply draws graphs on your screen. In the good old days this program simply ran embedded within the web page where its static image is now displayed. The embedded applet still runs in pre-2017 versions of browsers with Java 1.6 installed and the Web Start version still runs in pre-2019 versions of browsers with Java 1.8 installed. To read the rancid history of this sad retrogression in Web functionality, please click here.
You may also experiment with a version of this program written in 'C'. Note that the controls on the 'C' version are a little different but their operation is, nonetheless, essentially self-evident. [Back to top.]