Révision | 4f04f941fd6963a4874023ca5925fc8d5292b6b0 |
---|---|
Taille | 512 octets |
l'heure | 2007-03-23 00:27:38 |
Auteur | iselllo |
Message de Log | I added the code Python-codes/ode4_solver_test.py. It is a very easy
|
#! /usr/bin/env python
from scipy import *
import pylab # used to read the .csv file
from scipy.special import * # to be able to use the error function
def func(y, t):
return y+3.*t
y0 = 1.
t = arange(0,4.0, 0.01)
y = integrate.odeint(func, y0, t,printmessg=1)
print 'the shape of the solution is', shape(y)
pylab.plot(t,y[:,0])
pylab.xlabel('Time')
pylab.ylabel('y(t)')
pylab.title('solution')
pylab.grid(True)
pylab.savefig('solution_1st_order_ODE')
pylab.hold(False)
print 'So far so good'