Symmetric Chaos
Project description
Symmetric Chaos
The script symchaos.py generates chaotic images with translational (wallpaper) or rotational symmetry, as pioneered by Field and Golubitsky [1].
Installation:
First, install the package with pip:
pip3 install symchaos
Next, find the location where the installed files are:
pip3 show -f symchaos
Copy the whole symchaos
directory to a place where you have read and
write access. Now you can change into this directory and start the
script symchaos.py
.
Dependencies:
Symchaos needs the python modules argparse
, ast
, configparser
,
datetime
, math
, matplotlib.pyplot
, numpy
, os
, pylab
,
random
, re
, shutil
, and sys
.
The pure python version is fine for testing but very slow. To speed up
the calculations, it is strongly recommended to use the Fortran90 code
symchaos.f90
and use the fortran to python interface generator f2py
from numpy (https://numpy.org/doc/stable/f2py).
Usage:
Execute symchaos.py
and provide a config file from the ini/
directory, for example:
symchaos.py ini/example.ini
For a quick test without installing a Fortran90 compiler, type:
symchaos.py ini/nof90.ini
If f2py
is available, the Fortran90 code can be compiled with:
f2py -c symchaos.f90 -m symchaos_f90
Now, all config files from the ini/
directory can be used, e.g.,
clifford.ini
, fern.ini
, mondrian.ini
, quilt.ini
, rot9.ini
etc.
The images are saved inside the output
directory.
Configuration:
Generation of the images is controlled via a config (*.ini
) file. The
keys are:
method
: The method determines which formula is used bysymchaos.f90
. Available methods are:clifford
: Clifford attractorfern
: Barnsley fernhopalong
: Hopalong attractor by Barry Martinmondrian
: images reminding me of Piet Mondrianquilt*
: several quilts (wallpapers)rot_sym
: images with rotational C_n symmetrytriangle
: images looking a bit like triangles
a
,b
,c
,d
,e
,n
: These parameters are part of the formulas of the methods.vary_steps
: Ifvary_steps
> 1, then several images are created, using different parametersa
,b
,c
,d
,e
.vary_type
: Ifvary_steps
> 1, thenvary_type
determines how the parameters are varied:cyclic
: starting and ending at the initial parametersneighborhood
: random values in the neighborhood of the initial parametersrandom
: random valuesrandom_walk
: a random walk, starting at the initial parameters
vary_value
: The magnitude of the parameter variationpalette
: The matplotlib color palette [3] used to create an image. The default is the rainbow palette, settingpalette = *
uses all palettes.resolution
: A tuple defining the x,y resolution of the image, e.g.,resolution = (100,100)
.MAKETILES
: If set toTrue
, a tiled image is also created. This is only useful for wallpapers with translational symmetry.USE_FORTRAN
: If set toTrue
, use the fast Fortran90 codesymchaos.f90
.
Further explanations can be found in the comments of the example.ini
config file.
References:
[1] Symmetric Chaos, Mike Field, and Martin Golubitsky, Computers in Physics 4, 470 (1990), https://doi.org/10.1063/1.4822939
[2] Christmas in the House of Chaos, Scientific American, Dec 1992, JSTOR 24939340
[3] List of matplotlib palettes: https://matplotlib.org/stable/gallery/color/colormap_reference.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file symchaos-0.9.0.tar.gz
.
File metadata
- Download URL: symchaos-0.9.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 435ed5bb9b59f40731e5546322ebd3f3969a705a7e40178017b9ff99878d21a4 |
|
MD5 | 7679ed6f78b1943d44a09f8767efe684 |
|
BLAKE2b-256 | 3f83c256e55d2ea87d9756be95fecad4afd6c8622686bef16d9a4dddc848d9d3 |
File details
Details for the file symchaos-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: symchaos-0.9.0-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ba277c03e080f02edd9534d0509ee1ccb39e21e8864e9b4af4c4a6dac770f7 |
|
MD5 | 422cf60fbb096f6b755ec8301e38bc9f |
|
BLAKE2b-256 | 0156aa7650e27b1e9eeea4cc39cfe510935b61615471413a86e3627ad5a69d2c |