Enter the Cellular Automaton! Create a galaxy by having each cell represent a cloud of gas from which stars form. Then arrange the cells in concentric rings to create a disk for the galaxy. Each ring of gas will rotate at some angular velocity with differential rotation between them. Finally apply rules that make the clouds of gas in each cell active (or not). One basic rule for clouds of gas is that a SuperNova can EXPLODE in a region of the galaxy. This triggers adjacent regions of gas to collapse and form stars. And this new star formation might also trigger other neighbors to form stars as well. It isn't 100%. These clouds of gas also age and eventually become inactive until perhaps once again triggered to form more stars. In fact the details of the rate of formation, the likelihood of affecting neighbors, the numbers of clouds (cells), their ages and the rotation rate of the rings together all play a part in the final macro pattern that evolves.
Recently I completed a program that does exactly what I describe above. It is meaningful to me on many levels (see below), but first here is one run of the program showing how by applying these simple rules you can end up with something like a spiral galaxy. I suggest actually seeing it on YouTube at full screen in HD.
Isn't that cool? Just by working on a micro-scale with a bare minimum of states and rules- patterns emerge that echo what is seen in nature. This kind of model certainly does not completely characterize the way galactic structures form- but there is a convincing argument that some of what is observed may come from these processes.
Below is another version using very different parameters which more clearly shows the pixel interactions.
This program is meaningful to me because I wrote this in college- specifically in the fall of 1995. I know this well because this is when I met Miwa... who remarkably would agree to marry me (later). It was in a computational physics course (romantic right?) lead by Dr. Phil Pinto of the University of Arizona. Many students in the class did not have experience programing, but I had a solid foundation in C. So I asked Dr. Pinto if there was something interesting to model and he suggested the perfect thing! He gave me a paper written in 1976 by Mark Mueller and David Arnett titled: "Propagating star formation and irregular structure in spiral galaxies." In it they describe the model I simulated above... only they used printouts on paper! They could not use nearly as many rings (cells) or iterations compared to what I can easily do on my computer today. However back in 1995, with my inefficient C code, I honestly was not doing much better than the paper printouts. Tens if not hundreds of thousands of cells are necessary to make this simulation even start to look reasonable.
Fast forward 20+ years. I eventually joined a small team of astronomers at the UofA and I committed myself to learning this new-fangled programming language called Python. It opened the door for me to once again look at this program on my personal computer. And just yesterday... it happened, I once again saw something similar to what I had seen years ago on my screen. I improved the code in many ways that go far beyond my original version such that I think this result is closer to what the original paper envisioned and it has much greater flexibility in the levers and parameters I can adjust (play with!).