slides - Center for Collective Dynamics of Complex Systems (CoCo)

NECSI Summer School 2008
Week 2: Complex Systems Modeling and Networks
Cellular Automata
Hiroki Sayama
[email protected]
Spatio-Temporal Dynamics on
Locally Connected Networks
Locally connected networks
• Networks where
parts interact
with their local
neighbors
– Spatial extension
introduced to the
system
– More general network topologies to be
discussed later
3
Example: Simple diffusion
• N parts arranged
in a 1-D array
• State of each part (si) represents a
concentration of a chemical
• The chemical diffuses locally:
si,t+1 = si,t + (<si,t> - si,t) * d
<si,t>: Local average of s at ith location
d : diffusion coefficient
4
Exercise
• What happens if only one part has
non-zero value, while all the others
have zero?
• What happens if you modify the
update rule (say, change the sign of
the diffusion coefficient)?
5
Cellular Automata: A Simplified
Discrete-State Model
Spatio-temporal patterns
• If a system has spatial extension,
nonlinear interactions among local parts
may spontaneously create patterns
from initially uniform conditions
– May be static or dynamic
– Seen in many aspects of
biological systems
• Morphogenesis
• Neural/muscular activities
• Population distribution
7
Cellular automata (CA)
• A regular grid model made
of many “automata” whose
states are finite and
discrete ( nonlinearity)
• Their states are simultaneously updated by a
uniform state-transition
function that refers to
states of their neighbors
st+1(x) = F ( st(x+x0), st(x+x1), ... , st(x+xn-1) )
8
How CA works
Neighborhood
T
L
C
R
B
State set
State-transition function
CTRBL
CTRBL
CTRBL
CTRBL
{ , }
9
Typical 2-D neighborhood shapes
von Neumann neighborhood
Moore neighborhood
10
Modeling example: Panic in a gym
11
Fire alarm causes initial panics
12
Rules of local interaction
With four or more
panicky persons
around you
With two or fewer panicky
persons around you
13
Exercise
• What happens if you change the initial
ratio of panicky people?
• What happens if you change the state
transition rules?
• Can you modify the code so that it
produces time series of the number of
panicky people as well as the visual
plot?
14
Exercise
• Implement the simulator of “majority”
CA (each cell turns into a local
majority state) and see what kind of
patterns arise
• What will happen if:
– Number of states are increased
– Size of neighborhoods is increased
– “Minority” rule is adopted
15
Modeling Exercises
Several biological models on CA
• Turing patterns
• Waves in excitable media
• Host-pathogen models
• Epidemic / forest fire models
17
Turing patterns
• Chemical pattern formation proposed
by Alan Turing (original model was
based on PDEs)
– Each cell takes either active or passive
– Strong short-range activation
– Relatively weak long-range inhibition
18
Waves in excitable media
• Propagation of signals over tissues
made of nerve or muscle cells that
are “excitable”
– Excitation of resting cells by excited
neighbors
– Excitation followed by refractory states,
eventually going back to resting
19
Host-pathogen models
• Propagation of pathogens over
dynamically growing hosts
– Spatial growth of hosts
– Infection of pathogens to nearby hosts
– Death of hosts caused by infection
20
Epidemic / forest fire models
• Propagation of disease or fire over
statically distributed hosts
– Propagation of disease or fire to nearby
hosts
– Death or breakdown of hosts caused by
propagation
21