[SciPy-user] scipy 0.3.2 versus scipy 0.4.8
GÓMEZ GARRIDO, ALEXANDRE
agomez at imim.es
Wed May 17 11:40:23 EDT 2006
Dear all,
I'm confused with the Scipy versions and its relationships with Numpy and Numeric. I have understood that the old Scipy (0.3.2 version) use Numeric and the new version (0.4.8) use Numpy.
But I have a difference of very great speed among them in a script which integrate a ode's system. I have made comparisions with the same script in the same PC. One time I ran using scipy 0.3.2 with Numeric and later I uninstalled scipy and numeric and installed scipy 0.4.8 and numpy 0.9.6 and I run again using the new versions. The first time I take 7 seconds and the other 40 seconds. My question is, Is the old scipy fast than the new scipy? or Do I have any installation problem? However, I have followed the webpages instructions during the installation.
My script is:
from scipy import *
def func(x, t, *args):
xdot = [0.0, 5.0, 0.0, 15.0, 0.0, 0.0, 0.0]
xdot[0] = + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0
xdot[1] = - (x[1] * beta) + x[4] * beta
xdot[2] = - (x[2] * beta) + x[5] * beta
xdot[3] = + x[6] * beta - (x[3] * beta)
xdot[4] = + alpha0 + (alpha + (x[3])**(n) * alpha1) / ((K)**(n) + (x[3])**(n)) - (k1 * x[4])
xdot[5] = + alpha0 + (alpha + (x[1])**(n) * alpha1) / ((K)**(n) + (x[1])**(n)) - (k1 * x[5])
xdot[6] = - (k1 * x[6]) + alpha0 + (alpha + (x[2])**(n) * alpha1) / ((K)**(n) + (x[2])**(n))
g.write('%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n'%(t, xdot[0], xdot[1], xdot[2], xdot[3], xdot[4], xdot[5], xdot[6]))
return xdot
t = arange(0, 12.01, 0.01)
alpha0 = 0.0
alpha1 = 0.0
K = 1.0
beta = 5.0
n = 2.1
k1 = 1.0
alpha = 250.0
cell = 1.0
parameters = [alpha0, alpha1, K, beta, n, k1, alpha, cell]
x_0 = [0.0, 5.0, 0.0, 15.0, 0.0, 0.0, 0.0]
g = open('veloc.out', 'w')
args = (parameters,g)
for i in range(100):
x = integrate.odeint(func, x_0, t, args)
Many thanks!
Àlex Gómez Garrido
More information about the SciPy-User
mailing list