ode_solver : unable to convert to float
I am trying to solve a system of 38 first-order differential equations using ode_solver()
. Among many problems, I have a problem with complex numbers. The functions in question are complex functions (equations include conjugate(function)), and initial contitions are also complex numbers.
The error I get is following:
TypeError: Unable to convert 0.0353553390593274 - 0.0353553390593274*I
to float; use abs() or real_part() as desired
0.0353553390593274 - 0.0353553390593274*I
is the value of one of the inital conditions. I am rather new to sage
, so I wonder if ode_solver()
can deal with complex functions and complex numbers as such?
Thank you!
If you have a specific example, that would be really helpful. If it's quite long, use http://pastebin.com or something to link to.
It's REALY long, and it contains lots of abbreviations and definitions within definitions... I doubt it would be very useful. I can describe the system: I have 39 functions (y[0], ..., y[38]) and 39 dependent first-order diferential equations. Functions are defined in the complex ring, the inital values are complex numbers, etc. RHS of equations are complicated combinations of y's. So i write them all down, define range and initial conditions and that's it. In Mathematica I did it with NDSolve, there were absolutly no problems (I have just typed the equations) and the whole job is done in about 2 seconds. Now I am trying to do the same job with Sage. But it turns out it's not that simple :(
Can you maybe post a much smaller test case that illustrates the problem?