I would like to plot the Riemann surfaces for $n$ functions of the form:
$$ > f(z) = z^{\frac{1}{n}} = (x + iy)^{\frac{1}{n}} $$
For example for the function
$$ > f(z) = z^{\frac{1}{2}} $$
I want it to be:
p2 = Plot3D[{Im[E^[I Pi] (x + I*y)^(1/2)], Im[E^[2 I Pi] (x + I*y)^(1/2)]},
{x, -2, 2}, {y, -2, 2},
PlotPoints -> {40, 120},
Mesh -> 25,
BoxRatios -> {1, 1, 1},
ColorFunction -> Function[{x, y, z}, Hue[z]],
ImageSize -> size
]
$$ f(z) = z^{\frac{1}{3}} $$
p3 = Plot3D[{Im[(x + I y)^(1/3)], Im[E^(2 I Pi/3) (x + I y)^(1/3)],
Im[E^(4 I Pi/3) (x + I y)^(1/3)]},
{x, -2, 2}, {y, -2, 2},
PlotPoints -> {40, 120},
Mesh -> 25,
BoxRatios -> {2, 2, 2},
ColorFunction -> Function[{x, y, z}, Hue[z]]
]
And so on...
Now, since with growing $n$ the number of imaginary part of the functions grow, so I nested a For
loop with a While
loop
For[n = 2, n < 4, n++,
f[x_, y_] = (x + I y);
i = 1;
Plot3D[
{
While[i < n + 1,
Im[E^(i I Pi /n) f[x, y]^(1/n)]; i++
]
},
{x, -2, 2},
{y, -2, 2},
PlotPoints -> {40, 120},
Mesh -> 25,
BoxRatios -> {2, 2, 2},
ColorFunction -> Function[{x, y, z}, Hue[z]]
]
]
But this does not produce any output, and I think the bug is in:
{
While[i < n + 1,
Im[E^(i I Pi /n) f[x, y]^(1/n)]; i++
]
}
as it does not produce a list of
{Im[E^( I Pi/4) f[x, y]^(1/n)], Im[E^( I Pi/2) f[x, y]^(1/n)], ...}
also, I don't know how to put the comma between the functions Im[E^(i I Pi /n) f[x, y]^(1/n)]
...
how can I do?