I want to plot the amplitude of a complex-valued function of one complex variable. I want to do this in the plane defined by the real and imaginary parts of the complex variable as a ContourPlot
.
For example, a simple function
$f(z)=\frac{z}{e^{g}-z\,e^{-i\,k}}$
where
$z=\frac{y}{\sqrt{1-y^2+y^4}}\,e^{i\,v}$ is the complex variable, with $1\geq y\geq 0$ and $2\,\pi>v\geq 0$. $g$ and $k$ are some positive constants. I want a plot of $\lvert f(z)\rvert$ as a function of $Re\,(z)$ and $Im\,(z)$ and not as a function of $y$ and $v$.
The only way I know how to do this is using ParametricPlot3D
with a function where I explicitly put in the definition of z
and figure out its real and imaginary parts to put in as the first two arguments of ParametricPlot3D
, that is
fTest2[y_, v_] := (y/Sqrt[1 - y^2 + y^4] E^(I v))/(E^g - y/Sqrt[1 - y^2 + y^4] E^(I v) E^(-I k))
Block[{k = \[Pi]/3, g = 5/10},
ParametricPlot3D[{y/Sqrt[1 - y^2 + y^4] Cos[v],y/Sqrt[1 - y^2 + y^4] Sin[v], Abs[fTest2[y, v]]},
{y, 0, 1}, {v, 0,2 \[Pi]}, PlotRange -> All]]
It should be possible to present this as a contour plot, where the height (amplitude of the fucntion) is encoded in the colour of the contour plot. However, I do not know how to do this and would like to learn. The naive exercise of just plugging in the function into ContourPlot
leads to
Block[{k = \[Pi]/3, g = 5/10},
ContourPlot[Abs[fTest2[y, v]], {y, 0, 1}, {v, 0, 2 \[Pi] },
PlotRange -> All, PlotLegends -> Automatic]]
which as expected is a plot in terms of y
and v
and not the real and imaginary parts of z
.