2
$\begingroup$

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
  ]

enter image description here For the function

$$ 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]]
  ]

enter image description here

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?

$\endgroup$
3
$\begingroup$

You can define

riemann[n_] :=
 Plot3D[
  Evaluate@Table[Im[E^(i I Pi/n) (x + I y)^(1/n)], {i, 1, n + 1}],
  {x, -2, 2}, {y, -2, 2},
  PlotPoints -> {10, 20},
  Mesh -> 5,
  BoxRatios -> {2, 2, 2},
  ColorFunction -> Function[{x, y, z}, Hue[z]]]

riemann[3]

enter image description here

Or

riemann /@ Range[4]

enter image description here

$\endgroup$
1
  • $\begingroup$ Exactly what I was looking for! $\endgroup$ Aug 8 '17 at 12:55
1
$\begingroup$

Let me introduce you to the Table command. This produces a list of the desired plots.

f[x_, y_] := (x + I y);
n = 3;
plotlist = Table[
  Plot3D[
   Im[E^(i I Pi/n) f[x, y]^(1/n)],
   {x, -2, 2}, {y, -2, 2},
   PlotPoints -> {40, 120},
   Mesh -> 25,
   BoxRatios -> {2, 2, 2},
   ColorFunction -> Function[{x, y, z}, Hue[z]]
   ],
  {i, 1, n + 1}]

If you like to have all of them in one single plot, you can use Show like this:

Show[plotlist, PlotRange -> All]
$\endgroup$
2
  • $\begingroup$ I have a problem with the ColorFunction as the Hue[z] is different for all the $n$ plots.. $\endgroup$ Aug 8 '17 at 12:51
  • $\begingroup$ You can also use the Table within Plot3D similar to your first try with the While construct. This should fix it. $\endgroup$ Aug 8 '17 at 19:10

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.