Chaos Theory: Difference Equation Iterator Program

This program demonstrates an interesting aspect of Chaos Theory. It shows how by iterating a simple non-linear equation, you can reproduce the apparent chaotic behaviour of complex-dynamical systems like the global weather, animal and plant populations, social interactions, boom and bust in economies and the ups and downs of trading markets.

Panel of the 'c' version of the Difference Equation Iterator.

This version of the program is written in pure 'C': it does not use any external widget libraries. To run this program, please proceed as follows:

  1. Download the executable file difeqn into a convenient directory [folder].
  2. Open a terminal window.
  3. Change directory to where you placed the downloaded file.
    user@computer: $ cd path/to/new/directory
  4. Give the program permission to run as a program on your system:
    user@computer: $ sudo chmod +x difeqn
    You have to be the root user to do this.
  5. Enter the 'run' command:
    user@computer: $ ./difeqn

The program window shown above should appear ready to RUN. If it doesn't, you probably have a 32-bit com­puter: difeqn, as downloaded is for a 64-bit computer. All you need to do is compile the source file difeqn.c on your own computer [see below].

Mainstream warnings notwithstanding, this program will neither blow up your computer nor wreak any other kind of fanciful mischief. It simply draws on your screen. However, if you really do not trust a program from a "non bone fide" source like me, you can download and scrutinize the source code, then compile it and run it on your own computer as follows:

  1. Download the source file difeqn.c into a convenient directory [folder].
  2. Open a terminal window.
  3. Change directory to where you placed the downloaded file:
    user@computer: $ cd path/to/new/directory
  4. Compile the source code to produce your own executable file:
    user@computer: $ gcc difeqn.c -L/usr/X11R6/lib -o difeqn -lX11
    If gcc cannot find the header file 'X11/Xlib.h' then you need to install it by entering the command:
    user@computer: $ sudo apt-get install libx11-dev
    Your Unix/Linux distribution my use an installer other than apt-get.
  5. Enter the 'run' command:
    user@computer: $ ./difeqn

The program window shown above should appear ready to RUN. The resulting compiled code is for Unix-based operating systems [such as BSD or Linux] using the X11 windowing library.


Home Page, Parent Page — © December 2019 Robert John Morton