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.

338 CHAPTER 16. DYNAMICAL NETWORKS I: MODELING“Measure <strong>the</strong> difference between your neighbor <strong>and</strong> yourself, <strong>and</strong> <strong>the</strong>n sum upall those differences.”Note that this is exactly what we did on a network in Eq. (16.3)! So, essentially, <strong>the</strong> Laplacianmatrix <strong>of</strong> a graph is a discrete equivalent <strong>of</strong> <strong>the</strong> Laplacian opera<strong>to</strong>r for continuousspace. The only difference, which is quite unfortunate in my opinion, is that <strong>the</strong>y are definedwith opposite signs for his<strong>to</strong>rical reasons; compare <strong>the</strong> first term <strong>of</strong> Eq. (13.17) <strong>and</strong>Eq.(16.4), <strong>and</strong> you will see that <strong>the</strong> Laplacian matrix did not absorb <strong>the</strong> minus sign insideit. So, conceptually,∇ 2 ⇔ −L. (16.6)I have always thought that this mismatch <strong>of</strong> signs was so confusing, but both <strong>of</strong> <strong>the</strong>se“Laplacians” are already fully established in <strong>the</strong>ir respective fields. So, we just have <strong>to</strong> livewith <strong>the</strong>se inconsistent definitions <strong>of</strong> “Laplacians.”Now that we have <strong>the</strong> ma<strong>the</strong>matical equations for diffusion on a network, we c<strong>and</strong>iscretize time <strong>to</strong> simulate <strong>the</strong>ir dynamics in Python. Eq. (16.3) becomes[c i (t + ∆t) = c i (t) +α ∑ j∈N i(cj (t) − c i (t) )] ∆t (16.7)= c i (t) + α[( ∑j∈N ic j (t))− c i (t) deg(i)]∆t. (16.8)Or, equivalently, we can also discretize time in Eq. (16.4), i.e.,c(t + ∆t) = c(t) − αLc(t)∆t (16.9)= (I − αL∆t) c(t), (16.10)where c is now <strong>the</strong> state vec<strong>to</strong>r for <strong>the</strong> entire network, <strong>and</strong> I is <strong>the</strong> identity matrix. Eqs. (16.8)<strong>and</strong> (16.10) represent exactly <strong>the</strong> same diffusion dynamics, but we will use Eq. (16.8) for<strong>the</strong> simulation in <strong>the</strong> following, because it won’t require matrix representation (which couldbe inefficient in terms <strong>of</strong> memory use if <strong>the</strong> network is large <strong>and</strong> sparse).We can reuse Code 16.4 for this simulation. We just need <strong>to</strong> replace <strong>the</strong> updatefunction with <strong>the</strong> following:Code 16.7: net-diffusion.pyalpha = 1 # diffusion constantDt = 0.01 # Delta t

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

Saved successfully!

Ooh no, something went wrong!