# TypeError: 'sage.rings.integer.Integer' object is not subscriptable

def undamped(x, t): return [x[1], x[0]-x[0]^3]

from scipy.integrate import odeint from scipy import linspace coordinates=0 nbpts = 1000 # number of points endtime = 20 # end of time span tspan = linspace(0.0, endtime, nbpts) ics1 = [0.09, 0.0] # first initial conditions sol1 = odeint(undamped, ics1, tspan)

solx1 = [(tspan[k], sol[m]) for k in range(nbpts)] xplot1 = list_plot(sol, axes_labels=['t','x'], size=1)

coordinates1 = [(s[0], s[1]) for s in sol1] phaseportrait1 = list_plot(coordinates,axes_labels=['x','y'], size=1)

a = graphics_array([xplot1, phaseportrait1]) a.show()