-
Notifications
You must be signed in to change notification settings - Fork 0
The Algorithm
The Monte Carlo method implemented by the algorithm starts by normalizing rates so to have only one parameter: dead_rate, corresponding to a number between 0 and 1, representing a probability.
Before normalizing rates, the birth-dead process has two parameters which are positive Real numbers: (i) birth and (ii) dead rates. Notice however, that birth has to be bigger than dead or the process goes extinct. So, particles must give birth before they die. This means we can take the time it takes to give birth (1/birth) to be the clock of our system (as nothing happens faster than this). Now we measure rates of events (birth and dead) in units of this clock. This way, particles give birth with probability birth/birth = 1 in one dt unit. At the same time, in this same period, particles can die with probability dead_rate = dead/birth.
As events (birth and dead) are stochastic, we cannot update the Lattice in any particular order as our choice will affect (bias) the spatial process. To avoid this, in one dt, we need to visit all sites in the lattice with equal probability (almost all sites once). So as long the simulation is running, to implement 1 tick of the clock, repeat for as many as sites in the Lattice:
1.- Pick a site at random (spatial coordinates). We call this site, the focal site.
2.- If the focal site is occupied (State 1):
2.1.- pick a uniform random number in [0,1];
If it is smaller than dead_rate, flip the state of the focal site to vacant (accept);
If not, leave it as it is (reject).
3.- If the focal site is vacant (State 0):
3.1.- pick a random neighbor from the possible four. We call this site, the random neighbor.
If random neighbor is occupied, flip the state of the focal site to occupied (accept);
If not, leave the focal site as it is (reject).
4.- Go back to 1 and repeat as many times as there are sites on the Lattice (256 x 256). Then almost all have been visited once on average (a few none or twice). Once this number of focal sites have been visited, one dt has taken place and the lattice has been updated in an isotropic fashion.