Home > Mathrec

Mathrec

Mathrec is a project mainly written in ..., based on the GPL-3.0 license.

Mathematical Recreations container build and packaging

This is a collection of X11 clients written by Ron Record ([email protected]). To compile, simply run the following commands from this directory :

% xmkmf (or "imake -DUseInstalled -I/usr/lib/X11/config")
% make Makefiles
% make depend
% make
% make install (as root)

To install by hand :

  1. copy the executable binaries (endo/endo, lyap/lyap, stars/stars, ...) to /usr/bin/X11 or /usr/local/bin/X11 or any directory in your execution path.
  2. copy the stars resource file stars/Stars.ad to /usr/lib/X11/app-defaults/Stars or the X11 system app-defaults directory.
  3. copy the man pages endo/endo.man, lyap/lyap.man and stars/stars.man to the appropriate unformatted man page directory (e.g. /usr/man/man.8).
  4. You may also want to install the sample shell scripts used to front-end endo and lyap. If so, copy endo/params// and lyap/params/* to a system directory.

Known Limitations

These programs were originally written for 8-bit PseudoColor X11 displays. I have modified them so that they work on a TrueColor visual but many of the features are not present without a PseudoColor display. For instance, the installation of a private colormap and the spinning of the color map are features available only on a PseudoColor display visual.

Description

What follows is a brief description of several of the programs, separated by ==============.

Endo - iterate an endomorphism of the plane

Written by Ronald Joe Record ([email protected]) 17 Jan 1992

INTRO

The basic idea is to iterate an endomorphism of the plane (R x R). Each point (x,y) is mapped to (f(x,y),g(x,y)). The new point is then mapped to (f(f(x,y),g(x,y)),g(f(x,y),g(x,y))) and so on. Each point is then colored according to how many iterates it took to get within some "delta" of a previous iterate (e.g. a periodic orbit is detected). Lyapunov exponents can be calculated and displayed for a region of parameter space. Phase portraits can be constructed and histographic data displayed. Finally, critical curves and their iterates may be displayed (curves for which the determinant of the Jacobian is zero).

ACKNOWLEDGEMENTS

The Winter 1992 seminar at UCSC led by Dr. Ralph Abraham was the inspiration for the study of iterated endomorphisms of the plane. The 3-D transformation routines were ported to X from CGI routines developed by Hiram Clawson.

Techniques for calculating the critical arcs and absorbing regions were drawn from Laura Gardini of the Istituto di Scienze economiche, Universita' di Urbino. Studies of various maps of the plane were used including papers by Jon von Neumann, Graciela Chichilnisky, John Guckenheimer, G. Oster, A. Ipaktchi, Wulf Gaertner, Jochen Jungeilges, Ralph Abraham, B. P. Wood, A. J. Lichtenberg, Z. You, E.J. Kostelich, J. A. Yorke, R. Brown, L. Chua, K. Judd, A. I. Mees, K. Aihara, and M. Toyoda.

Some "interesting" runs of endo are included as simple shell scripts in the "params" subdirectory.

CUSTOMIZING

To add a map to the array of selectable endomorphisms, follow the following steps :

1. Edit endo.h and add the pair, double, PFP, PFD, and Mapnames
   declarations. Follow the example set by the "standard" map.
2. Edit maps.c and add the map and derivative function definitions.
   Again, you can follow the example set by standard() and dstandard().
3. Edit params.h adding the numerical values to use in the 
   amins, aranges, bmins, branges, pmins, pmaxs, and defparms arrays.
   In each case, when adding the nth map, you will be adding the nth
   value in the array (which may itself be an array).
4. Edit defines.h, incrementing NUMMAPS and increasing NUMDEFS by 2.
5. Edit info.c, adding a string representation of the function to
   Mapdefs[] and an entry in the numparams array indicating how many
   parameters the map has.
6. make clean; make tags; make

==============

Lyap - Calculate and display Lyapunov exponents of an iterated map

Written by Ronald Joe Record ([email protected]) 03 Sep 1991

INTRO

The idea here is to calculate the Lyapunov exponent for a periodically forced logistic map (later i added several other nonlinear maps of the unit interval). In order to turn the 1-dimensional parameter space of the logistic map into a 2-dimensional parameter space, select two parameter values (a and b) then alternate the iterations of the logistic map using first a then b as the parameter. This program accepts an argument to specify a forcing function, so instead of just alternating a and b, you can use a as the parameter for say 6 iterations, then b for 6 iterations and so on. An interesting forcing function to look at is abbabaab (the Morse-Thue sequence, an aperiodic self-similar, self-generating sequence). Anyway, you step through all the values of a and b in the ranges you want, calculating the Lyapunov exponent for each pair of values. The exponent is calculated by iterating out a ways (specified by the variable "settle") then on subsequent iterations calculating an average of the logarithm of the absolute value of the derivative at that point. Points in parameter space with a negative Lyapunov exponent are colored one way (using the value of the exponent to index into a color map) while points with a non-negative exponent are colored differently.

ACKNOWLEDGEMENTS

The algorithm was taken from the September 1991 Scientific American article by A. K. Dewdney who gives credit to Mario Markus of the Max Planck Institute for its creation. Additional information and ideas were gleaned from the discussion on alt.fractals involving Stephen Hall, Ed Kubaitis, Dave Platt and Baback Moghaddam. Assistance with colormaps and spinning color wheels and X was gleaned from Hiram Clawson. Rubber band code was adapted from Stacey Campbell's xmandel source.

Some "interesting" runs of lyap are included as simple shell scripts in the "params" subdirectory.

==============

Stars - simulate a star field

Stars is a simulation of a star field as you are moving through space.

Written long ago and far away by [email protected]

==============

libXrr - collection of routines used in endo and lyap including useful routines to calculate splines, install and spin color maps, line clipping ...

==============

Ideas, comments, additions, deletions, suggestions, bug reports, code review,... e-mail Ronald Joe Record at [email protected]

Previous:Test