Archive for 26 junio 2013

Ising model simulations


I’ve been playing around with Monte Carlo simulations of the Ising model. The idea is that you have a grid of dipoles (think bar magnets) which interact with their neighbours. They can point up or down, and they feel a force from their neighbours which tends to make them parallel. However, there’s also random thermal motion which flips them randomly.

Depending on the ratio of interaction energy to thermal energy, different behaviors emerge from the lattice. The most interesting one is that below the critical temperature, the lattice spontaneously magnetizes, meaning there’s an imbalance between up and down. This models what happens in ferromagnets, which can retain magnetization if they are below the Curie temperature.

Here is the simulation code and a pretty video.

Android RenderScript: Solution to ‘Cannot find symbol’ forEach_root


I’ve been playing around with RenderScript and found a problem only referenced in this StackOverflow question. Unfortunately, my solution brings another problem with it because it makes the app incompatible with my cellphone.