Jekyll2021-10-06T17:46:14+00:00https://damonbinder.github.io/feed.xmlDamon Binderand the establishment of an online presence.The Ising Model and its Cousins2018-01-25T12:08:50+00:002018-01-25T12:08:50+00:00https://damonbinder.github.io/articles/SM<h2 id="the-simulations">The Simulations</h2> <p>Statistical mechanics studies how microscopic laws give rise to macroscopic behaviours. Why do we see liquids, solids and gases? Why do magnets exist? How can we manufacture new materials with novel properties?</p> <p>To answer these questions, we can make computer simulations. Here we will talk about 2D lattice simulations — these are simulations done on a grid. Below, I will explain the interesting behaviour present in these simulations. If you want to play around with them yourself, here is a list of them:</p> <h3 id="n-vector-models">N-Vector Models</h3> <ul> <li><a href="/scripts/SM/ising.html"><em>Ising Model</em></a></li> <li><a href="/scripts/SM/U1.html"><em>XY Model</em></a></li> <li><a href="/scripts/SM/SO(3).html"><em>Heisenberg Model</em></a></li> </ul> <h3 id="lattice-gases">Lattice Gases</h3> <ul> <li><a href="/scripts/SM/LatGas.html"><em>Lattice Gas with Gravity</em></a></li> <li><a href="/scripts/SM/OilWater.html"><em>Oil and Water</em></a></li> </ul> <h3 id="advanced-models">Advanced Models</h3> <ul> <li><a href="/scripts/SM/tricritical.html"><em>Tricritical Ising Model</em></a></li> <li><a href="/scripts/SM/qPotts.html"><em>Potts Model</em></a></li> </ul> <h2 id="what-is-the-ising-model">What is the <a href="/scripts/SM/ising.html"><em>Ising Model</em></a>?</h2> <p>The Ising Model, named after <a href="https://en.wikipedia.org/wiki/Ernst_Ising">Ernst Ising</a>, is a simple model that can be used to describe all sort of complicated behaviour. The basic idea is that we have a grid, and at each point on that grid we have an arrow that points either up, or down. We will represent the up arrows by white squares, and the down arrows by black squares. This is a basic model of a magnet: each square in the grid can be thought of as a little bar magnet, with the north side facing either up or down.</p> <p>The behaviour of the system is governed by three basic principles:</p> <ul> <li> <p>Arrows want to align with their neighbours</p> </li> <li> <p>Heat causes the arrows to flip randomly — the higher the temperature, the more likely a flip and the more randomly the system acts</p> </li> <li> <p>An external magnetic field makes the arrows favour a direction. The bigger and more positive the magnetic field, the more the arrows want to point up.</p> </li> </ul> <p>I have made a simulation of the two-dimensional Ising Model. You can play around with it <a href="/scripts/SM/ising.html">here</a> By changing the temperature and the magnetic field, you can see all sorts of interesting behaviour:</p> <ul> <li> <p><strong>Phase Transition:</strong> At high temperatures, the grid looks very chaotic, an even mix of white and black squares. Yet as we lower the temperature, we get clusters, regions where every square is black or white. If you leave the simulation long enough, the whole grid will become either black or white. This is a <a href="https://en.wikipedia.org/wiki/Phase_transition"><em>phase transition</em></a>, from a state of disorder to a state of order, and is analogous to the liquid–gas phase transition.</p> </li> <li> <p><strong>Spontaneous Symmetry Breaking:</strong> The Ising Model has a symmetry: if we flip every arrow, changing every black square to a white square and every white square to a black square, then the system is identical. At low temperatures though, we see that the grid divides into regions of all black or all white. These regions are not symmetric when we flip arrows, and so this is known as <a href="https://en.wikipedia.org/wiki/Spontaneous_symmetry_breaking"><em>spontaneous symmetry breaking</em></a>. This phenomenon is important throughout modern physics, and is responsible for both <a href="https://en.wikipedia.org/wiki/Superconductivity">superconductivity</a> and the <a href="https://en.wikipedia.org/wiki/Higgs_mechanism">Higgs mechanism</a>.</p> </li> <li> <p><strong>False Vacuums:</strong> Set the temperature to be very low and then increase the magnetic field. The whole grid will become white. Next lower the magnetic field so that it is negative. Now if all the arrows were flipped, the energy of the system would be lower. But each individual arrow cannot flip, because it wants to align with all of its neighbours. The grid is now in a <a href="https://en.wikipedia.org/wiki/False_vacuum"><em>false vacuum</em></a>. Eventually, enough arrows will flip and the whole grid will flip to black. But this process can take a long time — for a small enough magnetic field, it may take many times the age of the universe!</p> </li> </ul> <p>I first learnt about the Ising Model from <a href="https://www.amazon.com/Introduction-Thermal-Physics-Daniel-Schroeder/dp/0201380277"><em>An Introduction to Thermal Physics</em></a> by D. Schroeder; this book gives a very clear introduction to the topic. More advanced material can be found in these <a href="http://www.damtp.cam.ac.uk/user/tong/statphys.html">lecture notes</a> by David Tong.</p> <h2 id="more-complicated-models-the-xy-model-and-the-heisenberg-model">More Complicated Models: The <a href="/scripts/SM/U1.html"><em>XY Model</em></a> and The <a href="/scripts/SM/SO(3).html"><em>Heisenberg Model</em></a></h2> <p>A simple to way to extend the Ising model is to allow the arrows not just to point up or down, but to point in different directions. We could for instance allow the arrows to take a direction on the circle, like the hands of a clock. We use colour to represent the direction — 12 o’clock is red, 4 o’clock is green and 8 o’clock is blue. You can play around with this model <a href="/scripts/SM/U1.html"><em>here</em></a>.</p> <p>One interesting feature of the XY model is that it has <a href="http://www.damtp.cam.ac.uk/research/gr/public/cs_top.html"><em>topologically defects</em></a>, such as vortices and domain walls. These defects are important both in cosmology, but also in more down-to-earth applications such as liquid crystals and protein folding.</p> <p>We can extend our model even further, allowing our arrows to point on a sphere, rather than a circle. We will colour the north pole white and the south pole black. Walking around the equator, we shall colour red to green to blue and back to red again. This is known as a <a href="https://galactic.ink/sphere"><em>color sphere</em></a>. The model can be found <a href="/scripts/SM/SO(3).html"><em>here</em></a>.</p> <p>These two models are examples of <a href="https://en.wikipedia.org/wiki/N-vector_model"><em>n-vector models</em></a>. They closely related to the more general <a href="http://www.scholarpedia.org/article/Nonlinear_Sigma_model"><em>non-linear sigma models</em></a>, which are important in many fields of physics and mathematics.</p> <h2 id="lattice-gases-1"><a href="/scripts/SM/LatGas.html">Lattice Gases</a></h2> <p>So far we have thought of our simulations as describing magnets. But, if we make a few modifications, we can instead think of our simulations as describing liquids and gases.</p> <p>The idea is simple. We can think of each white square as representing a molecule, and each black square as empty space. The molecules repel at short distances, so there can only ever be one molecule in each square. But, at medium distances the molecules attract each others, and so the white squares want to be neighbours. In a gas, the number of molecules remains constant, so the number of white squares remains constant in our simulation.</p> <p>At high temperatures the white squares (ie the molecules), spread themselves randomly throughout the space. But, as we lower the temperature, the molecules clump together into droplets — the gas condenses into a liquid!</p> <p>One way to make the simulation more interesting is to add gravity — a force attracting the molecules to the bottom of the page. You can play with the lattice gas <a href="/scripts/SM/LatGas.html"><em>here</em></a></p> <h2 id="oil-and-water"><a href="/scripts/SM/OilWater.html">Oil and Water</a></h2> <p>Oil and water do not mix. We can simulate this using two different types of molecules. The white squares are water molecules, and they attract each other. On the other hand, the yellow squares are oil molecules, and they do not feel any attraction towards the water nor other oil molecules. You can mess around with the system <a href="/scripts/SM/OilWater.html"><em>here</em></a>. We can now see that the oil and water molecules tend to separate, just like in real life!</p> <h2 id="advanced-models-1">Advanced Models</h2> <p>A lot of statistical mechanics models exist, many with interesting properties. The <a href="/scripts/SM/tricritical.html"><em>Tricritical Ising Model</em></a> is a modification of the Ising Model, where lattice sites are allowed to be empty. This means that the number of atoms can vary in the model. There are three different phases, which can coexist at the critical temperature — hence the name.</p> <p>The <a href="/scripts/SM/qPotts.html"><em>Potts Models</em></a> are a family of models which generalize the Ising model. In these models, there are <em>q</em> possible values at each point in the lattice; when <em>q</em> is two this gives the Ising model.</p>The Ising Model is a simple system which can be used to study all sorts of physics.Molecular Dynamics2017-05-21T12:08:50+00:002017-05-21T12:08:50+00:00https://damonbinder.github.io/articles/Molecules<p>Ice, water, and water vapour are three very different substance. Ice is a crystal, it is hard and will shatter if you hit it hard enough. Water is a liquid, it flows and forms droplets. Water vapour is a gas, which is dispersed throughout the atmosphere. Yet for all this varied behaviour, we know that these three substance are actually made of the same thing — water molecules. These are tiny particles which are constantly whizzing around and interacting with each other. Out of the interaction of trillions and trillions of these molecules emerges the behaviour of water we see in everyday life.</p> <p>How can we understand this behaviour? A simple thing we could try is simulating the motion of a bunch of molecules, watching to see what happens. This approach is known as <em>molecular dynamics</em>. It is hard to compute the behaviour of more than a few hundred molecules at a time — the problem becomes to computationally intensive. Nevertheless, this gives us a picture of how molecules interact with each other microscopically. I have made three simulations, which you can play around with here:</p> <ul> <li><a href="/scripts/NBody/BilliardBalls.html"><em>The Hard-Core Gas</em></a></li> <li><a href="/scripts/NBody/LennardJones.html"><em>The Lennard-Jones Potential</em></a></li> <li><a href="/scripts/NBody/Ions.html"><em>Salts</em></a></li> </ul> <h2 id="the-hard-core-gas">The <a href="/scripts/NBody/BilliardBalls.html"><em>Hard-Core Gas</em></a></h2> <p>When two molecules are near each other, they exert forces on each other. The simplest model we could use is to imagine that the molecules act like billiard balls in the real world — they bounce off each other. You can play around with this model <a href="/scripts/NBody/BilliardBalls.html">here</a>. This model is known as the hard-core gas</p> <p>To play around with the gas, I’ve added two sliders:</p> <ul> <li> <p><strong>Drift</strong>: This adds some random movement to each molecule, increasing the energy and effectively heating the system.</p> </li> <li> <p><strong>Drag</strong>: This causes the molecules to slow down and loose energy. It has the opposite effect of drift, cooling the system.</p> </li> </ul> <h2 id="the-lennard-jones-potential">The <a href="/scripts/NBody/LennardJones.html"><em>Lennard-Jones Potential</em></a></h2> <p>The previous model has behaviour that looks very much like a gas: molecules bounce off each other chaotically, repelling if they get too close. In the real world, molecules don’t always repel. Various forces, such as the Van der Waals force, can lead to attraction. A simple model to describe this it the <a href="https://en.wikipedia.org/wiki/Lennard-Jones_potential">Lennard-Jones Potential</a>:</p> $V(r) = A\left(\frac{r^{12}}{r_0^{12}}-\frac{r^{6}}{r_0^{6}}\right).$ <p>This potential causes the molecules to attract to each other at medium distances, but the molecules repel if they get to close.</p> <p>You can play around with the model <a href="/scripts/NBody/LennardJones.html">here</a>, and compare its behaviour to the simpler hard-core gas. With the drift and drag sliders, we can heat and cool the gas to explore its behaviour in different regimes.</p> <p>When the gas of particles is hot, the particles bounce around chaotically, just like in a real gas. If we add some drag however, the particles slow down and begin to interact with each other. They begin to cling together in clusters, like droplets of a liquid. Further cooling the particles and we find that they stop moving altogether. The particles arrange themselves into a crystal — a hexagonal lattice.</p> <h2 id="simulating-salts">Simulating <a href="/scripts/NBody/Ions.html"><em>Salts</em></a></h2> <p>Salt, NaCl, is made of positively charged sodium ions interacting with negatively charged chlorine ions. According to Coulomb’s law, like ions repel and opposite ions attract. Just like the molecules in the previous section, ions will repel each other if they get too close. I have made a simulation of this, which you can play around with <a href="/scripts/NBody/Ions.html">here</a>.</p> <p>Just like the Lennard-Jones potential, we will get gas, liquid, and solid-like behaviour depending on the energy of the particles. Because there are two types of ions, we can get more intricate clusters of ions forming — long chains and circles, square lattices, trees. Eventually the ions will settle down into a square lattice, akin to the cubic lattice we observe in real salt!</p>How do molecules interact with each other in gases, liquids and solids?Simulating Gravity2017-03-21T12:08:50+00:002017-03-21T12:08:50+00:00https://damonbinder.github.io/articles/NBody<p>I have simulated gravity in both three and two dimensions. You can play with these simulations here:</p> <ul> <li><a href="/scripts/NBody/Gravity.html">Newtonian Gravity</a></li> <li><a href="/scripts/NBody/LogGrav.html">2D Gravity</a></li> </ul> <p>Explanations of these simulations can be found below.</p> <h2 id="the-n-body-problem"><a href="/scripts/NBody/Gravity.html">The <em>N</em>-Body Problem</a></h2> <p>Newton’s law of universal gravitation states that objects attract each other via the inverse-square law:</p> $F = \frac{Gm_1m_2}{R^2}$ <p>Here $$F$$ is the force experience by one of the objects, $$m_1$$ and $$m_2$$ are the masses of the objects, $$R$$ is the distance between the objects, and $$G$$ is a constant. We can use this rule to predict the motion of stars and planets. For the case of two planets, this motion can be found explicitly, from which we can derive <a href="https://en.wikipedia.org/wiki/Kepler's_laws_of_planetary_motion">Kepler’s Laws</a> describing orbital motion. When we have three or more planets, the motion becomes chaotic and we cannot solve the problem exactly. This problem is known as the <em>N</em>-body problem, and has troubled mathematicians for centuries.</p> <p>When trying to simulate more than two bodies, we have to use approximate, numerical methods to solve the problem. These are used to study all sorts of physical systems — the motion of planets around a star, the motion of stars in a galaxy, or the motion of galaxies through the universe. I have made my own <a href="http://djbinder.com/scripts/NBody/Gravity.html"><em>N</em>-Body simulation</a>.</p> <h2 id="2d-gravity"><a href="/scripts/NBody/LogGrav.html">2D Gravity</a></h2> <p>If the universe had two, rather than three, spatial directions, then gravity would act very differently. Newton’s law of universal gravitation would be modified to:</p> $F = \frac{Gm_1m_2}{R^1}$ <p>This may not look so different from our previous equation, but the inverse, rather than the inverse-square, makes all the difference. In a 2D universe, it takes an infinite amount of energy too escape from the gravitational field of a planet. You can observe this fact by playing around with my simulation <a href="/scripts/NBody/LogGrav.html">here</a>. Because the planets cannot escape, you can watch the simulation run forever!</p>Solving the *N*-Body problem.Conway’s Life and Related Cellular Automata2017-01-21T12:08:50+00:002017-01-21T12:08:50+00:00https://damonbinder.github.io/articles/Life<p>I have made a simple program to simulate Life-Like cellular auomata. <a href="/scripts/CA/Life.html"><strong>Click here to play around with it.</strong></a></p> <p>These are a family of cellular automata with the following properties:</p> <ul> <li>They live on a two dimensional square grid,</li> <li>Each cell is either alive (white) or dead (black)</li> <li>Each step, whether a cell is born or dies depends on how many alive cells are in the eight cells adjacent to it, as well as the current cell state.</li> </ul> <p>The most famous such automata is Conway’s Life, which has the following rules:</p> <ul> <li>If a dead cell has three neighbours, it becomes alive</li> <li>If an alive cell has two or three neighbours, it survives; otherwise it dies.</li> </ul> <p>We can label life as B3/S23, meaning that a cell is born if it has three neighbours, and a live cell survives if it has two or there neighbours.</p> <p>There are 262144 possible Life-like rules. Each can be labelled by a list of of numbers for which a cell is born, and dies. Of these, only a few rules have been explored in any details. Here are some interesting ones to play around with:</p> <table> <thead> <tr> <th>Rule</th> <th>Name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>B3/S23</td> <td><a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Life</a></td> <td>The original ruleset, with highly complex behaviour.</td> </tr> <tr> <td>B3/S012345678</td> <td><a href="https://en.wikipedia.org/wiki/Life_without_Death">Life without Death</a></td> <td>Exactly what it says on the tin.</td> </tr> <tr> <td>B36/S23</td> <td><a href="https://en.wikipedia.org/wiki/Highlife_(cellular_automaton)">Highlife</a></td> <td>Close relative of Life, with a tendancy to constantly expand.</td> </tr> <tr> <td>B35678/S5678</td> <td>Diamoeba</td> <td>Creates cell-like structures.</td> </tr> <tr> <td>B3678/S34678</td> <td><a href="https://en.wikipedia.org/wiki/Day_and_Night_(cellular_automaton)">Day and Night</a></td> <td>Treats living and dead cells symmetrically.</td> </tr> <tr> <td>B4678/S35678</td> <td>Anneal</td> <td>Close relative of the Ising Model at zero temperature.</td> </tr> <tr> <td>B1357/S1357</td> <td>Replicator</td> <td>Everything eventually replicates.</td> </tr> <tr> <td>B3/S01234</td> <td>Mazes</td> <td>Makes maze-like patterns.</td> </tr> </tbody> </table> <p>A systematic study of life-like cellular automata can be found <a href="https://arxiv.org/pdf/0911.2890.pdf">here</a>; many further rule sets can be found in this paper.</p>I have made a simple program to simulate Life-Like cellular auomata. Click here to play around with it.Partial Differential Equation Solving2016-10-10T12:08:50+00:002016-10-10T12:08:50+00:00https://damonbinder.github.io/articles/PDE<p>The heat and wave equations are two partial differential equations that show up all over nature.</p> <p><a href="/scripts/PDE/Diffusion.html">Here is a heat equation simulation.</a></p> <p><a href="/scripts/PDE/Waves.html">Here is a standing wave simulation.</a></p> <p><a href="/scripts/PDE/WavePool.html">Here is a wave pool.</a></p>The heat and wave equations are two partial differential equations that show up all over nature.Nature Simulations2016-08-16T12:08:50+00:002016-08-16T12:08:50+00:00https://damonbinder.github.io/articles/Other<p>Here are some miscellaneous simulations I have made, inspired by nature.</p> <p><a href="/scripts/Other/Megafauna.html">Here is a megafauna extinction simulation.</a></p> <p><a href="/scripts/SM/Forest_Fire.html">Here is a forest fire simulator.</a></p>Here are some miscellaneous simulations I have made, inspired by nature.