1
$\begingroup$

I am trying to understand a certain function on the complex plane, and in particular the contours of steepest descent associated to the saddles of such function. Using ContourPlot I can easily draw the path of steepest descent and ascent. Is there a way to tell Mathematica to only draw in ContourPlot the path of steepest descent?

Below you can see a working example:

f[z_] := z^3 + 2 z + 4
sa = z /. Solve[f'[z] == 0, z];
Show[ContourPlot[Re[f[x + I y]], {x, -3, 3}, {y, -3, 3}, 
  Contours -> {0}, PlotRange -> All], 
 ContourPlot[Im[f[x + I y]] == Im[f[sa[[1]]]], {x, -3, 3}, {y, -3, 3},
   Contours -> {0}, PlotRange -> All], 
 ListPlot[Transpose[{Re[sa], Im[sa]}], 
  PlotStyle -> {PointSize[Large], Red}]]
Clear[f, sa]

Only one of the paths shown is of steepest descent, and I would like M to just keep that particular case.

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ A concrete example (i.e. code) might be helpful in illustrating your problem. $\endgroup$
    – J. M.'s torpor
    Feb 13 at 23:00
  • 1
    $\begingroup$ Thanks for the hint! I added some simple code that illustrates my problem. $\endgroup$
    – user12588
    Feb 13 at 23:08
  • $\begingroup$ I'm working on four hours sleep. But I'm curious. Steepest descent from where? Surely you need to specify a starting point? Could this starting point be the highest point on your surface (in the region $x\in[-3,3], y\in[-3,3]$ )? $\endgroup$ Feb 14 at 9:45
  • 1
    $\begingroup$ Would this be along the lines you have in mind (if it could be cleaned up a bit)?: StreamPlot[ -D[ReIm[f[x + I*y]] // ComplexExpand, {{x, y}}] // Evaluate, {x, -3, 3}, {y, -3, 3}] $\endgroup$
    – Michael E2
    Feb 14 at 18:41
1
$\begingroup$

Try something along these lines:

f[z_] := z^3 + 2 z + 4;
sa = z /. Solve[f'[z] == 0, z];
g[x_, y_] := 
  If[y < 1 && Re[f[x + I y]] <= Re[f[sa[[1]]]], 
   Im[f[x + I y]] - Im[f[sa[[1]]]], 1];
Show[ContourPlot[Re[f[x + I y]], {x, -3, 3}, {y, -3, 3}, 
  Contours -> {0}, PlotRange -> All], 
 ContourPlot[g[x, y] == 0, {x, -3, 3}, {y, -3, 3}, Contours -> {0}, 
  PlotRange -> All], 
 ListPlot[Transpose[{Re[sa], Im[sa]}], 
  PlotStyle -> {PointSize[Large], Red}]]

The hard-coded condition y < 1 is not nice, but you can omit it if your purpose is to visually find the contour going through the saddle point.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.