Populating the interactive namespace from numpy and matplotlib
In [8]:
yo=200ti=0tf=3t=np.arange(ti,tf,0.01)deff(y,t,g=-9.8):"""this is the rhs of the ODE to integrate, i.e. dy/dt=f(y,t)"""returng*ty0=200# initial valuea=0# integration limits for tb=3t=np.arange(a,b,0.01)# values of t for# which we require# the solution y(t)y=odeint(f,y0,t)# actual computation of y(t)importpylab# plotting of resultspylab.plot(t,y)pylab.xlabel('$t$',size=15);pylab.ylabel('$y(t)$',size=15)