This stuff always trips me up. I'm trying to plot a function and I think that the plot looks good in one region and isn't really what I'm expecting in another:
The right side of the plot is what I am expecting but the lines cut off on the left side. What is the way to ensure that the correct branch of the square root is taken to ensure the lines do not get cut off? Or is there a different mistake I am making?
Block[{f, \[Lambda], l},
l = 2;
\[Lambda] = 2.0;
f[z_] := (1 + \[Lambda])/(2 z) (z + 1) (z + 1 +
Sqrt[z^2 + 1 - 2 z (1 - \[Lambda])/(1 + \[Lambda])]) - 1;
{ComplexContourPlot[ReIm[z], {z, -l - l I, l + l I}, PlotLabel -> z,
Contours -> 20],
Show[ComplexContourPlot[ReIm[f[z]], {z, -l - l I, l + l I},
PlotLabel -> f[z], Contours -> 20],
Graphics[Circle[]]],
Show[ComplexPlot[f[z], {z, -l - l I, l + l I}, PlotLabel -> f[z]],
Graphics[Circle[]]]}
]
Reduce[FunctionSingularities[f[z], z, Complexes], z]
shows you have branch discontinuities along two rays (and a pole). If a point continuously moving in the domain goes around one of the two branch pointsz^2 + 1 - 2 z (1 - \[Lambda])/(1 + \[Lambda]) == 0
, the function value changes discontinuously. To get the function value to change continuously, you have to change the sign on theSqrt[]
. But as the point goes around again or goes around the other point, you have to change the sign again. There is no way to choose the sign to get rid of the discontinuity if you show just one branch. $\endgroup$Contours -> {Union[Range[-10, 11], Range[-1, 1, 1/16]]}
. It does not fix your problem. $\endgroup$