• R/O
  • SSH

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修訂321b69036a418c0a078602292c90f1d0be823d17 (tree)
時間2007-03-21 05:54:23
作者iselllo
Commiteriselllo

Log Message

I added the code Python-codes/ode2_solver_test.py, which is taken from
the numpy tutorial. This code basically performs the integration of the
Airy equation. It is taken from the scipy tutorial, but I am using
different boundary conditions wrt the example.

Change Summary

差異

diff -r 2957f3555ae8 -r 321b69036a41 Python-codes/ode2_solver_test.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Python-codes/ode2_solver_test.py Tue Mar 20 20:54:23 2007 +0000
@@ -0,0 +1,38 @@
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 [t*y[1],y[0]]
10+
11+y0_0=1.
12+y1_0=1.
13+
14+y0 = [y0_0, y1_0]
15+
16+x = arange(0,4.0, 0.01)
17+
18+t=x
19+y = integrate.odeint(func, y0, t)
20+
21+
22+print 'the shape of the Lorenz solution is', shape(y)
23+
24+
25+pylab.plot(x,y[:,1])
26+pylab.xlabel('Time')
27+pylab.ylabel('y(t)')
28+pylab.title('solution')
29+pylab.grid(True)
30+pylab.savefig('airy_modified')
31+
32+pylab.hold(False)
33+
34+
35+
36+
37+
38+print 'So far so good'
\ No newline at end of file