1
$\begingroup$

Mathematica makes it very easy to to plot the contour lines for a function of two real variables using ContourPlot. It also makes it very easy to plot the streamlines of vector fields using Stream Plot. However, I need to plot "contour lines" which can not come from either method.

Simply put, a "ridge system" is like a vector field, but instead of associating a vector based at every point on the plane, we associate a "line," or "direction," or "unoriented vector." Ridge lines kind of look like stream line plots, but where the stream lines are not "directed." In fact, there is in general no way to "direct" the ridge lines in a consistent manner, so they can't come from the stream lines of any vector field. Three examples are below.

enter image description here

Now let me describe what I would like to do:

  • I would like to start with a complex function $f(z)$ (where $z, f(z) \in \mathbb{C}$). Say that $f(z) = r e^{i \theta}$.
  • Then I would like to draw the ridge line at $z$ corresponding to the directions $\pm e^{- i \theta/2}$.

Bill Thurston seems to have done this in his answer here, picture below (but he doesn't say how). Ignore the red lines and just look at the blue lines:

enter image description here

My goal is to be able to take a complex function $f(z)$ and make an image similar to the one above. What functions in Mathematica can I use to do this?

$\endgroup$
1
$\begingroup$

I figured out the answer based on this question. (Note that this solution will not be satisfactory for some, but it is acceptable to me.)

First define $f$ however you want, such as f[z_] := ...;

The plot is then just StreamPlot[ReIm[1/Sqrt[f[x + I y]]], {x, -1, 1}, {y, -1, 1}]

The reason why it is not 100% satisfactory is because Sqrt has a sign ambiguity, so the ridge lines will have "breaks" where they shouldn't. This was the issue that the asker of the linked question had (but didn't get an answer).

$\endgroup$

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.