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.

9.4. CHAOS IN CONTINUOUS-TIME MODELS 163t = 0.timesteps = [t]def observe():global x, xresult, y, yresult, z, zresult, t, timestepsxresult.append(x)yresult.append(y)zresult.append(z)timesteps.append(t)def update():global x, xresult, y, yresult, z, zresult, t, timestepsnextx = x + (s * (y - x)) * Dtnexty = y + (r * x - y - x * z) * Dtnextz = z + (x * y - b * z) * Dtx, y, z = nextx, nexty, nextzt = t + Dtinitialize()while t < 30.:update()observe()subplot(3, 1, 1)plot(timesteps, xresult)xlabel(’t’)ylabel(’x’)subplot(3, 1, 2)plot(timesteps, yresult)xlabel(’t’)ylabel(’y’)subplot(3, 1, 3)plot(timesteps, zresult)xlabel(’t’)ylabel(’z’)

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

Saved successfully!

Ooh no, something went wrong!