Ask Your Question

Hurin's profile - activity

2017-12-01 05:59:22 +0200 received badge  Famous Question (source)
2015-02-24 10:38:44 +0200 received badge  Notable Question (source)
2013-12-20 05:46:15 +0200 received badge  Popular Question (source)
2012-02-13 14:51:02 +0200 commented question ode_solver : unable to convert to float

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 :(

2012-02-13 14:11:59 +0200 commented answer ode_solver : unable to convert to float

Thank you for your answer, I had a feeling something like that will be the case :) Can you advise me with the best way to do that conversion? Do I have to do it "by hand" (separating each function f = fRe + fIm, and each value like y0 = y0Re + y0Im) , or is there some routine that can do it?

2012-02-13 06:58:01 +0200 asked a question 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!