MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Not all points plot on my graph...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105246] Re: [mg105158] Not all points plot on my graph...
  • From: "David Park" <djmpark at comcast.net>
  • Date: Wed, 25 Nov 2009 02:34:45 -0500 (EST)
  • References: <2254042.1258977339508.JavaMail.root@n11>

You have a multivalued complex function. You could solve for these values
by:

w == (z + 2)^(2/3)
#^3 & /@ %
Solve[%, w]
wvalues = w /. %
{(2 + z)^(2/3), -(-1)^(1/3) (2 + z)^(2/3), (-1)^(2/3) (2 + z)^(2/3)}

I have shown only the last output, which is the list of multivalues.

A little exploration with real z shows that the first solution is real for z
> -2 and the second solution is real for z <= -2. So you could write and
plot:

f[x_] := Piecewise[{{-(-1)^(1/3) (2 + x)^(2/3), x <= -2}, {(2 + x)^(
    2/3), x > -2}}]
Plot[f[x], {x, -3, 0}, PlotRange -> {{-3, 0}, {-4, 4}}]

However, I'm not certain if always taking the real solution and piecing them
together is proper to whatever underlying application you have.

The better way to handle such functions would be to treat them as
multivalued complex functions and make a plot on an implicit Riemann
surface. For those who have the Presentations package you can do that with
the following code.

Needs["Presentations`Master`"]

DynamicModule[{zpt = {0, 0}, w, root},
 Module[
  {f = Function[z, (z + 2)^(2/3)],
   sqrtz, z,
   zcenter = -2},
  multif = 
   Multivalues[
    Null, {(2 + z)^(
      2/3), -(-1)^(1/3) (2 + z)^(2/3), (-1)^(2/3) (2 + z)^(2/3)} // N,
     z];
  Row[
   {Draw2D[
     {ComplexPolarDensityDraw[
       Abs[f[z]], {z, ComplexPolar[0, -\[Pi]], ComplexPolar[3, \[Pi]],
         zcenter},
       ColorFunctionScaling -> False,
       ColorFunction -> (ColorData["GrayYellowTones"][
           Rescale[#, {0, Sqrt[3]}]] &),
       Mesh -> {Sqrt /@ Range[.5, 3, .5]},
       MeshFunctions -> (Abs[Sqrt[#1]] &),
       PlotPoints -> {5, 10} 4,
       MaxRecursion -> 0,
       PlotRange -> {0, 3}],
      Dynamic@
       Arrow[{zpt, 
         zpt + 1/2 ToCoordinates[
            root = Extract[
              CalculateMultivalues[multif][ToComplex[zpt]], {1, 1}]]}],
      Locator[Dynamic[zpt], 
       Graphics[{CirclePoint[{0, 0}, 3, Black, Red]}]]},
     Frame -> True, FrameLabel -> {Re, Im},
     PlotRange -> {{-5, 1}, {-3, 3}},
     PlotLabel -> Row[{f["z"], " as a Rieman Surface"}],
     Background -> None,
     ImageSize -> 350],
    Dynamic@Column[
      {ComplexArgumentPanel[ToComplex[zpt], {True, True, False}, 
        Row[{"z", Spacer[20]}], {Left, Center}, 
        ImageSize -> {185, 42}],
       ComplexArgumentPanel[root, {True, True, False}, 
        Row[{f["z"]}], {Left, Center}, ImageSize -> {185, 42}]}](* 
    Column *)},
   Spacer[20]](* Row *)
  ]
 ]

This shows a red CirclePoint locator on a background plot of the modulus of
the function. The locator has a vector attached to it that represents the
value of the function. At every point on the Riemann surface the function is
single valued and continuous. The point can be dragged around and the vector
will behave smoothly with no branch line jumps. The values of z and the
function are shown in a panel on the side. However, because this is a
multifunction, if you drag the locator once around the branch point at z ==
-2 you will not return to the original value. You have to drag it around
three times to get back to the original point on the Riemann surface and the
original value. Other than the fact that you can't actually "see" the
Riemann surface as a geometric surface, there are no artifacts such as
branch lines or surfaces that cross.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  




From: davef [mailto:davidfrick2003 at yahoo.com] 

Why is it when I write this...

Clear[f, x]
f[x_] = (x + 2)^(2/3)
Plot[f[x], {x, -3, 0}, PlotRange -> {{-3, 0}, {-4, 4}}]
f[-3]

.. I get no values show in the graph for x<-2 even though f[-3]
evaluates to (-1)^(2/3).

(-1)^(2/3) evaluates as f[-3]=1 so why wouldn't the point (-3,1) plot
on my graph?





  • Prev by Date: Re: Delay Differential Equations
  • Next by Date: Re: Kernel crashes in ReplaceAll - with or without Maximize failure
  • Previous by thread: Re: Not all points plot on my graph...
  • Next by thread: How to get the output of FindFit from MathLink in C program?