4
$\begingroup$

I like to see the branch cut of the function:

$$1 - z \ln[(1+z)/z].$$

If I plot it in the complex plane:

Plot3D[Re[1 - (x + I y) Log[(1 + x + I y)/(x + I y)]], {x, -2, 
2}, {y, -2, 2}]

The result is:

enter image description here

which shows the brach cut correctly between -1 and 0. How can I get rid of the hole in the picture and have a smooth line as a branch cut rather than a white line discontinuity?

Also the same for contour plot:

With[{z = x + I y}, 
ContourPlot[Re[1 - z Log[(1 + z)/(z)]], {x, -2, 2}, {y, -2, 2}, 
Contours -> 40]]

enter image description here

$\endgroup$
  • 1
    $\begingroup$ Add the plot option: PlotRange -> All $\endgroup$ – Fraccalo Aug 18 at 10:43
  • $\begingroup$ @Fraccalo Many thanks! Can we have a smooth line for the brach cut rather than "white line" discontinuity? $\endgroup$ – user67023 Aug 18 at 10:44
  • $\begingroup$ Not sure, but if you have an analytical formula of where the branch cut is, then it would be quite simple to plot it on top of the original 3d plot $\endgroup$ – Fraccalo Aug 18 at 10:51
  • 2
    $\begingroup$ You can use Exclusions -> None to get rid of the white line. $\endgroup$ – C. E. Aug 18 at 11:08
4
$\begingroup$

Change "Rainbow" with any ColorScheme you prefer, and the rescaling values {-2,1} to obtain different scaling.

With[{z = x + I y}, 
 ContourPlot[Re[1 - z Log[(1 + z)/(z)]], {x, -2, 2}, {y, -2, 2}, 
  Contours -> Range[-4, 2, .1], 
  ColorFunction -> (ColorData["Rainbow"][Rescale[#, {-2, 1}]] &),
  ColorFunctionScaling -> False, PlotRange -> All]]

enter image description here

$\endgroup$
2
$\begingroup$

Note that you can also use the new (as of Version 12) ComplexPlot function, too:

ComplexPlot[1 - z Log[(1 + z)/z], {z, -2 - 2 I, 2 + 2 I}, Mesh -> 10, 
   MeshFunctions -> {Re[#2] &, Im[#2] &}]

A complex plot.

Or the 3D version:

ComplexPlot3D[1 - z Log[(1 + z)/z], {z, -2 - 2 I, 2 + 2 I}, 
   Mesh -> 10, PlotRange -> All]

3D complex plot.

$\endgroup$

Your Answer

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