A New Kind of Science: The NKS Forum > Pure NKS > Mathematica graphics functions for cellular automata
Author
Richard Phillips
Wolfram Science Group
Boston, USA

Registered: Oct 2003
Posts: 46

Mathematica graphics functions for cellular automata

Mathematica already has excellent builtin functions for plotting Cellular Automata and other NKS graphics.

When trying to plot CAs where the number of cells per inch approaches the screen resolution, the results may not look as good as usual. That is just a limitation of having to use pixels to display things.

The attached notebook contains two graphics functions that produce pictures of CAs with a whole number of screen pixels per CA cell, so that they always look really clear.

The first function produces pictures of a single matrix with a caption.

The second produces a grid of pictures, each with it's own caption. This is for showing multiple rules in an array.

The notebook also shows how the pictures can be exported to GIFs or JPEGs using Mathematica's Export function.

Attachment: graphicsfunctions.nb

Report this post to a moderator | IP: Logged

08-24-2004 07:16 PM

Registered: Jan 2004
Posts: 350

NiceCaptionedRaster Samples

Lawrence J. Thaden has attached this image:

__________________

Report this post to a moderator | IP: Logged

08-31-2004 11:17 AM

Registered: Jan 2004
Posts: 350

Continued

Lawrence J. Thaden has attached this image:

__________________

Report this post to a moderator | IP: Logged

08-31-2004 11:18 AM

Registered: Jan 2004
Posts: 350

Continued

Lawrence J. Thaden has attached this image:

__________________

Report this post to a moderator | IP: Logged

08-31-2004 11:24 AM
Richard Phillips
Wolfram Science Group
Boston, USA

Registered: Oct 2003
Posts: 46

Lawrence,

That looks like a very interesting rule.

Could you say what they are in more detail please?

Report this post to a moderator | IP: Logged

08-31-2004 01:35 PM

Registered: Jan 2004
Posts: 350

The rule addresses blocks of five cells. Each cell is restricted to five colors corresponding to integers 0 – 4. The left or right nearest neighbor block is randomly selected, and its cells are indexed by the cells of the block being updated. The result is then stored as the updated block.

For example:

Nearest neighboring block on left: {0, 1, 3, 3, 2}.

Nearest neighboring block on right: {1, 2, 4, 3, 0}.

Block before update: {4, 2, 0, 1, 3}.

Indexing when left neighbor is randomly selected: {0, 1, 3, 3, 2}[[{4, 2, 0, 1, 3}+1]].

Block after update: {2, 3, 0, 1, 3}.

Very soon after the initial conditions the blocks become all 0’s or 1’s or 2’s or 3’s or 4’s. And often pairs of adjacent blocks repeat over a region. For example a pair may be: {{0, 0 ,0, 0, 0}, {4, 4, 4, 4, 4}}, as in the example labeled “Simple Initials”. In this case the region appears checkered.

When the pairs of adjacent blocks do not differ, the colors of the regions appear solid.

In the special case, “Engineered Initials” I took the coefficients for permutation group S5 and randomized their order and then replaced the one just left of center with coefficients {4, 4, 4, 4, 4}.

Since indexing the coefficients of the permutation group S5 always gives another member of the permutation group, the {4, 4, 4, 4, 4}, which is not a member of S5, was required to get the rule to start turning the blocks into all 0’s or 1s or 2’s or 3’s or 4’s. It acted like a seed for the process. But it works out from where it is placed. So only slowly do all the bocks become homogenous. The two diagonal bands are due to this slowness. In this space only a single member of a pair of blocks seems to become homogenous.

I do not understand what is happening exactly. And especially intriguing is how the bands appear to have left chirality, even though selection of left or right neighbor is random.

Your NiceCaptionedRaster code clearly makes a difference, especially within the bands.

Thanks.

__________________

Report this post to a moderator | IP: Logged

08-31-2004 03:31 PM

Registered: Jan 2004
Posts: 350

Here is the notebook.

Attachment: nicecaptionraster samples.nb

__________________

Report this post to a moderator | IP: Logged

08-31-2004 06:25 PM

Registered: Jan 2004
Posts: 350

Left vs Right Chirality

In the above sample labeled “Engineered Initials” the graph manifested a left chirality.

By varying the rule and the number of neighbors it is possible to achieve a right chirality.

Here is an example using the same initial conditions, but making the rule be: Let the block to be updated index either the next nearest right neighbor or the nearest left neighbor. Again the choice made is random. (The initial conditions are the same in the sense that they are a random ordering of the members of permutation group S5 with a non-member seed replacing the S5 member just left of center.)

There are some solid colors and checkered patterns. Throughout composition of a step is of triplets of blocks of five cells. As soon as it gets organized each block is homogenous. A checkered triplet either has two blocks the same next to one that is different or a different one in between two that are the same. Solid triplets have three adjacent blocks the same.

The CA ends with a loop of three steps composed of repeating triplets of homogenous blocks like this:

loop step 1: 2s, 0s, 1s;
loop step 2: 1s, 2s, 0s;
loop step 3: 0s, 1s, 2s.

Lawrence J. Thaden has attached this image:

__________________

Report this post to a moderator | IP: Logged

09-04-2004 03:00 AM

Registered: Jan 2004
Posts: 350

Notes on left vs right chirality

A close examination of the graph labeled Engineered Initials shows that left chirality only applies to the bands during self-organization. Once the blocks have attained homogeneity the behavior is predominately characterized by neither left nor right chirality.

By contrast, the graph labeled Example with Right Chirality shows the right chiral characteristic once the blocks of cells have been homogenously organized. However, from the start it moves out from the center both to the left and to the right as it becomes more and more organized. Additionally, it appears to be moving faster in a left chiral direction. This can be verified by checking how it wraps around on the right and begins a second band that then intercepts the oppositely moving organization.

(Chirality: read left and right hand rule of thumb as in spin designation. Thumb points down the graph.)

__________________