[SciPy-user] (no subject)
Adrián López
alopez at imim.es
Thu Feb 23 13:55:03 EST 2006
Hi people,
I use SciPy since a few months ago. I use it mainly to integrate a
system of ODEs. Until now this piece of code was running nicely with
the previous version of SciPy:
from Numeric import *
from scipy.integrate import odeint
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, 100.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('repressilator.veloc.out', 'w')
args = (parameters, g)
x = odeint(func, x_0, t, args)
But now, with the new version, it is giving me the ugly error of
[alopez at thymus tmp]$ python file.py
Segmentation fault
on a linux machine and
Macintosh-3:~/work/tmp adrianlopez$ python test.py
Bus error
on a mac.
There is something wrong on my code? Is there some problem on odeint
from scipy.integrate? Could be any trouble calling also Numeric?
I will appreciate any comment,
Thanks for your help,
--
Adrián López García de Lomana, Graduate Student
Computational Biochemistry and Biophysics Lab
Research Group on Biomedical Informatics (GRIB) - IMIM / UPF
c/ Dr. Aiguader, 80; 08003 Barcelona (Spain)
http://diana.imim.es
More information about the SciPy-User
mailing list