3

I have a differential equation

$\frac{dx}{dt} = \sqrt{1+x^4}$

$x$ is a complex variable.

I want to solve it for some given initial condition, and plot the solution (real part vs. imaginary part).

I've tried this

sol = NDSolve[{x'[t] == Sqrt[1 + x[t]^4], x[0] == 1 + I}, x[t], {t, 0, 20}, Method -> "ExplicitMidpoint", "StartingStepSize" -> 1/1000];
ParametricPlot[Evaluate[{Re[x[t]], Im[x[t]]} /.sol], {t, 0, 20}]

But the result is not what I was expecting, it should be something similar to this

enter image description here

But if I use the direction fields:

With[{xMin = 3}, StreamPlot[{Re[#], Im[#]} &[Sqrt[1 + (x + I y)^4]], {x, -xMin, xMin}, {y, -xMin, xMin}]]

The result somehow resembles what I want:

enter image description here

How can I obtain the correct plot just by solving the differential equation?

  • Plot3D[Re[Sqrt[1 + (re + im*I)^4]], {re, 0, 2}, {im, 0, 2}] and Plot3D[Im[Sqrt[1 + (re + im*I)^4]], {re, 0, 2}, {im, 0, 2}] show a branch cut that is probably giving NDSolve fits. Sorry, I don't have a fix though! – Chris K Jan 10 '19 at 19:05
  • What's the source of your expected plot? – Chris K Jan 10 '19 at 19:20
  • @ Chris K Thanks for your comment. It's a part of my university homework. – Call me a tomato. Jan 10 '19 at 19:28
  • Mathematica can solve this exactly by separating the variables and integrating, which will give same curve as Michael E2's, but I don't understand what parameter you are varying to get your other expected curves. – Bill Watts Jan 11 '19 at 01:13

1 Answers1

4

This, which is substantially the same as the OP's, looks correct as far as it goes:

sol = NDSolve[{x'[t] == Sqrt[1 + x[t]^4], x[0] == 1 + I}, 
   x, {t, -3, 3}, Method -> "ExplicitMidpoint", "StartingStepSize" -> 1/1000];
ParametricPlot[Evaluate[{Re[x[t]], Im[x[t]]} /. sol], 
 Evaluate@Flatten@{t, x["Domain"] /. sol[[1]]}, AspectRatio -> 0.6]

enter image description here

You can see from the StreamPlot that the stream lines reverse direction where the plot of sol stops. That is why the integration stops.

A workaround is to raise the order by differentiating the rationalized ODE:

sol = NDSolve[{D[x'[t]^2 == 1 + x[t]^4, t], x[0] == 1 + I, 
    x'[0] == Sqrt[1 + x[0]^4]}, x, {t, -3, 3}, 
   Method -> "ExplicitMidpoint", "StartingStepSize" -> 1/1000];
ParametricPlot[Evaluate[{Re[x[t]], Im[x[t]]} /. sol], 
 Evaluate@Flatten@{t, x["Domain"] /. sol[[1]]}, AspectRatio -> 0.6]

enter image description here

Michael E2
  • 235,386
  • 17
  • 334
  • 747