Thursday, November 27, 2008

Amorphous computing experiments in matlab



I've been playing with what I hope will be an interesting formulation of amorphous computing simulations involving randomly generated logic networks. I first prototyped these in C in my zlab framework but have decided to move them to matlab both to make it easier for others to work on it but also because as I move them from 1D to 2D I'll need a fancier integrator than RK45. Matlab offers a lot more ODE solvers than does my current C framework where I would inevitably have to port in Fortran solvers.

The above figures show the first test results from the matlab code. A three-node ring oscillator (that's 3 "not" gates connected in a cycle) are arrayed across space (x-axis). In both figures, the osciallator at randomly initialized (the same ICs in both images) and thus begin to oscillate though time (y axis). In the first image, there is no communication between each spatial machines so each vectical stripe oscillates in its own arbitrary phase. In the second figure, the exact same machine and ICs are now allowed to exchange information through space by diffusion and you can see that there is a rapid phase alignment between the vertical stripes. Think of it like this: each machine is now trying to recruit its neighbors into its phase. At start, by chance, there will be some neighbors who happen to have similar phase and thus they will be able to dominate their neighbors and bring them over to their phase resulting in a larger dominating force and thus making it easier to dominate even more neighbors, etc, until the whole space phase synchronizes.

This effect has been known for centuries -- it was described by Huygens in 1665 when he noticed pendulum clocks hung on the same wall phase-synchronizing because they could communicate by vibrating the wall. Here's an article about a nanomachine that does the same thing.

Lots more of these results to come now that I have the basic matlab framework built. Early indications are that some interesting things are possible.

No comments: