1st problem

My code is as follows:

w[z] := (2/Pi)*((z^2 - 1)^(0.5) + ArcSin[1/z])
ParametricPlot[{Re[w[z]], Im[w[z]]} /. z -> x + I*y, {x, -Pi, Pi}, {y, 0, Pi}, 
   PlotRange -> {{-3, 3}, {-3, 3}}, 
   Mesh -> 20, 
   MeshShading -> {{None, None}, {None, None}}, 
   MeshStyle -> {Red, Blue}]

Plot image 1

enter image description here

Plot image 2

enter image description here

The code produces 1 but should look like 2. The function is correct. I'm not certain but I think the issue might have to do with the multivaluedness of ArcSin. Is there a fix for this?

2nd problem

  • mapping

    plotting Mapping

  • my plot

    My current plot

  • desired plot

    Desired Plot

My code is the following:

w[z] := 
  4*(1 + z)^(1/4) + 
  Log[((z + 1)^(1/4) - 1)/((z + 1)^(1/4) - 1)] + 
  I*Log[(I - (z + 1)^(1/4))/(I + (z + 1)^(1/4))]
ParametricPlot[{Re[w[z]], Im[w[z]]} /. z -> x + I*y, {x, -5, 5}, {y, 0, 6}, 
  PlotRange -> {{-1, 5}, {0, 3}}, 
  Mesh -> 20, 
  MeshShading -> {{None, None}, {None, None}}, 
  MeshStyle -> {Red, Blue}]
  • $\begingroup$ Multivaluedness of complex functions (both square root and arcus sine) is probably the reason. I think you should specify the function yielding your second plot very carefully (how are the branch choices done et cetera), then people can help you to coerce Mathematica to use those same branches. Also, what demon possessed you to write $0.5$ instead of $1/2$ in the exponent? You know they aren't treated the same! Actually I don't know how Mathematica handles it, but it feels very unnatural to me to use decimals here. $\endgroup$ – Jyrki Lahtonen Feb 23 '18 at 5:53
  • $\begingroup$ @JyrkiLahtonen i didn't realise there was a difference between 0.5 and 1/2. I usually prefer decimals since I can drop the parentheses when I'm being lazy. I realise also that the code didn't print exactly as I wrote it since I've been using the symbol * between for products with complex number i $\endgroup$ – Aamir Madman Feb 23 '18 at 6:22
  • $\begingroup$ Yeah I agree - hadn't realised there was a mathematica stack exchange $\endgroup$ – Aamir Madman Feb 23 '18 at 8:55
  • $\begingroup$ Dear Mathematica.SE users, If there are shortcomings in this post, please educate me about them as well as the OP. Because I'm a moderator at Math.SE it is best that I will also be informed about your expectations. $\endgroup$ – Jyrki Lahtonen Feb 23 '18 at 9:02

A little bit of testing revealed that the branch cuts of $\sqrt{z^2-1}$ at $z=1$ and $z=-1$ may be the culprits here. I plotted various rewritings of $\sqrt{z^2-1}$, and noticed that the variant

mySqrt[z]:=I Sqrt[1-z^2]

coerces Mathematica to use a branch of $\sqrt{z^2-1}$ such that the values of the square root have positive imaginary part, which is what you apparently need. People familiar with Mathematica's logic of selecting a branch can probably find the root cause (or suggest alternatives).

The other problems in your plot most likely came from the singularity at the origin. You know, the place where God divided by zero. Hardly a surprise that ploughing straight thru a singularity gives Mathematica a handful of problems. A remedy is to skirt the singularity, and fine tune the range. For example

 w[z]:=(2/Pi) (mySqrt[z] + ArcSin[1/z])

ParametricPlot[{Re[w[z]], Im[w[z]]} /. z -> x + I y, {x, -Pi, 
  Pi}, {y, 0.01, Pi}, PlotRange -> {{-3, 3}, {-3, 3}}, 
 PlotPoints -> {100, 100}, Mesh -> 20, 
 MeshShading -> {{None, None}, {None, None}}, 
 MeshStyle -> {Red, Blue}]

produces something hopefully more palatable:

enter image description here

You may want to adjust the PlotPoints and Mesh parameters to even higher values (to make that sagging bag along the imaginary axis smoother). Or adjust the lower limit of the variable y even closer to $0$. Experiment! Letting it go down to exactly zero is an invitation to discontinuities and a disaster for computer graphics.

  • $\begingroup$ That's fantastic, thanks a lot! I'm very unfamiliar with Mathematica and have only really used it today but since I'm trying to make plots of conforma $\endgroup$ – Aamir Madman Feb 23 '18 at 6:57
  • $\begingroup$ @Aamir: In my pasted code snippet I accidentally used w2 in place of w. This was a by-product of my testing. I had several variants of your function. Should be fixed now. $\endgroup$ – Jyrki Lahtonen Feb 23 '18 at 6:57
  • $\begingroup$ That's fantastic, thanks a lot! I'm very unfamiliar with Mathematica and have only really used it today. I'm looking to make simple plots of the effects from certain conformal maps and it seemed easiest to do in Mathematica. Is there a way to get the diagram to extend to infinity like it does in pic2? (if not I'll just crop it so it looks like it does) $\endgroup$ – Aamir Madman Feb 23 '18 at 7:05
  • $\begingroup$ Doesn't matter actually, I realised I can just restrict the plot range $\endgroup$ – Aamir Madman Feb 23 '18 at 7:12
  • $\begingroup$ There may be a way of defining $\arcsin(1/z)$ in such a way that it behaves nicely. Also, you may get some of the missing parts by restricting the range of $x$ (still avoiding the singularity!), and glueing together two or more pictures (one with positive $x$ and another with negative $x$). Mathematica has ways of merging two plots, but then you may not get a seamless picture. $\endgroup$ – Jyrki Lahtonen Feb 23 '18 at 7:29

Your Answer

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