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

  • Thread starter Thread starter alan_liu
  • Start date Start date
  • Tags Tags
    Complex Odes
Click For Summary
To solve complex first-order ODEs in Octave/Matlab, it is essential to separate the equations into their real and imaginary components, as the software only handles real ODEs using the "isode" function. This involves defining new variables for the real and imaginary parts of each complex variable. For two complex variables, the transformation results in a system of four real ODEs. By substituting these new variables into the original equations, one can effectively manage the complexity of the problem. This method allows for the application of standard ODE solving techniques in a real-valued context.
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.
 
Physics news on Phys.org
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.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K