O'Reilly logo

Self-Organized Criticality by Henrik Jeldtoft Jensen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

B

Code for the Lattice Gas

We discuss here some details of writing a Computer code for the dynamics of the lattice gas defined in Section 4.4. The code is not optimized; it is included as a guide and for inspiration only.

The configuration of the particles on the (two-dimensional) lattice is stored in the array n(1:L,1:L). The elements of this array take the value n(i,j) = 1 if the site (i,j) is occupied by a particle; otherwise, n(i,j) = 0. The update, as defined in Section 4.4.1, can be coded as sketched below. A complete code of the lattice gas will include an initiation of the array n(i,j), and special attention must be paid to the boundary. Since the lattice is updated simultaneously, we need the array nnew (1:L,1:L) to store intermediate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required