The Computational Beauty of Nature
Source code

mg

plot the phase space of the Mackey-Glass system

mg -help
  or
mg     [-width  integer] [-height integer] [-skip integer]
       [-points integer] [-delta integer]  [-tau  integer]
       [-A  double]  [-B double] [-dt double] [-x0 double]
       [-factor  double]  [-data]  [-inv]  [-mag  integer]
       [-term string]

Plots a two-dimensional embedding of the phase space of the Mackey-Glass system, a delay-differential system, with arbitrary parameters.

The phase space of the Mackey-Glass system, which is described by the delay differential equation

dx(t)/dt = A x(t-Tau) / (1 + x(t-Tau)^10) - B x(t),

is plotted according to the specified parameters. The xcoordinate of the plot is determined by x(t) while the ycoordinate is determined by x(t-delta).

Miscellany

The plot region is determined by the points that are initially skipped. If this number is too small (i.e., it is not very representative of the range of the plotted values), then you may need to increase the number specified by the -skip option. Alternatively, you can adjust the value given to -factor, which simply fractionally increases the border of the plot.

The program uses a second-order Euler's method to perform the numerical integration, which is sufficient for simple tasks such as this.

Bugs

No sanity checks are performed to make sure that any of the options make sense.

Options

-widthWidth of the plot in pixels.480
-heightHeight of the plot in pixels.480
-skipNumber of initial points to skip.2000
-pointsNumber of points to plot.10000
-deltaTime steps to delay for.6
-tauValue of the Tau parameter.17
-AValue of the A parameter.0.2
-BValue of the B parameter.0.1
-dtTime step size.0.1
-x0Initial X value.1.23456789
-factorAuto-scale expansion factor.0.2
-dataDon't plot, but print points.False
-invInvert all colors?False
-magMagnification factor.1
-termHow to plot points.None

mg.c on GitHub