Introduction to Complex Systems


Practical Problem 7: Pinwheels

Pinwheels

This model is very simple, but very beautiful. The idea is to have a system of say 64x64 patches, and each patch has an angular phase variable much like the heading variable that comes with the turtles. So we define something like this

patches-own [phase]

and set this phase variable to a random number between 0 and 360

ask patches [set phase random-float 360]

Simulation

Now we want to run a model that sets a patches phase to the average phase of its neighbors at every tick.

Colors

When you deal with phase variables its good to use rainbow colors for visualization. The easiest way to do this in netlogo is using the hsb function, you can look at the netlogo manual for instructions. Here you good do this:

ask patches [set pcolor hsb phase 100 100]

which will assign a hue according to the phase at full saturation and brightness. You can use this in your paint function.