You are on page 1of 65

Theory of Complex Systems

Marco Aurelio Alzate Monroy

Fractals from
Self-Organization

Doctoral Program in Engineering


Information and Knowledge Sciences
District University Francisco José de Caldas
Insect Colonies
Each ant in a colony
performs its own
relatively simple
actions, but they all
work together to build
astoundingly complex
structures that are
fundamental for the
survival of the colony
as a whole.

http://www.youtube.com/watch?v=ukS4UjCauUs
http://www.youtube.com/watch?v=R07_JFfnFnY&feature=related
The Brain

The actions of
neurons and the
pattern of
connections
among groups of
neurons are what
cause perception,
thought, feelings,
consciousness.

http://phineasgage.wordpress.com/2007/03/15/google-tech-talk-lecture-computational-neuroscience
The Immune System

The actions of simple players can


be viewed as a kind of chemical
signal-processing network in which
the recognition of an invader by one
cell triggers a cascade of signals
among cells that put into play an
elaborate complex response.

http://www.youtube.com/watch?v=LSYED-7riNY
Economy

Dow-jones index
The simple microscopic
components consist of people
buying and selling goods and the
collective behavior is the
complex, hard-to-predict
behavior of markets as a whole,
including prices of housing and
fluctuation in stock prices.
The World Wide Web
Individuals post web
pages, linking to other
web pages. But the
overall structure, the
growing pattern and the
co-evolutionary
relationships between
search engines and the
Web´s link structure are
highly complex
Some common aspects
www

Large networks of individual components


Simple rules with no central control
Collective actions of many components give rise to complex patterns
Production and utilization of information
Adaptation through learning and evolution
Natural math model

- Local transmission of electrochemical impulses among neighbor neurons


- Local plasmid migration among neighbor bacteria
- Local social behavior learning among neighbor individuals (gossip, epidemics,…)
- Local chemical reactions among neighbor molecules
- Local packet exchanges among neighbor routers
- Etc.
“Our” model

“Tractable” model

“Realistic” model
Natural math model
As usual, simplified math modeling
Simple topological interconnections: Each component interacts with two immediate neighbors in a row

Simple internal states and interactions: on/ff and three-input boolean functions
Cellular Automaton




-1) ci-r(t-1) … ci-1(t-1) ci(t-1) ci+1(t-1) … ci+r(t-1) c

t) ci-r(t) … ci-1(t) ci(t) ci+1(t) … ci+r(t)

+1) ci-r(t+1) … ci-1(t+1) ci(t+1) ci+1(t+1) … ci+r(t+1) ci





time space
ci(t) is the state of cell i at instant t
The next state of cell i depends on the current states of the neighbor cells in a radius r
For k states we need R = k2r+1 rules and there are kR possible sets of rules

For example : Number of states = 2


States = {0,1}
radius = 1
23=8 rules : if 1  k=-1,0,1ci+k(t)  2, ci(t+1)1, else ci(t+1)0
One of 256 possible sets of rules
Finite State Automaton
If ci-1(t) ci(t) ci+1(t) ci(t+1)
1  k=-1,0,1ci+k(t)  2 0 0 0 0
then
0 0 1 1
ci(t+1)1
else 0 1 0 1
ci(t+1)0 0 1 1 1
end 1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
Finite State Automaton
colormap([1 1 1; 0 0 0]) % 0 blanco, 1 negro
n = 512; i=2:n-1; % Tamaño de la línea
c = zeros(n/2,n); % Historia del autómata
c(1,n/2 + [0 1]) = 1; % Estado inicial
for t=2:n/2 % Indice de tiempo
sum(i) = c(t-1,i-1) + c(t-1,i) + c(t-1,i+1);
sum(1) = c(t-1,n) + c(t-1,1) + c(t-1,2);
sum(n) = c(t-1,1) + c(t-1,n) + c(t-1,n-1);
c(t,:) = (sum<3).*(sum>0); % Evalúa la regla
end
imagesc(c)

50

100

150

200

