MATLAB How to solve complex 1st order ODEs in octave/Matlab

1. Apr 30, 2014

alan_liu

I am stuck with the issue quite sometimes already.
The question is to solve a 2 complex 1st order complex ODEs.
The hints that given by the professor is to separate the ODEs into the real and imaginary part as ocatve/matlab only capable of handling real ODEs with “ isode “ function.

So how to decompose a complex ODEs into real and imaginary part? For instance, a real complex ODEs can be decomposed into 2 functions, 1 with all the real part, and other one with all the imaginary part.
Please do let me know if i am not stated the problems clearly as well.

Any hints and reference materials will be truly appreciated.

2. May 2, 2014

Staff: Mentor

Hi Alan, welcome to PF!

If you have two complex ODEs for variables $y_1$ and $y_2$, define a new system of variables
\begin{align} u_1 &= \Re (y_1) \\ u_2 &= \Im (y_1) \\ u_3 &= \Re (y_2) \\ u_4 &= \Im (y_2) \end{align}
substitute the $u$'s for the $y$'s in your ODEs, and this should give you a system of 4 ODEs for the $u$'s.