MathGroup Archive 1997

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

Search the Archive

Re: Mathematica Graphics

  • To: mathgroup at
  • Subject: [mg9192] Re: Mathematica Graphics
  • From: Lars Hohmuth <larsh>
  • Date: Tue, 21 Oct 1997 02:03:05 -0400
  • Organization: Wolfram Research Inc.
  • Sender: owner-wri-mathgroup at


Sorry for replying to a followup, but I was out of the office the last
week and can't seem to find the original message.

The advice Terry gives is generally sound and good practice in all
programming one does. Unfortunately, here the culprit is something

If you check the values of ChiPlot at one of the points Mathematica
complains about, you'll see that (because this function IS 'dangerous'
numerically) a spurious tiny imaginary part gets introduced.

ChiPlot[0.025,0.0499948249319424853] Out[4]=
20.00129551965732 - 5.241281105093912*^-6*I

Plot[] expects real numbers; so the easiest way of preventing the error
messages is wrapping Re[] around ChiPlot


Hope this helps,

Lars Hohmuth
Wolfram Research

Terry Harter wrote:
> David Djajaputra wrote;
> =========================
> Could anyone tell me how to make Mathematica plot the following function
> smoothly?
> Wbar[q_,w_]:=w/(4 Sin[q/2]);
> Chi[q_,w_]:=
>   EllipticF[Pi/2 - ArcSin[Wbar[q,w]], 1/(1-Wbar[q,w]^2)]  /
> Sqrt[1-Wbar[q,w]^2];
> ChiPlot[q_,w_]:=
>   If[(w>2 Sin[q])&&(w < 4 Sin[q/2]), Chi[q,w]/(2 Pi Sin[q/2]),0];
> Plot[{ChiPlot[0.025,w]},{w,0.04999,0.050},PlotPoints->200,
>   PlotRange->{19.998,20.003}]
> If I run the last Plot command, Mathematica always complains about
> ChiPlot[w] not being a machine-size real number at some points, and then
> it only plots several disconnected lines. I realize the function is
> rather `dangerous' but analytically  I expect it  to behave normally
> inside the region that I use above, except perhaps at the
> boundaries. Anyway, if Mathematica can get the separate lines, why can't
> it obtain
> the values for points between the lines also?
> Much thanks in advance,
> David Djajaputra
> =====================
>   Whenever I get such messages from the kernal, *I* always
> check for unbalanced square braketws, paranthesis, list brackets, etc.
>    Examinbe your definition of Chi[ ] -- I think it needs a "]" at the
> end of its definition.
> Hope this helps
> ....Terry

  • Prev by Date: live and movie for SGI
  • Next by Date: Re: A generalized Transpose?
  • Previous by thread: Re: Mathematica Graphics
  • Next by thread: Mathematica 3.0 - Problem