250
50 100 150 200 250 300 350 400 450 500
colormap([1 1 1; 0 0 0]) % 0 blanco, 1 negro
n = 512; i=2:n-1; % Tamaño de la linea
c = zeros(n,n); % Historia del autómata
c(1,:) = (rand(1,n)>0.95); % Estado inicial
for t=2:n % Indice de tiempo
sum(i) = c(t-1,i-1) + c(t-1,i) + c(t-1,i+1);
sum(1) = c(t-1,n) + c(t-1,1) + c(t-1,2);
sum(n) = c(t-1,1) + c(t-1,n) + c(t-1,n-1);
c(t,:) = (sum<3).*(sum>0); % Evalúa la regla
end
imagesc(c)
50

100

150

200

250

300

350

400

450

500
50 100 150 200 250 300 350 400 450 500
Elementary (binary neighbor-3)
cellular automata
ci-1(t) ci(t) ci+1(t) ci(t+1)
0 0 0 x0 8 bits : 256 possible rules
0 0 1 x1 011111102 = 12610

0 1 0 x2
0 1 1 x3
1 0 0 x4
1 0 1 x5
1 1 0 x6
1 1 1 x7
Elementary cellular automata
regla = 126; % Evalúa el autómata celular binario unidimensional con vecindario 3 para la regla dada
AC = zeros(800,800); % Autómata celular
AC(1,:) = (rand(1,800)>0.975); % Estado inicial (~20 celdas prendidas)
regla = fliplr(dec2bin(regla,8)); % Función lógica para 111,110,101,100,011,010,001,000
for i=1:8 % [ r7 r6 r5 r4 r3 r2 r1 r0]
r(i)=str2num(regla(i));
end
for i=2:800 % Simula 800 pasos
for j=2:799 % Recorre cada columna
x = AC(i-1,j+(-1:1)); % Vecindario de (i,j)
AC(i,j) = (~x(1) & ~x(2) & ~x(3) & r(1)) | (~x(1) & ~x(2) & x(3) & r(2)) | ... % Evalúa
(~x(1) & x(2) & ~x(3) & r(3)) | (~x(1) & x(2) & x(3) & r(4)) | ... % la regla
( x(1) & ~x(2) & ~x(3) & r(5)) | ( x(1) & ~x(2) & x(3) & r(6)) | ... % para (i,j)
( x(1) & x(2) & ~x(3) & r(7)) | ( x(1) & x(2) & x(3) & r(8));
end
end
imshow(~AC) % Muestra el resultado (blanco: apagado, negro: prendido)
title(['Regla # ' fliplr(regla)]) % Despliega la regla evaluada
Elementary cellular automata
Regla # 0 Regla # 1 Regla # 2 Regla # 3 Regla # 4 Regla # 5 Regla # 6 Regla # 7

Regla # 8 Regla # 9 Regla # 10 Regla # 11 Regla # 12 Regla # 13 Regla # 14 Regla # 15

Regla # 16 Regla # 17 Regla # 18 Regla # 19 Regla # 20 Regla # 21 Regla # 22 Regla # 23

Regla # 24 Regla # 25 Regla # 26 Regla # 27 Regla # 28 Regla # 29 Regla # 30 Regla # 31

Regla # 32 Regla # 33 Regla # 34 Regla # 35 Regla # 36 Regla # 37 Regla # 38 Regla # 39

Regla # 40 Regla # 41 Regla # 42 Regla # 43 Regla # 44 Regla # 45 Regla # 46 Regla # 47

Regla # 48 Regla # 49 Regla # 50 Regla # 51 Regla # 52 Regla # 53 Regla # 54 Regla # 55

Regla # 56 Regla # 57 Regla # 58 Regla # 59 Regla # 60 Regla # 61 Regla # 62 Regla # 63


Elementary cellular automata
Regla # 64 Regla # 65 Regla # 66 Regla # 67 Regla # 68 Regla # 69 Regla # 70 Regla # 71

Regla # 72 Regla # 73 Regla # 74 Regla # 75 Regla # 76 Regla # 77 Regla # 78 Regla # 79

Regla # 80 Regla # 81 Regla # 82 Regla # 83 Regla # 84 Regla # 85 Regla # 86 Regla # 87

Regla # 88 Regla # 89 Regla # 90 Regla # 91 Regla # 92 Regla # 93 Regla # 94 Regla # 95

Regla # 96 Regla # 97 Regla # 98 Regla # 99 Regla # 100 Regla # 101 Regla # 102 Regla # 103

Regla # 104 Regla # 105 Regla # 106 Regla # 107 Regla # 108 Regla # 109 Regla # 110 Regla # 111

