# # File: vanderpol_plotpos.auto # from pylab import * from matplotlib.font_manager import FontProperties data = sl('vanderpola_bif') figure(1,figsize=(6,4)) xlabel('x') ylabel('y') grid(True) hold(True) title('van der Pol Canards') lw = 1.5 # # A selection of periodic orbits from the vanderpola_bif data set. # indices = [4, 5, 10,12, 14, 16, len(data)-1] n = len(indices) b = 0 # Plot the solutions. for index in indices: x = [data[index]['data'][k]['u'][0] for k in range(len(data[index]['data']))] y = [data[index]['data'][k]['u'][1] for k in range(len(data[index]['data']))] plot(x,y,color=[0.6*b,1-b,b],linewidth=lw) b = b + 1.0/n # # Plot the cubic y = x^3/x-x # x = linspace(-2.25,2.25,100) y = x**3/3.0-x plot(x,y,color=[.5,.5,.5],linestyle='--') axis([-2.25,2.25,-1.0,1.0]) savefig('vanderpola_canards.png',dpi=72) # show()