15.08.2015 Views

Introduction to the Modeling and Analysis of Complex Systems

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

12.2. PHASE SPACE VISUALIZATION 213def config(x):return [1 if x & 2**i > 0 else 0 for i in range(L - 1, -1, -1)]def cf_number(cf):return sum(cf[L - 1 - i] * 2**i for i in range(L))def update(cf):nextcf = [0] * Lfor x in range(L):count = 0for dx in range(-r, r + 1):count += cf[(x + dx) % L]nextcf[x] = 1 if count > (2 * r + 1) * 0.5 else 0return nextcffor x in xrange(2**L):g.add_edge(x, cf_number(update(config(x))))ccs = [cc for cc in nx.connected_components(g.<strong>to</strong>_undirected())]n = len(ccs)w = ceil(sqrt(n))h = ceil(n / w)for i in xrange(n):subplot(h, w, i + 1)nx.draw(nx.subgraph(g, ccs[i]), with_labels = True)show()The result is shown in Fig. 12.1. From this visualization, we learn that <strong>the</strong>re are twomajor basins <strong>of</strong> attraction with 36 o<strong>the</strong>r minor ones. The inside <strong>of</strong> those two major basins<strong>of</strong> attraction is packed <strong>and</strong> quite hard <strong>to</strong> see, but if you zoom in<strong>to</strong> <strong>the</strong>ir central parts usingpylab’s interactive zoom-in feature (available from <strong>the</strong> magnifying glass but<strong>to</strong>n on <strong>the</strong> plotwindow), you will find that <strong>the</strong>ir attrac<strong>to</strong>rs are “0” (= [0, 0, 0, 0, 0, 0, 0, 0, 0], all zero) <strong>and</strong>“511” (= [1, 1, 1, 1, 1, 1, 1, 1, 1], all one). This means that this system has a tendency <strong>to</strong>converge <strong>to</strong> a consensus state, ei<strong>the</strong>r 0 or 1, sensitively depending on <strong>the</strong> initial condition.Also, you can see that <strong>the</strong>re are a number <strong>of</strong> states that don’t have any predecessors.Those states that can’t be reached from any o<strong>the</strong>r states are called “Garden <strong>of</strong> Eden”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!