Regla # 112 Regla # 113 Regla # 114 Regla # 115 Regla # 116 Regla # 117 Regla # 118 Regla # 119

Regla # 120 Regla # 121 Regla # 122 Regla # 123 Regla # 124 Regla # 125 Regla # 126 Regla # 127
Elementary cellular automata
Regla # 128 Regla # 129 Regla # 130 Regla # 131 Regla # 132 Regla # 133 Regla # 134 Regla # 135

Regla # 136 Regla # 137 Regla # 138 Regla # 139 Regla # 140 Regla # 141 Regla # 142 Regla # 143

Regla # 144 Regla # 145 Regla # 146 Regla # 147 Regla # 148 Regla # 149 Regla # 150 Regla # 151

Regla # 152 Regla # 153 Regla # 154 Regla # 155 Regla # 156 Regla # 157 Regla # 158 Regla # 159

Regla # 160 Regla # 161 Regla # 162 Regla # 163 Regla # 164 Regla # 165 Regla # 166 Regla # 167

Regla # 168 Regla # 169 Regla # 170 Regla # 171 Regla # 172 Regla # 173 Regla # 174 Regla # 175

Regla # 176 Regla # 177 Regla # 178 Regla # 179 Regla # 180 Regla # 181 Regla # 182 Regla # 183

Regla # 184 Regla # 185 Regla # 186 Regla # 187 Regla # 188 Regla # 189 Regla # 190 Regla # 191
Elementary cellular automata
Regla # 192 Regla # 193 Regla # 194 Regla # 195 Regla # 196 Regla # 197 Regla # 198 Regla # 199

Regla # 200 Regla # 201 Regla # 202 Regla # 203 Regla # 204 Regla # 205 Regla # 206 Regla # 207

Regla # 208 Regla # 209 Regla # 210 Regla # 211 Regla # 212 Regla # 213 Regla # 214 Regla # 215

Regla # 216 Regla # 217 Regla # 218 Regla # 219 Regla # 220 Regla # 221 Regla # 222 Regla # 223

Regla # 224 Regla # 225 Regla # 226 Regla # 227 Regla # 228 Regla # 229 Regla # 230 Regla # 231

Regla # 232 Regla # 233 Regla # 234 Regla # 235 Regla # 236 Regla # 237 Regla # 238 Regla # 239

Regla # 240 Regla # 241 Regla # 242 Regla # 243 Regla # 244 Regla # 245 Regla # 246 Regla # 247

Regla # 248 Regla # 249 Regla # 250 Regla # 251 Regla # 252 Regla # 253 Regla # 254 Regla # 255
Elementary cellular automata
1. Uniform 2. Repetitive Regla # 01001101

(Rule 2) (Rule 77)


3. Random (chaotic) 4. Complex

(Rule 150) (Rule 110)


Regla # 01101110

¡Computational
Capacity!

In 1992, Matthew Cook (Wolfram’s


resarch assistant) proved that rule 110
is a universal computer… ¡The simplest
universal computer known so far!
First (and current) computers follow strict logical rules from classical mathematics

Von Neumann Architecture


Turing Machine

Current PCs are sophisticated TM based John Von Neumann and the IAS computer
on Von Neumann architecture
¡But John Von Neumann designed many different computer architectures, trying to model life!
1948 Hixon Symposyum in Pasadena “General theory of
automata” :
Turing Machines (logical process), -Alan Turing
Neural Networks (brain learning), -McCulloch and Pitts
Cellular Automata (self-reproduction) -Stanislaw Ulam

¡Foundations of the relations


among computation,
complexity and life!

“Cellular automata are inherently parallel computers:


Different regions of the lattice carry on concurrent
computations, and communicate through boundaries
between pairs of regions (much like turing machines
are inherently serial computers)”
1953 Vanuxen Lectures, Princeton University:
“Self-reproducing celular automata”:
200.000 cells, each of 29 states
(includes a little neural network and a
145000 places turing machine tail)
“There is no conclusive evidence of an esential gap between life and machine”

True birth of complex systems theory, but languished for


- Lack of computing capability
- Lack of a conventional academic discipline (¿physics? ¿biology?
¿mathematics? ¿computer science? ...)
20 years later… ¡Conway’s Game of life!
1. Any live cell with fewer than two live neighbors dies
(under-population).
2. Any live cell with two or three live neighbors lives on
to the next generation.
3. Any live cell with more than three live neighbors dies
(overcrowding).
4. Any dead cell with exactly three live neighbors
becomes alive (reproduction).

