Ask Your Question
2

solve complex ODE (like f'(x) = I*f(x)) numerically

asked 2013-09-27 15:59:49 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi!

i want so solve several complex valued (non-linear) ode's. I tried desolve_rk4. I got the error "Expecting a number when the initial state is replaced in the equations, but instead found: 0.5%i" in my equations, but also in the more simple one in the title. I can solve the equation f'(x) = If(x) symbolically, of course, but the equations i am interested in i want to solve numerically. So my question is (and i did not find an answer by reading the documentation or the google-results): Is it me how cannot pose the problem in a way that sage can solve it, or is it sage that cannot solve the problem.

Thank you for helping,

Max

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-09-27 18:29:07 +0100

tmonteil gravatar image

I can reproduce the error you got.

According to this question, it seems that the best solution is to transform your complex functions into 2 real functions.

edit flag offensive delete link more

Comments

Thank you very much for your answer. The link you posted shows me how it should be possible to solve my problem. When/if i solve it i will post my solution here.

max gravatar imagemax ( 2013-09-28 17:04:20 +0100 )edit
1

answered 2013-12-19 04:11:32 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

python's scipy.integrate.ode handles solution of variable coefficient complex valued ODE systems by means of the zvode fortran routine. see http://docs.scipy.org/doc/scipy/refer.... you can easily integrate your sage function in python

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-09-27 15:59:49 +0100

Seen: 2,132 times

Last updated: Dec 19 '13