First time here? Check out the FAQ!

Ask Your Question
2

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

asked 11 years ago

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

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 11 years ago

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.

Preview: (hide)
link

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 ( 11 years ago )
1

answered 11 years ago

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

Preview: (hide)
link

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: 11 years ago

Seen: 2,154 times

Last updated: Dec 19 '13