Wednesday, February 10, 2016

Elementary Cellular Automata

In this activity we are tasked to implement the elementary cellular automata. Results for the 1D cellular automata rules in the case of an initial array with a non-zero value at the center only:

Next, we impose the different ECA rules for the case of a random initial list. I used an array with 256 elements drawn from a uniform distribution. The results for the different rules implemented for 256 iterations are shown in the animation below:
We continue to let the system evolve for 256 more iterations and take only this second half of the iterations to remove the transient period. For each time step, we determine the Shannon entropy, $S$, and the kinetic energy $K$, defined as:

$$ S = -\frac{1}{S_{max}}\sum_{i=0}^{i = 8} p_i log p_i$$
$$K  = |K_{t+1}-K_{t}| ^2 $$

where $p_i$ is the probability of occurrence of the ith triple.

We plot the average Shannon entropy vs the average Kinetic energy to check for possible clustering of the different rules. In the figure below, three possible clusters were identified.
Plot of entropy versus energy. The encircled parts are possible clusters. 

Tuesday, February 2, 2016

Biological populations with nonoverlapping generations?

In Robert May's work [1], he discussed the behavior of biological populations with non-overlapping generations. He showed that even simple, fully deterministic nonlinear models exhibit arbitrary behaviors ranging from stable equilibrium to stable cyclic oscillations and up to a chaotic regime depending on the range of values of the growth rate. 
One example of these simple nonlinear one-species models is given by equation, Eq. 1,  [1] which is considered by some to be the difference equation analog of the logistic differential equation where r is now the usual growth rate and K is the carrying capacity. 
$$N_{t+1} = N_t\bigl[r(1-\exp(N_t/K))\bigr]$$
Figure 1 shows the behavior of the population density $\frac{N_t}{K}$ as a function of time t as described by Eq.1, across different values of the growth rate r . For r = 1.8 the plot for the population density flattens after some time which suggests that the populations has reached a stable equilibrium point. For r = 2.3, the population density oscillates between two population points while for r = 2.6 the population density oscillates between four population points. This means that for r = 2.3 and r = 2.6, the population enters a 2-point and 4-points stable cyclic oscillation. For larger values of r, the population goes into a chaotic regime. Note that for the same value of r (r = 3.3) but different values of the initial population density (A: $\frac{N_0}{K}$ = 0.075, B: $\frac{N_0}{K}$ = 1.50), the population density has a tendency of being locked in a 3-point cycle as observed by May [1] in his results.  For even larger values or r (e.g. r = 4.0), the population variation becomes more extreme with periods of high population between periods of very low population. 
Figure 1. Dynamical behavior of the population density N/K as a function of time, t
as described by the difference equation (Eq. 1)  
Robert May [1] also found similar dynamical behaviors for the simple difference equation models for two species competition shown below:
$$N_1(t+1) = N_1(t) \exp \bigl[r_1(K_1 - \alpha_{11}N_1 - \alpha_{12}N_2)/K_1\bigr]$$
$$N_2(t+1) = N_1(t) \exp \bigl[r_2(K_2 - \alpha_{21}N_1 - \alpha_{22}N_2)/K_2\bigr]$$
where $r_i$ are the growth rates, $K_i$ are the carrying capacities and $\alpha_{ij}$ are the competition coefficients. 
The stability character of this difference equation model is shown in Figure 2. The first population $N_1/K$ is plotted as a function of time for several values of r. For the parameters, note that $r_1$ = r and $r_2$ = 2r ,  $K_1$ = $K_2$ = $K$, $\alpha_{11} = \alpha_{22} = 1$ and $\alpha_{12} = \alpha_{21} = 0.5$.
Figure 2. Stability character of the difference equation model for
two competing species described by Eq. 5.

Reference:


  1. 1. May R. M. 
 1974 Biological populations with nonoverlapping generations: stable points, stable cycles, and chaos.Science 186, 645647. (doi:10.1126/science.186.4164.645)