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.

13.3. VISUALIZING TWO-DIMENSIONAL SCALAR AND VECTOR FIELDS 239from pylab import *xvalues, yvalues = meshgrid(arange(-5, 5.5, 0.05), arange(-5, 5.5, 0.05))zvalues = sin(sqrt(xvalues**2 + yvalues**2))imshow(zvalues)show()The result is shown in Fig. 13.8. Colorful!0501001502000 50 100 150 200Figure 13.8: Scalar field visualized as a color image using Code 13.3.Finally, a two-dimensional vec<strong>to</strong>r field can be visualized using <strong>the</strong> streamplot functionthat we used in Section 7.2. Here is an example <strong>of</strong> <strong>the</strong> visualization <strong>of</strong> a vec<strong>to</strong>r fieldv = (v x , v y ) = (2x, y − x), with <strong>the</strong> result shown in Fig. 13.9:Code 13.4: plot-vec<strong>to</strong>r-field.pyfrom pylab import *

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

Saved successfully!

Ooh no, something went wrong!