from scipy.integrate import odeint import numpy as N def f(y,t): """this is the rhs of the ODE to integrate, i.e. dy/dt=f(y,t)""" return -2*y*t #main program starts here y0= 1 a = 0 b = 2 t = N.arange(a,b,0.01) y = odeint( f, y0, t ) print "We have just integrated an ODE; scipy seems to work." ##Use the following lines to plot the result #import pylab #pylab.plot(t,y) #pylab.show()