Numerically solve complex differential equation

1.8k Views Asked by At

I'd like to find a numerical solution to a complex differential equation of the form $ \frac{dz(t)}{dt} = f(z,t)$, where $z$ and $t$ can both be complex, with $z(0)=0$. Specifically, I'd like to determine values of $z$ for some mesh of values of $(t_r,t_c)$, where $t = t_r + t_c i$, so that I can potentially interpolate later to find $z(t)$ at any complex $t$.

One approach would be to numerically solve the ODE for real $t$, find a smooth approximation to the solution (e.g. a polynomial), and then analytically continue the smooth function into the complex plane. I'm worried about the accuracy of this approach, because I don't know if the smooth function being an accurate approximation on the real axis guarantees its accuracy in other parts of the complex plane. I could also consider solving the ODE for imaginary $t$, or along any particular curve through the plane, and then analytically continue it similarly - which would at least provide consistency tests.

But perhaps I should be thinking of it as a PDE rather than an ODE - I can write $\frac{\partial z}{\partial t_r} = -i \frac{\partial z}{\partial t_c} = f(z,t_r,t_c)$, but then it looks like I've got too many constraints for a usual PDE solver...

Is there a more natural way to solve these types of equations numerically?

3

There are 3 best solutions below

3
On

Any n dimensional ODE system in $\mathbb{C}$ can be described as an 2n dimensional ODE system in $\mathbb{R}$. $z(t)=\operatorname{Re}(z) +i\operatorname{Im}(z)$ and $t=\operatorname{Re}(t) +i\operatorname{Im}(t)$

thus

$\frac{d\operatorname{Re}(z(t))}{d\operatorname{Re}(t)}=\operatorname{Re}(f(z,t))$

$\frac{d\operatorname{Im}(z(t))}{d\operatorname{Im}(t)}=\operatorname{Im}(f(z,t))$

The inital condition $z(0)=0$ results in $\operatorname{Re}(z(0))=0$ and $\operatorname{Im}(z(0))=0$.

Now you have two ODE and two initial conditions, you can solve this with Runge–Kutta methods.

Afterwards you can reconstruct $z(t)=\operatorname{Re}(z(t))+ i\operatorname{Im}(z(t))$.

0
On

This is more of an opinion than a mathematical solution. In my experience, I have never gone wrong when treating complex numbers exactly like real numbers. What I'm saying is that I would solve the problem exactly as you pose it. Of course, in order to do that you must have a programming language that treats complex variables seamlessly, such as Matlab.

1
On

given $df/dz=f(z,t)$ you can simply construct coupled ODE such that by parametrizing $t$ using $x$ as $$ t (\in \mathbb{C} ) = \begin{cases} \mathrm{Re}\{ t\} = t_r = p(x) \\ \mathrm{Im}\{t\} = t_i = q(x) \end{cases} $$ where $x \in \mathbb{R}$. use the rules of PDE, you can write $$ \frac{\partial f}{\partial t_r}\frac{d t_r}{d x} + \frac{\partial f}{\partial t_i}\frac{d t_i}{d x} = f(t) $$ you can now use Cauchy-Riemann relation to get rid of one of the partial derivatives to get a sensible ODE.

Or even, if you are going vertical or horizontal in a complex plane, then I think you can get rid of $t_i/dx$ by setting $x = t_r$ and $t_i = \mathrm{Const}$ (and vice versa).

If that's done, just use commercial ODE solver.