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.

238 CHAPTER 13. CONTINUOUS FIELD MODELS I: MODELINGAnd here is how <strong>to</strong> draw a con<strong>to</strong>ur plot <strong>of</strong> <strong>the</strong> same scalar field:Code 13.2: plot-con<strong>to</strong>ur.pyfrom pylab import *xvalues, yvalues = meshgrid(arange(-5, 5.5, 0.05), arange(-5, 5.5, 0.05))zvalues = sin(sqrt(xvalues**2 + yvalues**2))cp = con<strong>to</strong>ur(xvalues, yvalues, zvalues)clabel(cp)show()The clabel comm<strong>and</strong> is used here <strong>to</strong> add labels <strong>to</strong> <strong>the</strong> con<strong>to</strong>urs. The result is shown inFig. 13.7.40.2500.000-0.250-0.5000.000-0.5000.5000.2502-0.7500.250-0.250-0.25000.5000.7502-0.5004-0.2500.000-0.7500.0000.5000.750-0.500-0.7504 2 0 2 4-0.2500.000-0.5000.250Figure 13.7: Scalar field visualized as a con<strong>to</strong>ur plot using Code 13.2.If you want more color, you can use imshow, which we already used for CA:Code 13.3: plot-imshow.py

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

Saved successfully!

Ooh no, something went wrong!