[SciPy-user] using odeint

LOPEZ GARCIA DE LOMANA, ADRIAN alopez at imim.es
Sun Sep 18 03:07:24 CDT 2005


Hi people, 

I'm using odeint from SciPy to solve a a system of ordinary differential equations. I've found a quite a strange error while taking different parameters on the equations:

0.0
0.0
0.0
0.0
0.0
Traceback (most recent call last):
  File "/home/alopez/tmp/news/output/scratch/modelF.integ.py", line 23, in func
    xdot[7] =  + (v_NACT * x[5]**m_NACT) / (x[5]**m_NACT + k_NACT**m_NACT) - k_deg_h * x[7]
ValueError: negative number cannot be raised to a fractional power
odepack.error: Error occured while calling the Python function named func
0.0
Traceback (most recent call last):
  File "/home/alopez/tmp/news/output/scratch/modelF.integ.py", line 23, in func
    xdot[7] =  + (v_NACT * x[5]**m_NACT) / (x[5]**m_NACT + k_NACT**m_NACT) - k_deg_h * x[7]
ValueError: negative number cannot be raised to a fractional power
odepack.error: Error occured while calling the Python function named func
5.03700957163e-99
Traceback (most recent call last):
  File "/home/alopez/tmp/news/output/scratch/modelF.integ.py", line 23, in func
    xdot[7] =  + (v_NACT * x[5]**m_NACT) / (x[5]**m_NACT + k_NACT**m_NACT) - k_deg_h * x[7]
ValueError: negative number cannot be raised to a fractional power
odepack.error: Error occured while calling the Python function named func
7.37964481865e-99
Traceback (most recent call last):

those numbers in between the error messages are prints of x[5]. Why is telling me about negative numbers? It's not, actually, close to zero, but positive.

k_NACT is also positive. k_NACT = 2.994997603

Some ideas?

Thanks for your time, 

Adrián.



More information about the SciPy-user mailing list