The initial pattern constitutes the seed of the system.

n=64 ; % Tamaño del mundo


mundo = (rand(n,n)<0.5); % Inicializa el mundo
imagesc(mundo); % Visualiza el mundo
colormap([1 1 1; 0 0 0]); % 0 - blanco, 1 - negro
axis equal
axis tight
while(1)
mundo = [mundo(n,n) mundo(n,1:n) mundo(n,1); ... % Forma el toroide
mundo(1:n,n) mundo mundo(1:n,1); ...
mundo(1,n) mundo(1,1:n) mundo(1,1)];
% Evalúa la regla de interacción
suma = mundo(1:n,1:n) + mundo(1:n,2:n+1) + mundo(1:n,3:n+2) + ...
mundo(2:n+1,1:n) + mundo(2:n+1,3:n+2) + ...
mundo(3:n+2,1:n) + mundo(3:n+2,2:n+1) + mundo(3:n+2,3:n+2);
mundo = ((suma==3) + (suma==2).*mundo(2:n+1,2:n+1));
imagesc(mundo); % Actualiza la imagen
drawnow
end
Game of life
n=64 ; % Tamaño del mundo
mundo = (rand(n,n)<0.5); % Inicializa el mundo
imagesc(mundo); % Visualiza el mundo
colormap([1 1 1; 0 0 0]); % 0 - blanco, 1 - negro
axis equal
axis tight
while(1)
mundo = [mundo(n,n) mundo(n,1:n) mundo(n,1); ... % Forma el toroide
mundo(1:n,n) mundo mundo(1:n,1); ...
mundo(1,n) mundo(1,1:n) mundo(1,1)];
% Evalúa la regla de interacción
suma = mundo(1:n,1:n) + mundo(1:n,2:n+1) + mundo(1:n,3:n+2) + ...
mundo(2:n+1,1:n) + mundo(2:n+1,3:n+2) + ...
mundo(3:n+2,1:n) + mundo(3:n+2,2:n+1) + mundo(3:n+2,3:n+2);
mundo = ((suma==3) + (suma==2).*mundo(2:n+1,2:n+1));
imagesc(mundo); % Actualiza la imagen
drawnow
end
Game of life
Some static objects
Game of life
Some periodic objects
Game of life
Some moving objects
Game of life
Visualizing periodic and moving objects

n = 128;
mundo = zeros(n,n);
mundo(2:4,2:4) = [0 0 1; 1 0 1; 0 1 1];
mundo(20:32,3:15) = [0 0 1 1 1 0 0 0 1 1 1 0 0;...
0 0 0 0 0 0 0 0 0 0 0 0 0;...
1 0 0 0 0 1 0 1 0 0 0 0 1;...
1 0 0 0 0 1 0 1 0 0 0 0 1;...
1 0 0 0 0 1 0 1 0 0 0 0 1;...
0 0 1 1 1 0 0 0 1 1 1 0 0;...
0 0 0 0 0 0 0 0 0 0 0 0 0;...
0 0 1 1 1 0 0 0 1 1 1 0 0;...
1 0 0 0 0 1 0 1 0 0 0 0 1;...
1 0 0 0 0 1 0 1 0 0 0 0 1;...
1 0 0 0 0 1 0 1 0 0 0 0 1;...
0 0 0 0 0 0 0 0 0 0 0 0 0;...
0 0 1 1 1 0 0 0 1 1 1 0 0];

mundo(90:93,45:49) = [0 1 1 0 0;...
1 1 0 1 1;...
0 1 1 1 1;...
0 0 1 1 0];

mundo(20:24,100:104) = [1 1 0 0 0;...
1 0 0 0 0;...
0 1 0 1 0;...
0 0 0 0 1;...
0 0 0 1 1];
Game of life
mundo = zeros(n,n);
Glider gun
% Inicializa el mundo
mundo(2:10,2:37) = [0 0 0 0 1 1 0 0 0; ...
0 0 0 0 1 1 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 1 1 1 0 0; ...
0 0 0 1 0 0 0 1 0; ...
0 0 1 0 0 0 0 0 1; ...
0 0 1 0 0 0 0 0 1; ...
0 0 0 0 0 1 0 0 0; ...
0 0 0 1 0 0 0 1 0; ...
0 0 0 0 1 1 1 0 0; ...
0 0 0 0 0 1 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 1 1 1 0 0 0 0; ...
0 0 1 1 1 0 0 0 0; ...
0 1 0 0 0 1 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
1 1 0 0 0 1 1 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 0 0 0 0 0 0 0; ...
0 0 1 1 0 0 0 0 0; ...
0 0 1 1 0 0 0 0 0]';
Why “Game of life”?
… Self-reproduction!
They use significative and suggestive (and funny) names:

