修訂 | b7bae9fe5845e6defa8f821cc0b3993a4cecd435 (tree) |
---|---|
時間 | 2007-03-21 06:08:08 |
作者 | iselllo |
Commiter | iselllo |
I modified the code Python-codes/ode3_solver_test.py.
The modifications are trivial (different BC's and no need to define
first x and then say x=t; so I just use t now).
@@ -10,20 +10,20 @@ | ||
10 | 10 | |
11 | 11 | k=10. |
12 | 12 | y0_0=1. |
13 | -y1_0=1. | |
13 | +y1_0=0. | |
14 | 14 | |
15 | 15 | y0 = [y0_0, y1_0] |
16 | 16 | |
17 | -x = arange(0,4.0, 0.01) | |
17 | +t = arange(0,4.0, 0.01) | |
18 | 18 | |
19 | -t=x | |
20 | -y = integrate.odeint(func, y0, t) | |
19 | + | |
20 | +y = integrate.odeint(func, y0, t,printmessg=1) | |
21 | 21 | |
22 | 22 | |
23 | 23 | print 'the shape of the Lorenz solution is', shape(y) |
24 | 24 | |
25 | 25 | |
26 | -pylab.plot(x,y[:,1]) | |
26 | +pylab.plot(t,y[:,1]) | |
27 | 27 | pylab.xlabel('Time') |
28 | 28 | pylab.ylabel('y(t)') |
29 | 29 | pylab.title('solution') |