Saturday, December 29, 2007

Nano flower

A while ago I blogged about NanoArt 2007 , which is an online competition to create nanoart. Well, it turns out that I had completely forgotten about this competition, so I have done nothing more than form a few vague ideas about what I planned to create as a submission. The closing date for submissions is 31 December 2007, which leaves very little free time to create a worthwhile submission, so I wondered how I could create something using the bits and pieces that I happen to have lying around already.

One of the 3 electron microscope pictures that are supplied for you to start from is this

which they fittingly call "Nano Flower", and you are allowed to submit up to 5 "artistic" images for the competition.

I think I will choose to submit a 5-frame animation generated using a variant of the Belousov-Zhabotinsky reaction simulation software that I described here, where I use the "Nano Flower" image as an external input to steer the the reaction dynamics. This means that I am simulating a modified version of the BZ reaction, where the surface on which the reaction occurs is weakly contaminated so that the BZ reaction dynamics vary across the surface.

Here is a 5-frame animation that I quickly created, which fortuitously turns out to be cyclic because the period of the BZ dynamics is 5 frames.

Well, that's one frame of the animation. I gave up trying to get the animation to upload successfully to, so I have put it on my web site here.

I have called this work "Fizzix" for fairly obvious reasons. Now I will wait to see whether I have broken the submission rules for the NanoArt 2007 competition, which don't mention animation as being an acceptable artform, not even 5-frame animations.

Update (7 January 2008):

All of the NanoArt 2007 competition entries can be viewed here, and the album containing my single competition entry is here (with the animation hosted here). My competition entry is a lot less colourful than other peoples' entries, so it is unlikely to attract much attention. I have to hope that people click down to my animation to discover the true nature of my competition entry.

Thursday, December 20, 2007

Molecular manufacturing

The Center for Responsible Nanotechnology has a nice overview of its current findings on molecular manufacturing here, which summarises the pros and cons of being able to manipulate matter in a controlled way at the molecular scale.

Molecular manufacturing is fundamentally different from the "heat and stir" approach to building things with molecules, because it aims to directly control the placement and interaction of individual molecules. This opens up lots of new possibilities for building things (beneficial or dangerous), and the world will not be the same when the transformation to molecular manufacturing has occurred.

This revolution in manufacturing will make the Industrial Revolution seem trivial in comparison, and it will happen within a small number of decades (CRN says 2 decades). This means that it is likely to have a big impact on the lives of most people alive today, which gives you an incentive to read all about it here.

Saturday, December 15, 2007

Merry Yuletide

Here is a movie in which I have created an animation of a festive texture on the surface of a trefoil knot. Merry Yuletide!

How did I create this movie?

I have been playing around with the Belousov-Zhabotinsky reaction simulation that I described here.

One thing that you can do is to find limit cycles of the simulation, where the state of the array of cells returns to a state that it visited earlier in the simulation. The whole sequence of states between two such repeats (including one of the end points) is then a limit cycle of the BZ simulation. Such limit cycles must exist because the state space is finite in size, so it it inevitable that the simulation must eventually revisit states that it visited earlier, though starting from a random initial state the likelihood that this occurs in a given timescale decreases rapidly as the size of the array increases.

One example that I particularly like is a cycle of length 10 that I found on a toroidal 13 by 13 array (using the same parameter values and colour scheme as here), and I show 2 of these cycles in the movie below:

This cycle is unusual because it has a low symmetry, and because it is pretty to look at despite its short length.

Using this cyclic BZ solution on a torus it is relatively easy to create the movie at the start of this posting, by using it to texture the toroidal surface of a trefoil knot, and choosing a colour scheme that maximises its festive feel.

Tuesday, December 11, 2007

Nerd test

I happened upon Nerdiometer, which describes an on-line test for assessing how nerdy you are. You can find the test here.

I couldn't resist trying this one. I suspect that the results of the test are biassed by a selection effect where the nerdier you are the more likely you are to take the test in the first place.

Anyway, here is my result:

I am nerdier than 82% of all people. Are you a nerd? Click here to find out!

