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


Groups > comp.soft-sys.math.mathematica > #4452

Re: What do I do to get better curves?

From Bob Hanlon <hanlonr@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: What do I do to get better curves?
Date 2011-08-18 07:25 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j2iepp$bl7$1@smc.vnet.net> (permalink)

Show all headers | View raw


The function definitions should explicitly include all parameters.

p[k_, w_, r_] := Sqrt[w^2/r^2 - k^2];
q[k_, w_, r_] := Sqrt[w^2 - k^2];
a[k_, w_, p_, q_, r_] := (k^2 - w^2)^2 Sin[p] Cos[q] + 4 k^2 p q Cos[p] Sin[q];
a[k_, w_, r_] := a[k, w, p[k, w, r], q[k, w, r], r];

For the function to be real valued the arguments of the square roots must be nonnegative.

FullSimplify[Reduce[Thread[
   Cases[a[k, w, r], Sqrt[z_] -> z, Infinity] > 0],
  k], {w >= 0, k >= 0, r > 1}]

k r < w

Checking the function value on the boundary

a[k, k*r, r]

0

Or equivalently,

a[w/r, w, r]

0

So the line k = w/r is part of the contour.

Manipulate[Show[
  Plot[w/r, {w, 0, 6}, PlotStyle -> Blue],
  ContourPlot[a[k, w, r] == 0, {w, 0, 6}, {k, 0, w/r},
   ContourStyle -> Directive[Red, AbsoluteThickness[2]]],
  AspectRatio -> 1,
  Frame -> True,
  Axes -> False,
  PlotRange -> {0, 6}],
 {{r, 6197/3122}, 1, 5, Appearance -> "Labeled"}]


Bob Hanlon

---- becko <becko565@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.


Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: What do I do to get better curves? Bob Hanlon <hanlonr@cox.net> - 2011-08-18 07:25 +0000

csiph-web