[SciPy-user] Using odeint to solve complex-valued ode's

David L. Goldsmith David.L.Goldsmith at noaa.gov
Fri Nov 17 15:44:55 CST 2006

OK, I tried odeint(f, y0, t) where f is a complex-valued function of y 
and y' and was told:

TypeError: a float is required in line 120 of odeint

so I tried:

odeint(real(f), real(y0), t)

and was told:

odepack.error: The function and its Jacobian must be callable in line 
120 of odeint.

I also tried a few other ways I could think of, all failed.  So it would 
appear that I must convert my complex-valued f into a real vector-valued 
function before passing it to odeint - if this is incorrect, please 
supply an example of how to construct things so that odeint will take a 
complex-valued f.  Thanks!


More information about the SciPy-user mailing list