January 27, 2014

Not so random colors

When I coded colorful chaos (field of unit vectors, I think, is proper name of what it is), I stumbled on a question how to generate random colors. With Ising model there’s the only way: I have to just flip between 0 and 1, black and white. With colors I could think of two ways: I can change color to any other random color on a wheel, or I could change color to nearby color.

In principle results should be the same: if new color is widely distributed, then cells update just won’t happen very often at low temperatures, and would happen much more frequently at high temperature. Even if new color is contained to vicinity of the old color of the cell, at high temperatures it won’t depend on its neighbors and would drift to randomness very soon.

I sought to check it, and implemented two schemes. In the first version, cell can change its color randomly to any other color. This is the video of annealing (starting from completely random pattern and high temperature and slowly lowering the temperature):


In the second way new color is normally distributed around old color and half-width of distribution 0.05 radians (2.8 degrees). This is very narrow distribution, and see what happened:


See how in the first video there is a violent mixing of colors at the beginning, and then it all pass through some critical point, and stabilize. In the second video I was unable to see any critical temperature. The system is cooled extremely smoothly.

I started experimenting with new way of generating colors, and found out that at high temperatures it behaves quite unexpectedly. The noise at high temperatures looked completely different. When I started from the field of red and raised temperature to high values, this is what I get:


Would I run the same simulation with the first way of generating colors, it would be complete mess almost instantly. But here – it preserved structure no matter how long I waited.

No comments:

Post a Comment