MathGroup Archive 2011

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

Search the Archive

Re: What do I do to get better curves?

  • To: mathgroup at
  • Subject: [mg120951] Re: What do I do to get better curves?
  • From: Dana DeLouis <dana01 at>
  • Date: Thu, 18 Aug 2011 03:24:10 -0400 (EDT)
  • Delivered-to:

Hi.  My guess for =93inaccurate=94 is that the plot is missing some solutions.
If so, my best guess is that ContourPlot is having a hard time at the boundaries from Complex Numbers to Real Numbers.
For example, the graph appears not to pick up that k = w is a solution.



Since there are no direct solutions, I assume a numerical approximation is used.

{0. + 0.*I, 0. + 0.*I}

It just sees complex, skips this, and moves on.

a[3, 2.9999]
0. - 0.3757639094419213*I

a[3, 3.001]
0. + 3.752788853703563*I

a[3., 3.]
0. + 0.*I

It just doesn't see a real solution at k=w.

Just one of many solutions not found would be something like this:

a[2.015168629, 4]

a[2.015168630, 4]
0. - 0.001293*I

Just a hair difference, and the solution is Complex, and is most likely skipped by ContourPlot.

Something I found interesting:
ContourPlot seems to find the points where the transition is from a positive number to a negative number(and other way around)
It can't find those that transition from Complex to Real.
My guess is that this would be hard to do at Machine Precision.

MatrixForm[Table[Rationalize[Sign[a[k, w]]],
   {k, 7, 0, -1}, {w, 0, 10, 1/3}]]

= = = = = = = = = = =
Dana DeLouis
8.0 for Mac OS X x86 (64-bit) (November 6, 2010)

On Aug 17, 5:55 am, "becko" <becko... at> wrote:
> Run the following code in mathematica:
> r=6197/3122;
> p[k_,w_]:=Sqrt[w^2/r^2-k^2];q[k_,w_]:=Sqrt[w^2-k^2];
> a[k_,w_,p_,q_]:=(k^2-w^2)^2 Sin[p]Cos[q]+4k^2 p q Cos[p]Sin[q]
> a[k_,w_]:=a[k,w,p[k,w],q[k,w]];
> ContourPlot[a[k,w]==0,{w,0,6},{k,0,14}]
> The curves thus obtained are very inaccurate. I tried raising the
> PlotPoints and WorkingPrecision opions of ContourPlot, but it doesn't
> work. Morevoer, you see that the only parameter that shows up, 'r', is
> an exact rational number. I don't know what else to try. Thanks.

  • Prev by Date: Re: Basic questions on _Plus and recursion
  • Next by Date: why does this call to ListPlot3D crash the kernel?
  • Previous by thread: Re: What do I do to get better curves?
  • Next by thread: Re: What do I do to get better curves?