• R/O
  • SSH

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

File Info

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
examples about how to use the Python integrate.odeint to solve this time
for a 1st order ODE. As shown in Python-codes/ode3_solver_test.py,
higher order ODE's are solved as a system of 1st order ODE's.

Content

#! /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'