[SciPy-user] (no subject)

Adrián López alopez at imim.es
Fri Feb 24 06:20:37 EST 2006


Very strange ... If I change just that single line as you said, it  
runs correctly !!! THANKS!!! How did you know the problem was on that  
line?

And also, another interesting thing, that maybe is easier to explain.  
The code I posted, with the line corrected as you suggested gives me  
this output

[alopez at thymus tmp]$ tail new/repressilator.out
99.91   0.0     106.561968929   12.8532193268   0.657464014072   
120.022734481   10.2873375884     0.690593561295
99.92   0.0     107.232334762   12.7255621105   0.659198461945   
120.585673723   10.1851132999     0.695453697878
99.93   0.0     107.897250845   12.5991702799   0.661090230937   
121.140028167   10.0839043882     0.7005127881
99.94   0.0     108.556560119   12.4740313944   0.66314142979    
121.685624094   9.98370079793     0.705774044541
99.95   0.0     109.210104618   12.3501331324   0.665354223171   
122.222286288   9.88449257258     0.711240755997
99.96   0.0     109.857725438   12.2274632897   0.667730832672   
122.749838018   9.78626985374     0.716916288878
99.97   0.0     110.499262751   12.1060097788   0.670273537691   
123.268101064   9.6890228799      0.722804088444
99.98   0.0     111.134555765   11.985760628    0.672984676503   
123.776895697   9.59274198564     0.728907680303
99.99   0.0     111.763442835   11.8667039806   0.67586664717    
124.276040954   9.49741760048     0.735230671778
100.0   0.0     112.385761359   11.7488280938   0.678921908743   
124.76535447    9.40304024813     0.741776753543

and the same code using Numeric instead of numpy, an extra line:

[alopez at thymus tmp]$ tail old/repressilator.out
99.92   0.0     107.232334762   12.7255621105   0.659198461945   
120.585673723   10.1851132999     0.695453697878
99.93   0.0     107.897250845   12.5991702799   0.661090230937   
121.140028167   10.0839043882     0.7005127881
99.94   0.0     108.556560119   12.4740313944   0.66314142979    
121.685624094   9.98370079793     0.705774044541
99.95   0.0     109.210104618   12.3501331324   0.665354223171   
122.222286288   9.88449257258     0.711240755997
99.96   0.0     109.857725438   12.2274632897   0.667730832672   
122.749838018   9.78626985374     0.716916288878
99.97   0.0     110.499262751   12.1060097788   0.670273537691   
123.268101064   9.6890228799      0.722804088444
99.98   0.0     111.134555765   11.985760628    0.672984676503   
123.776895697   9.59274198564     0.728907680303
99.99   0.0     111.763442835   11.8667039806   0.67586664717    
124.276040954   9.49741760048     0.735230671778
100.0   0.0     112.385761359   11.7488280938   0.678921908743   
124.76535447    9.40304024813     0.741776753543
100.01  0.0     113.001347666   11.6321213375   0.682152982467   
125.244652321   9.30960054565     0.74854970128

Why?

Finally I've tried the tool you pointed me. I run it importing numpy  
and with *the* line changed as you said. The output is here:

[alopez at thymus new]$ gdb
GNU gdb Red Hat Linux (6.0post-0.20040223.19rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
details.
This GDB was configured as "i386-redhat-linux-gnu".
(gdb) file /home/alopez/software/bin/python
Reading symbols from /home/alopez/software/bin/python...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) run
Starting program: /home/alopez/software/bin/python
[Thread debugging using libthread_db enabled]
[New Thread -1208276480 (LWP 8532)]
Python 2.4.2 (#1, Feb 22 2006, 17:29:56)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> execfile('file.py')
message 1
message2
 >>>

seems correct, doesn't it?

Thanks again and I'll report strange behavior as these ones if I  
experience them,


--

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


On Feb 24, 2006, at 10:51 AM, Travis Oliphant wrote:

> 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
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20060224/7df0e74a/attachment.html>


More information about the SciPy-User mailing list