MathGroup Archive 2006

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

Search the Archive

Re: NIntegrate and Plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63860] Re: [mg63859] NIntegrate and Plot
  • From: <bsyehuda at gmail.com>
  • Date: Thu, 19 Jan 2006 03:43:24 -0500 (EST)
  • References: <200601190503.AAA21328@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
Since you give no description of the function at hand I can only speculate
from my past experience....
The Plot function is sampling the range of interest with $MachinePrecision.
I encountered a problem in the past with this effecting Integrate (not
NIntegrate as in your case) but I wonder if such effect can cause that in
your case too.
This is easy to check.
Crate a set of accurate samples (high precision or rational numbers) in the
range of interest and then use these points with your NIntegrate.
If this is OK use ListPlot in place of Plot for the results you calculated
above.
I hope it helps
yehuda


On 1/19/06, Peter Rolnick <abrahams_rolnick at sbcglobal.net> wrote:
>
> Hello. I have a 3D function that I am integrating numerically, and it has
> a
> parameter, q. As far as I can tell, the integrand is never infinite or
> complex. When I use NIntegrate for a particular value of q, it does the
> numerical integral and gives me a reasonable value for the result (for q =
> 0
> it gives me the expected analytic value). I can do this for many values of
> q, and it seems to work just fine.
>
> However... when I try to Plot the numerical integral as a function of q,
> though it does actually give me a reasonable plot, it also gives me this
> message:
>
> It gives the message repeatedly, always at the same values of k, X, and
> gamma (the variables of integration). There is nothing weird or singular
> at
> those points, and if I ask the numerical integral to skip any or all of
> those points, it gives the same message at some slightly different points .
> This makes me think that the problem does not have to do with those
> particular points. (It does this weird behavior even if I just use the
> Real
> part of the integrand, so it can't be that the value of the integrand is
> complex anywhere.)
>
> So my question is, why does Mathematica let me do NIntegrate for a single
> value of q, but get upset if I try to Plot the numerical integral over a
> range of values of q (even though it actually ends up doing what I asked
> it
> to do)?
>
> I'm suspecting this is some simple but subtle quality of Mathematica that
> has to do with using the function NIntegrate inside the function Plot.
>
> Thanks very much.
>
> Peter Rolnick
>
> Peter Rolnick,  <mailto:prolnick at truman.edu> prolnick at truman.edu
>
> 216 N New St, Kirksville MO 63501, 660-665-2703
>
> <http://www2.truman.edu/~prolnick> http://www2.truman.edu/~prolnick
>
>
>
>



  • Prev by Date: Kernel uses excessive CPU time *after* giving result.
  • Next by Date: GUIKit - Number of digits
  • Previous by thread: NIntegrate and Plot
  • Next by thread: Re: NIntegrate and Plot