I am trying to find out solutions for the ordinary differential equations in adiabatic approximations .These equations involves complex functions as variables . How can they be solve in mathematica numerically ?
The easiest way is to convert the complex system to a real system. Attached is an extract from a document I wrote recently, showing how to express a complex system of ordinary differential equations into a real system of ordinary differential equations. Since this was written for electrical engineers, j=sqrt(-1).
I agree wholeheartedly with Prof Wilson's reply to you. There are many linear stability problems in convective fluid mechanics which yield systems of ODEs with complex coefficients, and this idea works well for such problems in my experience. My suspicion is that there will be no difficulty (beyond trying to guess the unknown initial conditions, if the problem is a boundary value problem) even when the equations are nonlinear. For example, if we have z'=iz-z^3 where z=x+iy, then,
x' = -y - x^3 +3xy^2 y'=x -3x^2y+y^3.
On the other hand, if your coding language (such as Fortran90) allows for complex variables, and your system of ODEs is an initial value problem, then one may solve directly using complex arithmetic. Mathematica appears to support complex numbers: https://reference.wolfram.com/language/guide/ComplexNumbers.html but I don't know if an ODE solver in Mathematica can be coerced into using them!
Dear Anry, what you say is no doubt very very true these days.
In the context of ODE solutions with complex coefficients, one should be able to use complex arithmetic directly when it is an initial value problem. No difficulties with that at all. I have done it and it works nicely.
But when I obtain a system of complex ODEs which arise from linear stability theory, then one often gets at least two eigenvalues to find. One of these is the critical parameter (Rayleigh or Reynolds number, for example, a real quantity), while the other is the imaginary part of the complex growth rate where the real part has been set to zero - this term is proportional to the wavespeed of the unsteady onset pattern. It is in such contexts that the writing of the full complex system as a set of real equations becomes useful and is a tidy way to proceed.
The Newton-Raphson method also works nicely using complex arithmetic to find complex roots. I have not seen that fact in textbooks!