Beehive Loaf Pond Tube Block Snake

Barge Boat Ship Long Barge Long Boat Long Ship


Another universal computer
Berlekamp, Conway and Guy “Winning
ways for your mathematical plays”
Academic press, 1982
• Making gliders as bits, glider guns as
clocks and other structures as logical
gates, any computation that can be
carried out in a Turing Machine, can
also be carried out in the game of life.

• Since extremely simple dynamical systems (as simple as rule 110) can
support universal computation, most natural systems can probably
support universal computation too…
• A nice way to think about processes in nature is that they are computing…
• Physics has gone from matter and energy to information…

Indeed, some nice simple examples…


Surface tension
Another set of rules:
Sum the 8 nearest neighbors and the cell itself
If the sum< 4 or sum=5 then the state=0
Otherwise the state=1
n=64 ; % Tamaño del mundo
mundo = rand(n,n)>0.5; % Inicializa el mundo
imagesc(mundo); % Visualiza el mundo
colormap([1 1 1; 0 0 0]); % 0 - blanco, 1 - negro
axis equal
axis tight
while(1)
mundo = [mundo(n,n) mundo(n,1:n) mundo(n,1); ... % Forma el toroide
mundo(1:n,n) mundo mundo(1:n,1); ...
mundo(1,n) mundo(1,1:n) mundo(1,1)];
% Evalúa la regla de interacción
suma = mundo(1:n,1:n) + mundo(1:n,2:n+1) + mundo(1:n,3:n+2) + ...
mundo(2:n+1,1:n) + mundo(2:n+1,2:n+1) + mundo(2:n+1,3:n+2) + ...
mundo(3:n+2,1:n) + mundo(3:n+2,2:n+1) + mundo(3:n+2,3:n+2);
mundo = (suma==4) + (suma>5);
imagesc(mundo); % Actualiza la imagen
drawnow
end
Excitable media
Another set of rules:
Cells can be in 10 different states:
State 0 is resting, states 1-5 are active, states 6-9 are refractory
Count the active cells among the 8 nearest neighbors
If the sum is greater or equal to 3, then cell=1.
States 1 to 9 occur stepwise with no more input:
If state=k then the next state=k+1, k=1..8
If state=9 then the next state=0

n=128 ; % Tamaño del mundo


