0

Consider for example the function \begin{align*} f: (-2 \pi, 2 \pi) \times (-2 \pi, 2 \pi) \to \mathbb{C}, (x,y) \mapsto x^2 e^{i y} \end{align*} Note that this is not actually the function I am working with, but for the sake of simplicity let's consider the $f$ above. I now want to plot the image of this function, where both variables $x$ and $y$ vary over their entire domain. So the result should be the complex ball of radius $4 \pi^2$ centered at $0$.

If I had only one variable, I could just use complexplot, e.g.

complexplot(f(x,0), x=-6..6)

So what I could technically try is to fix certain values of $y$, plot the image for these values and then overlay all the (hundreds of) plots into one single plot. But this does not seem like the way to do it. Is there a more elegant way to plot the image of a complex-valued function depending on two real variables?

  • You could have 2 plots, one for the real part, the other for the imaginary part. Or split it into magnitude vs argument. But since you essentially have a plot from $\mathbb R^2 \to \mathbb R^2$, you will have a hard time to pack everything into a single plot, when you live in 3D. – DominikS Oct 30 '23 at 15:10
  • Maybe this and this can help you. – DominikS Oct 30 '23 at 15:13
  • Thanks for the quick answer. Note though that I am not trying to plot the entire function $\mathbb{R}^2 \to \mathbb{R}^2$, but only its image (i.e. the set of values that the function can take), which is a subset of $\mathbb{C}$. So splitting the plot into a real and an imaginary part will not really be helpful, since it does not tell me which values the function can take. – Andreas132 Oct 30 '23 at 15:17
  • Ah, thanks for the clarification - I was indeed referring to the graph. Now, if I understand correctly you are interested to visualize the range/image of the function, i.e. the set of all values of $f(x,y)$. Wouldn't a split of (real, imaginary) do the trick, you could plot this set in 2D? Or do you still need to see some dependence on $(x,y)$? – DominikS Oct 30 '23 at 17:54
  • Well, if I split into real and imaginary part, I wont be able to recover the entire image, will I? So in the example above, the image of the real part is the closed interval $[-4 \pi^2, 4 \pi^2]$, and the same holds for the image of the imaginary part. However, the actual image of $f$ is not the product of those sets, which would be the square of length $8 \pi^2$, but it is a ball of radius $4 \pi^2$. I do not see a way to recover the image, since we loose some information about which combinations of real and imaginary values are possible... – Andreas132 Oct 31 '23 at 09:13
  • I mean something else: Your image is the set $B= {z = x+\mathrm{i}y : |z|^2\equiv x^2+y^2 < 16\pi^4}$. I am suggesting to plot the set ${(x,y)\in\mathbb R^2: x+\mathrm{i}y\in B}\subset\mathbb R^2$, which is the same as ${(\operatorname{Re}z, \operatorname{Im}z) : z\in B}$. – DominikS Oct 31 '23 at 09:24
  • Note that this is different from plotting $\operatorname{Re} B\times\operatorname{Im} B$. This would be the range of the real part vs. the range of the imaginary part, instead of the range of (real, imaginary) jointly. – DominikS Oct 31 '23 at 09:28
  • The problem however is that for this method to work I first need to know what the range of the function $f$ is. What I would like to do though is to obtain a code that I can use for different functions, even if I don't know how to explicitly express their range. In the end I kind of managed by just computing $f(x,y)$ for a finite number of points $(x,y)$ (my functions are defined on a compact set), storing all these values in a list and then just plotting this list of points in the complex plane. Not very elegant, but it gives me an idea of what the range of $f$ should look like. – Andreas132 Oct 31 '23 at 15:40

1 Answers1

2

Most commonly what I see in books like An Atlas of Functions (K. Oldham, J. Myland, & J. Spanier, Springer, 2E, 2009) is a presentation of the real and imaginary parts in a 3-D plot. You might also think of plotting the magnitude and argument. I've shown the four examples in the figure below. You could also consider contour plots if you don't want go 3-D.

enter image description here

Cye Waldman
  • 8,196