53
$\begingroup$

In WolframAlpha we can easily visualize Riemann surfaces of arbitrary functions,

enter image description here

can we plot the Riemann surface of an arbitrary function using Mathematica and with a better color scheme like these plots so that I can see the connection of the branches?

enter image description here

Edit

Here are more Riemann surfaces by Matthias Nieser et. Automatic Generation of Riemann Surface Meshes

enter image description here enter image description here enter image description here

related:

How can I recreate Trott's Riemann Surface plot in Mathematica?

Visualization of Riemann Surfaces of Algebraic Functions

Automatic Generation of Riemann Surface Meshes

$\endgroup$
6
  • 2
    $\begingroup$ Perhaps should mention How can I recreate Trott's Riemann Surface plot in Mathematica? $\endgroup$
    – Artes
    Sep 8, 2013 at 17:40
  • $\begingroup$ @Artes That's where confuses me. Does this kind of visualization of the Riemann surface in 3D is called "Trott's Riemann surface plot", or this color scheme is brought up by Trott? There are lots this kind of plot in the wiki page of Riemann surface, but none of them referred to "Trott". Also matlab has a function cplxmap that can plot this kind of 3d Riemann surface, and it doesn't mention "Trott" either. $\endgroup$ Sep 8, 2013 at 17:57
  • 3
    $\begingroup$ Take a look at the first sentence in the question from the link Artes provided. $\endgroup$
    – Kuba
    Sep 8, 2013 at 18:03
  • 1
    $\begingroup$ These are one of a number of ways to depict a Riemann surface. Another way, in my Application, is to use a multifunction capability and show a Riemann plane and using a Locator point with an attached arrow representing the complex value at that point. Dragging around the locator allows one to explore all parts of the surface in a smooth, single valued, continuous manner (just as Riemann claimed). With the Sqrt function you have to circle the origin twice to get back to the same point. You would have to contact me by email for more information. $\endgroup$
    – David Park
    Sep 8, 2013 at 19:15
  • $\begingroup$ This is a link to Riemann surfaces of algebraic functions: jujusdiaries.com $\endgroup$
    – Dominic
    Apr 15, 2017 at 12:46

1 Answer 1

28
+50
$\begingroup$

You can take Michael Trott's code and modify it a bit to easily plot these surfaces

Import["http://www.mathematicaguidebooks.org/V6/downloads/\
RiemannSurfacePlot3D.m"]
rsurf[func_] := 
  Grid[{{RiemannSurfacePlot3D[w == func, Re[w], {z, w}, 
      ImageSize -> 400, 
      Coloring -> Hue[Rescale[ArcTan[1.4 Im[w]], {-Pi/2, Pi/2}]], 
      PlotPoints -> {40, 40}, Boxed -> False], 
     RiemannSurfacePlot3D[w == func, Im[w], {z, w}, ImageSize -> 400, 
      Coloring -> Hue[Rescale[ArcTan[1.4 Re[w]], {-Pi/2, Pi/2}]], 
      PlotPoints -> {40, 40}, Boxed -> False]}}];

Here it is applied to the functions from the OP

rsurf /@ {Sqrt[z], Log[z], (z + 1)^(1/3) + (z - 1)^(1/2)}

Mathematica graphics Mathematica graphics Mathematica graphics

It is a bit tricky to get a nice coordinate mesh in these plots since we aren't actually using a plotting program (like ParametricPlot3D or Plot3D) to make them. We are instead building up a list of Polygon objects and combining them into a GraphicsComplex. However, we can get a decent approximation of a coordinate mesh by changing the line EdgeForm[] to EdgeForm[Black]

Import["http://www.mathematicaguidebooks.org/V6/downloads/\
RiemannSurfacePlot3D.m"]
rsurf[func_] := 
  Grid[{{RiemannSurfacePlot3D[w == func, Re[w], {z, w}, 
      ImageSize -> 400, 
      Coloring -> Hue[Rescale[ArcTan[1.4 Im[w]], {-Pi/2, Pi/2}]], 
      PlotPoints -> {30, 20}, Boxed -> False], 
     RiemannSurfacePlot3D[w == func, Im[w], {z, w}, ImageSize -> 400, 
      Coloring -> Hue[Rescale[ArcTan[1.4 Re[w]], {-Pi/2, Pi/2}]], 
      PlotPoints -> {30, 20}, Boxed -> False]}}]/.(EdgeForm[]:>EdgeForm[Black]);

You can change the PlotPoints above to change the number of polygons drawn, and thus the quality of the 3D image and the density of mesh lines. The two numbers refer to the azimuthal and radial directions, respectively.

rsurf@Sqrt[1 - z^2]

Mathematica graphics

$\endgroup$
7
  • $\begingroup$ That's nice, could you add the mesh lines for better visualization? $\endgroup$ May 15, 2016 at 21:46
  • $\begingroup$ @xslittlegrass, see the edit. It took a while to find how to do it since Trott didn't use any built-in plotting functions. If I were a better mathematician I could deconstruct his package and refit it to use ParametricPlot3D, but I couldn't. $\endgroup$
    – Jason B.
    May 17, 2016 at 13:54
  • $\begingroup$ thank you, that looks really nice! ParametricPlot3D was introduced very early (version 2), do you know why he didn't use it in the package? $\endgroup$ May 17, 2016 at 14:01
  • 2
    $\begingroup$ I want to say it's because Trott is such a MMA kung-fu master that he doesn't need anything but some polygons and vertex colors to make a better 3D plotting program than is available out of the box. But there's probably a better reason than that. $\endgroup$
    – Jason B.
    May 17, 2016 at 14:04
  • $\begingroup$ BTW: have you seen Trott's earlier series of articles? You should see there his rationale for his strategy of using NDSolve[] in generating these surfaces. (I'm still annoyed that he never got to the special functions.) $\endgroup$ May 17, 2016 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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