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


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

What do I do to get better curves?

Started by"becko" <becko565@hotmail.com>
First post2011-08-17 09:55 +0000
Last post2011-08-18 07:29 +0000
Articles 4 — 3 participants

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


Contents

  What do I do to get better curves? "becko" <becko565@hotmail.com> - 2011-08-17 09:55 +0000
    Re: What do I do to get better curves? "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-08-18 07:23 +0000
    Re: What do I do to get better curves? "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-08-18 07:24 +0000
    Re: What do I do to get better curves? Alois Steindl <Alois.Steindl@tuwien.ac.at> - 2011-08-18 07:29 +0000

#4446 — What do I do to get better curves?

From"becko" <becko565@hotmail.com>
Date2011-08-17 09:55 +0000
SubjectWhat do I do to get better curves?
Message-ID<j2g371$1ek$1@smc.vnet.net>
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] | [next] | [standalone]


#4448

From"Kevin J. McCann" <Kevin.McCann@umbc.edu>
Date2011-08-18 07:23 +0000
Message-ID<j2ielv$bji$1@smc.vnet.net>
In reply to#4446
Your function has complex values for some arguments. Try this:

ContourPlot[Re[a[k, w]], {w, 0, 6}, {k, 0, 14}, PlotRange -> All,
  PlotPoints -> 200]

Over much of the upper part the real part is zero.

Kevin

On 8/17/2011 5:55 AM, becko wrote:
> 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}]

[toc] | [prev] | [next] | [standalone]


#4449

From"Kevin J. McCann" <Kevin.McCann@umbc.edu>
Date2011-08-18 07:24 +0000
Message-ID<j2iemt$bk9$1@smc.vnet.net>
In reply to#4446
Here is what you want, I think:

ContourPlot[Chop[a[k, w]] == 0, {w, 0, 6}, {k, 0, 3},
  PlotRange -> All, PlotPoints -> 200, GridLines -> Automatic]

You can include more points to get the diagonal "boundary" better defined.

Kevin

On 8/17/2011 5:55 AM, becko 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] | [prev] | [next] | [standalone]


#4462

FromAlois Steindl <Alois.Steindl@tuwien.ac.at>
Date2011-08-18 07:29 +0000
Message-ID<j2if1e$bmg$1@smc.vnet.net>
In reply to#4446
Am 17.08.2011 11:55, schrieb becko:
> 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.
>
Hello,
two observations: Your functions return complex values for k>w/r.
a[k,w]==0 returns True or False.

I suggest you think about your equations.

Alois

[toc] | [prev] | [standalone]


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


csiph-web