mundo = rand(n,n)>0.9; % Inicializa el mundo
imagesc(mundo); % Visualiza el mundo
colormap([(0:9)'/9 zeros(10,2)]); % 0 - blanco, 1 - negro
axis equal
axis tight
while(1)
mundo = [mundo(n,n) mundo(n,1:n) mundo(n,1); ... % Forma el toroide
mundo(1:n,n) mundo mundo(1:n,1); ...
mundo(1,n) mundo(1,1:n) mundo(1,1)];
% Evalúa la regla de interacción
suma = ((mundo(1:n,1:n)>0) .* (mundo(1:n,1:n)<6) + ...
(mundo(1:n,2:n+1)>0) .* (mundo(1:n,2:n+1)<6) + ...
(mundo(1:n,3:n+2)>0) .* (mundo(1:n,3:n+2)<6) + ...
(mundo(2:n+1,1:n)>0) .* (mundo(2:n+1,1:n)<6) + ...
(mundo(2:n+1,3:n+2)>0) .* (mundo(2:n+1,3:n+2)<6) + ...
(mundo(3:n+2,1:n)>0) .* (mundo(3:n+2,1:n)<6) + ...
(mundo(3:n+2,2:n+1)>0) .* (mundo(3:n+2,2:n+1)<6) + ...
(mundo(3:n+2,3:n+2)>0) .* (mundo(3:n+2,3:n+2)<6));
mundo = mod(mundo(2:n+1,2:n+1) + 1,10);
mundo = mundo.*(mundo~=1) + (mundo==1).*(suma>2);
imagesc(mundo); % Actualiza la imagen
drawnow
end
Not just suggestive!
Forest-fire model
- A forest is a grid of trees.
- A lightning strikes with probability p at
any given site and starts a fire.

- Each cell could be empty (state 0), have


a burning tree (state 1) or have a living
tree (state 2).

- If one or more of the 4 neighbors of a


living tree is a burning tree, it becomes
a burning tree.
- A burning tree becomes an empty cell.
- With probability q, an empty cell
becomes a living tree
Forest-fire model
n=100; % Tamaño del mundo
p = 0.0001; % Probabilidad de que caiga un rayo
q = 0.01; % Probabilidad de que nazca un árbol
mundo=zeros(n,n); % El bosque empieza vacío
imagesc(mundo); % Visualiza el mundo
colormap([0 0 0; 1 0 0; 0 1 0]); % 0–negro(vacío), 1-rojo(quemado), 2-verde (vivo)
axis equal
axis tight
while(1)
suma = (mundo(1:n,[n 1:n-1])==1) + (mundo(1:n,[2:n 1])==1) + ...
(mundo([n 1:n-1], 1:n)==1) + (mundo([2:n 1],1:n)==1) ;

mundo = ...
2*(mundo==2) - ((mundo==2) & (suma>0 | (rand(n,n)<p))) + ... % de dos a uno porque se quema
2*((mundo==0) & rand(n,n)<q) ; % de cero a dos porque nace un árbol
% de uno a cero porque queda vacío
imagesc(mundo)
drawnow
end

A good introduction to SOC


(Self-Organized Criticality)…
Simplified model of forest-fires
empty square lattice occupied sites
Simplified model of forest-fires

Connected site

Isolated site
Simplified model of forest-fires

A spark that hits an


empty site does
nothing.
Simplified model of forest-fires

A spark that hits a


cluster causes loss
of that cluster.
Simplified model of forest-fires

Yield = the density after one spark

17/64 13/64
Simplified model of forest-fires
function y = Bosque_SOC(ro)
n=100; N = 200; % Tamaño del mundo, número de simulaciones
p = zeros(N,1); % Densidad después del rayo
for i = 1:N
mundo=2*double((rand(n,n)<ro)); % Mundo inicial
x = randi(n); y = randi(n); % Sitio de impacto
if mundo(x,y)==2 % Es un árbol: la región entera se debe quemar
L = bwlabel((mundo==2),4); % Regiones conectadas
k = L(x,y); % Región en la que se encuentra el sitio de impacto
mundo = mundo.*(L~=k) + double((L==k)); % quema la región entera
end
p(i) = sum(mundo(:)==2)/n/n; % Densidad después del rayo
imagesc(mundo); % Visualiza el mundo
colormap([0 0 0; 1 0 0; 0 1 0]); % Negro=vacío, rojo=quemado, verde=vivo
axis equal; axis tight; axis off
drawnow
end
y = mean(p);

=0.1 =0.2 =0.3 =0.4 =0.5 =0.6 =0.7


Simplified model of forest-fires
0.7
function y = Bosque_SOC(ro)
n=100; N = 2000;
p = zeros(N,1); 0.6
for i = 1:N
mundo=2*double((rand(n,n)<ro));
0.5
x = randi(n); y = randi(n);
if mundo(x,y)==2

Yield, y
L = bwlabel((mundo==2),4); 0.4
k = L(x,y);
mundo = mundo.*(L~=k) + double((L==k));
0.3
end
p(i) = sum(mundo(:)==2)/n/n;
imagesc(mundo); 0.2
colormap([0 0 0; 1 0 0; 0 1 0]);
axis equal; axis tight; axis off
0.1
drawnow
end
y = mean(p); 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Density, 

=0.1 =0.2 =0.3 =0.4 =0.5 =0.6 =0.7


N=100 1

0.9
no sparks
0.8 “critical point”
0.7

0.6
Yield, y

0.5

0.4

0.3

0.2 sparks
0.1

0
0 0.2 0.4 0.6 0.8 1
Density, 
limit 1
N 0.9

0.8 “critical point”


0.7

0.6
Yield, y

0.5

0.4

0.3

0.2

0.1 c = .5927
0
0 0.2 0.4 0.6 0.8 1
Density, 
Simplified model of forest-fires
Fires
don’t
matter.
Simplified model of forest-fires

Everything burns.
Simplified model of forest-fires

Critical point
Percolation Models
At what density appears the first canopy
path between two borders of the forest?

=0.1582 =0.2336 =0.2890 =0.3181 =0.3819 =0.4282

=0.4657 =0.4951 =0.5231 =0.5335 =0.5439 =0.5547

=0.5646 =0.5852 =0.5925 =0.6012 =0.6107 =0.65

Percolation
Percolation Models
At what density appears the first canopy
path between two borders of the forest?
For an infinite grid, at what density
appears the first infinite cluster?
For a given density, what is the probability that a
canopy path exists between two borders of the forest?

y ( ρ)  1  P ( ρ)   ρ  P ( ρ)  ρ  P ( ρ) 

If the spark The forest


does not hit The loss is But if the spark
 
losses the
the infinite infinitesimal hits the infinite infinite
cluster cluster cluster
Percolation Models
At what density appears the first canopy
path between two borders of the forest?
For an infinite grid, at what density
appears the first infinite cluster?
For a given density, what is the probability that a
canopy path exists between two borders of the forest?

y ( ρ)  1  P ( ρ)   ρ  P ( ρ)  ρ  P ( ρ) 
Percolation Models
1

0.9

0.8

0.7

0.6

P 0.5

0.4

0.3

0.2

0.1

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
ρ

Critical Point
n = 512;
Percolation Models
% Grilla de 512x512
b = 2.^(0:18)';
h = zeros(19,3);
% 19 tamaños de clusters
% 3 densidades iniciales
SOC: Self-
ro = [0.3 0.593 0.8]';
for i=1:3
% antes, durante y después del punto crítico Organized
for j=1:6000 % 6000 simulaciones para cada densidad
mundo = logical(rand(n,n)<ro(i)); % Construye el bosque
Criticality
CC = bwconncomp(mundo,4); % Halla los componentes conectados
numPixels = cellfun(@numel,CC.PixelIdxList); % Calcula sus tamaños
h(:,i) = h(:,i) + hist(numPixels,b)'; % Suma los histogramas
end
h(:,i) = h(:,i)/sum(h(:,i)); % Estima la probabilidad de cada rango de tamaños
end
loglog(b,1-cumsum(h)) % Grafica las colas de las distribuciones
0
10
ro = 0.3
ro = 0.593 Los incendios
-1 ro = 0.8
10 forestales reales
Frecuencia relativa

siguen una ley


de potencia
-2
10

-3 Alta densidad: constante


10

-4
10
0 1 2 3 4
10 10 10 10 10
Tamaño del incendio
SOC/EoC
0
10
ro = 0.3
ro = 0.593
-1 ro = 0.8 Self-Organized
10 Criticality at the
Frecuencia relativa

Edge of Chaos

-2
10

Chaos

-3
10

-4
10
0 1 2 3 4
10 10 10 10 10
Tamaño del incendio
Forest-fire model
n=100; % Tamaño del mundo
p = 0.0001; % Probabilidad de que caiga un rayo
q = 0.01; % Probabilidad de que nazca un árbol
mundo=zeros(n,n); % El bosque empieza vacío
imagesc(mundo); % Visualiza el mundo
colormap([0 0 0; 1 0 0; 0 1 0]); % 0–negro(vacío), 1-rojo(quemado), 2-verde (vivo)
axis equal
axis tight
while(1)
suma = (mundo(1:n,[n 1:n-1])==1) + (mundo(1:n,[2:n 1])==1) + ... % suma(i,j) = # de árboles
(mundo([n 1:n-1], 1:n)==1) + (mundo([2:n 1],1:n)==1) ; % quemándose en la vecindad de (i,j)
mundo = ...
2*(mundo==2) - ((mundo==2) & (suma>0 | (rand(n,n)<p))) + ... % de dos a uno porque se quema
2*((mundo==0) & rand(n,n)<q) ; % de cero a dos porque nace un árbol
% de uno a cero porque queda vacío
imagesc(mundo)
drawnow
end

The dynamical model leads to criticality as long as


the rate of forest growth (q per unit time –per
empty site-) is large compared with the rate of
ignition (p per unit time –per living tree-) but
infinitesimal compared with the rate at which fire
propagates (four per unit time –per burning tree-).

You might also like