17% of people score higher than me, and 82% score lower. I was disappointed to score so highly, because as I filled in the multiple-choice questionnaire I could see that the extremely nerdy answers were off the scale compared to where I stood. Maybe that was a trick to let me make the choices that I did without being too embarrassed about them.

The questionnaire was extremely selective in the areas it covered, because it focussed on asking about nerdy things to the almost complete exclusion of asking you about anything else. So, if you spend only small fraction of your time being a nerd, you will register highly on the nerd-scale as defined by this test.

I wish there was a way to find out how each answer was weighted to produce the overall result. Oh no! Wishing for that must in itself be a nerdy thing to do! Aargh! This is renormalisation gone mad!

Update (12 December 2007):

The result I got when I tried version 2 of the test (see here) is says I'm a Cool Nerd.  What are you?  Click here!

OK, so now I am a "cool nerd" which sounds pretty good to me, but I am annoyed that my Science/Math and Technology/Computer scores are deemed to be so low! Who are the people who designed this test anyway? I'm not playing any more, maybe...

Thursday, December 06, 2007

Belousov-Zhabotinsky reaction

Whilst exploring Wikipedia I came across the Belousov-Zhabotinsky reaction, and the phenomenology of its reaction dynamics such as the development of propagating waves of reactants is described here. Although I previously knew about the BZ reaction I had never implemented a simulation of it. It turns out to be remarkably easy to implement in Mathematica, and the BZ reaction dynamics can readily be displayed as a very pretty movie.

Although the original purpose of this type of simulation was to model the BZ reaction dynamics, you could imagine using variants of this type of simulation for generating interesting dynamic art forms.

A slightly modified form of an algorithm to simulate the BZ reaction due to Professor A K Dewdney is listed here.
(i) Select an integer q in the range 2 through 255. Cells may be in any of the states 1 through q.
(ii) Select two integers k1 and k2 in the range 1 through 8 and an integer g in the range 0 through 100.
(iii) In the transition from one "step" to the next the state of each cell is changed once according to rules (iv) - (vii).
(iv) A cell in state q changes to state 1.
(v) A cell in state 1 changes to state a/k1 + b/k2 + 1 where a is the number of neighbors of the cell which are in states 2 through q-1 and b is the number of neighbors in state q.
(vi) A cell in any of states 2 through q-1 changes to S/(9 - c) + g, where S is the sum of the states of the cell and its neighbors and c is the number of neighbors in state 1.
(vii) If the application of rule (v) or rule (vi) would result in a cell having a state > q then the state of that cell becomes q.
After some experimentation to find the fastest (and clearest) implementation in Mathematica, I created a function for implementing a BZ update step with toroidal boundary conditions:

update[state_, q_, k1_, k2_, g_] :=
{ones, qs, kernel, total, totalones, totalqs},
ones = Map[If[#==1, 1, 0]&, state, {2}];
qs = Map[If[#==q, 1, 0]&, state, {2}];
kernel = Table[1, {3}, {3}];
total = ListCorrelate[kernel, state, {{2,2},{2,2}}];
totalones = ListCorrelate[kernel, ones, {{2,2},{2,2}}] - ones;
totalqs = ListCorrelate[kernel, qs, {{2,2},{2,2}}] - qs;
MapThread[If[#>q, q, #]&[Switch[#1, 1, Floor[#4/k1+#3/k2+1], q, 1, _, Floor[#5/(9-#2)+g]]]&, {state, totalones, totalqs, 8-totalones-totalqs, total}, 2]

I used this BZ update function to generate the above movie of the BZ reaction dynamics, using suitable parameter values that I copied from here.

statesequence =
{n=64, q=200, k1=2, k2=3, g=70},
NestList[update[#, q, k1, k2, g]&, RandomInteger[{1,q}, {n,Floor[4/3n]}], 250]
movie = Map[ArrayPlot[#, ColorFunction->"Rainbow"]&, statesequence];

The poor image quality in the movie is due to the high degree of image compression, rather than due to any limitations of the above algorithm. Also, each frame is separately scaled and mapped onto the colour lookup table, which is probably not the best way of creating the movie.