Solving complex first-order ODEs in Octave/Matlab by separating real and imaginary parts

  • Topic: MATLAB 
  • Thread starter alan_liu
  • Start date
  • Tags Tags
    Complex Odes
1 reply · 3K views · last reply
alan_liu
Messages
1
Reaction score
0
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.
 
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.