• R/O
  • SSH

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修訂4f04f941fd6963a4874023ca5925fc8d5292b6b0 (tree)
時間2007-03-23 00:27:38
作者iselllo
Commiteriselllo

Log Message

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.

Change Summary

差異

diff -r b7bae9fe5845 -r 4f04f941fd69 Python-codes/ode4_solver_test.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Python-codes/ode4_solver_test.py Thu Mar 22 15:27:38 2007 +0000
@@ -0,0 +1,36 @@
1+#! /usr/bin/env python
2+from scipy import *
3+import pylab # used to read the .csv file
4+
5+
6+from scipy.special import * # to be able to use the error function
7+
8+def func(y, t):
9+ return y+3.*t
10+
11+
12+y0 = 1.
13+
14+t = arange(0,4.0, 0.01)
15+
16+
17+y = integrate.odeint(func, y0, t,printmessg=1)
18+
19+
20+print 'the shape of the solution is', shape(y)
21+
22+
23+pylab.plot(t,y[:,0])
24+pylab.xlabel('Time')
25+pylab.ylabel('y(t)')
26+pylab.title('solution')
27+pylab.grid(True)
28+pylab.savefig('solution_1st_order_ODE')
29+
30+pylab.hold(False)
31+
32+
33+
34+
35+
36+print 'So far so good'
\ No newline at end of file