Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4459 > unrolled thread

Re: What do I do to get better curves?

Started byDana DeLouis <dana01@me.com>
First post2011-08-18 07:28 +0000
Last post2011-08-18 07:28 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: What do I do to get better curves? Dana DeLouis <dana01@me.com> - 2011-08-18 07:28 +0000

#4459 — Re: What do I do to get better curves?

FromDana DeLouis <dana01@me.com>
Date2011-08-18 07:28 +0000
SubjectRe: What do I do to get better curves?
Message-ID<j2ieui$bm4$1@smc.vnet.net>
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.

{a[k,k],a[w,w]}
{0,0}

{a[1,1],a[5,5]}
{0,0}

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

{a[1.,1.],a[5.,5.]}
{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]
-0.009620

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
$Version
8.0 for Mac OS X x86 (64-bit) (November 6, 2010)


On Aug 17, 5:55 am, "becko" <becko...@hotmail.com> 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.


[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web