[SciPy-user] (no subject)

Travis Oliphant oliphant.travis at ieee.org
Fri Feb 24 03:51:07 CST 2006


Adrián López wrote:

>from numpy 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
>
>         xdot[1] = - (x[1] * beta) + x[4] * beta
>
>         xdot[2] = - (x[2] * beta) + x[5] * beta
>
>         xdot[3] = + x[6] * beta - (x[3] * beta)
>  
>
Try changing this line to

x[6] * beta - x[3] * beta

I was getting a strange error from it that has me perplexed.   Perhaps 
an un-handled exception is causing the segfault.

It's hard to say.

If you have gdb installed you can really help out by running under gdb 
so that when it segfaults we find out where...

Here's how...

gdb
file /usr/bin/python   (or whever Python is installed).
run
execfile('file.py')


-Travis



More information about the SciPy-user mailing list