import numpy as np import pylab as pl import scipy.integrate as integrate def derivs(state,t): x,y = state deltax = (y + x - (x**3 / 3)) * (1 / a) deltay = - (a * x) return deltax, deltay a = 0.1 x0 = .5 y0 = .5 t = np.arange(0.0, 100, 0.1) z0 = [x0, y0] z = integrate.odeint(derivs, z0, t) x = z[:, 0] y = z[:, 1] w = np.arange(-3, 3, .01) y1 = (-w + w**3 / 3) pl.plot(x, y) pl.plot(w, y1) pl.text(1.0, 1.1, 'fast') pl.text(1.6, -.5, 'slow', rotation = 35) pl.show()