Posts Tagged ‘simulation’

Python bindings for Ngspice

17/02/2014

I wrote a set of Python bindings for the Ngspice simulation engine. It’s meant to add the clarity and power of Python to electronics simulations. For instance, you can simulate a circuit while varying different parameters and produce highly customized plots of your results, while minimizing your exposure to SPICE syntax.

More details on the project page.

Anuncios

Ising model simulations

26/06/2013

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.