MathGroup Archive 1998

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

Search the Archive

Re: NIntegrate of a Decaying Exponential

In a message dated 12/16/98 8:44:51 AM, arc at writes:

>Greetings -- I'm trying to get Mathematica to do an integral that
>appears regularly in plasma physics problems.  It appears to give the
>right answer, but it's always accompanied with an annoying error
>message whose roots are a bit vague.  Here is the function to be
>f = -2 v Exp[-v^2]  over the v-interval  (-1,2)
>The answer should be about  -.34956 (according to an IMSL subroutine)
>Here's the mathematica input and output:
>In[1]:=NIntegrate[-2 v Exp[-v^2],{v,-1,2}] Out[1]:=Out[99]=-0.349564
>    "Numerical integration stopping due to loss of precision. Achieved
>neither the requested PrecisionGoal nor AccuracyGoal; suspect highly \
>oscillatory integrand, or the true value of the integral is 0. If your
>\ integrand is oscillatory try using the option Method->Oscillatory in
>\ NIntegrate."
>So, Mathematica gets it right, but with the mysterious warning. The
>error/warning message isn't surprising since the integrand has such a
>sharp peak at v=0, but none of the options specified in the help menu,
>such as MinRecursion, MaxRecursion, Method->, etc. were of any use in
>suppressing this error message.  I want to suppress messages of this
>sort not only so that I don't have to look at them, but also to have an
>extra measure of confidence that the answer is actually right!  



Power Macintosh 3.0 (May 6, 1997)

I do not get the error message.

NIntegrate[-2 v Exp[-v^2], {v, -1, 2}]


However, why are you using numerical integration? This function can be

Integrate[-2 v Exp[-v^2], {v, -1, 2}]

E^(-4) - E^(-1)

% // N


Integrate[-2 v Exp[-v^2], {v, -1., 2}]


Bob Hanlon

  • Prev by Date: Re: Re: Reversing the axis of a plot
  • Next by Date: Re: I need to find the correlation coefficient
  • Previous by thread: Re: NIntegrate of a Decaying Exponential
  • Next by thread: Re: NIntegrate of a Decaying Exponential