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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

112 CHAPTER 7. CONTINUOUS-TIME MODELS II: ANALYSISFind <strong>the</strong> equilibrium points <strong>of</strong> <strong>the</strong> following model <strong>of</strong> a simple pen-Exercise 7.2dulum:d 2 θdt = − g sin θ (7.6)2 LExercise 7.3 The following model is called a Susceptible-Infected-Recovered(SIR) model, a ma<strong>the</strong>matical model <strong>of</strong> epidemiological dynamics. S is <strong>the</strong> number<strong>of</strong> susceptible individuals, I is <strong>the</strong> number <strong>of</strong> infected ones, <strong>and</strong> R is <strong>the</strong> number <strong>of</strong>recovered ones. Find <strong>the</strong> equilibrium points <strong>of</strong> this model.dSdtdIdtdRdt= −aSI (7.7)= aSI − bI (7.8)= bI (7.9)7.2 Phase Space VisualizationA phase space <strong>of</strong> a continuous-time model, once time is discretized, can be visualizedin <strong>the</strong> exact same way as it was in Chapter 5, using Codes 5.1 or 5.2. This is perfectlyfine. In <strong>the</strong> meantime, Python’s matplotlib has a specialized function called streamplot,which is precisely designed for drawing phase spaces <strong>of</strong> continuous-time models. It worksonly for two-dimensional phase space visualizations, but its output is quite neat <strong>and</strong> sophisticated.Here is how you can use this function:Code 7.1: phasespace-drawing-streamplot.pyfrom pylab import *xvalues, yvalues = meshgrid(arange(0, 3, 0.1), arange(0, 3, 0.1))xdot = xvalues - xvalues * yvaluesydot = - yvalues + xvalues * yvalues

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

Saved successfully!

Ooh no, something went wrong!