10
May
07

Belousov-Zhabotinsky (BZ) Reaction

This periodic cellular automaton simulates a Belousov-Zhabotinsky reaction. See also my Activator-Inhibitor cellular automaton.

(* runtime: 27 seconds *)
n = 50; SeedRandom[0]; image = Table[Random[Integer, {0, 255}], {n}, {n}];
Do[image = Table[z = image[[i, j]]; zlist = Flatten[image[[Mod[i - {0, 1, 2},n] + 1, Mod[j - {0, 1, 2}, n] + 1]]]; If[z == 255, 0, a = 9 - Count[zlist, 0]; If[z ==0, b = Count[zlist, 255]; Floor[(a - b)/3] + Floor[b/3], Min[Floor[Plus @@ zlist/a] + 45, 255]]], {i, 1, n}, {j, 1, n}]; ListDensityPlot[image, Mesh -> False, Frame -> False], {200}];

Links


0 Responses to “Belousov-Zhabotinsky (BZ) Reaction”



  1. No Comments Yet

Leave a Reply




Welcome !

You will find here some of my favorite hobbies and interests, especially science and art.

I hope you enjoy it!

Subscribe to the RSS feed to stay informed when I publish something new here.

I would love to hear from you! Please feel free to send me an email : bugman123-at-gmail-dot-com

Archives

Blog Stats

  • 110,082 hits