MathGroup Archive 2002

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

Search the Archive

Re: Integrate malfunction?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33872] Re: [mg33860] Integrate malfunction?
  • From: BobHanlon at aol.com
  • Date: Sun, 21 Apr 2002 06:12:18 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 4/20/02 4:28:27 AM, sbstory at unity.ncsu.edu writes:

>I recently had to do an integral which should evaluate to be a very very
>small quantity. The function is always positive, but the integral gives
>me a
>negative number. I think this is a malfunction of some sort. Here's the
>code:
>
>amu = 1.661*10^-27
>nitrogen = 28*amu
>k = 1.381*10^-23
>t = 1000
>
>Integrate[
>  4 Pi ((nitrogen/(2 Pi k t))^(3/2)) x^2 Exp[(-1 nitrogen x^2)/(2 k t)],
>{x,
>11000, Infinity}]
>
>Out[13]= -5.878291776559734*10^-16
>
>does anyone know why this is happening? i tried NIntegrate instead, but
>it
>said:
>
>General::"unfl": "Underflow occurred in computation."
>

Use higher precision.  For example, you can use rational numbers

amu=1661*10^-30;
nitrogen=28*amu;
k=1381*10^-26;
t=1000;

N[FullSimplify[Integrate[4*Pi*(nitrogen/(2*Pi*k*t))^(3/2)*
     x^2*Exp[-(nitrogen*x^2)/(2*k*t)],
 
    {x, 11000, Infinity}]]]

5.275254153535021*^-88

Note that for maximum precision you want to use FullSimplify before 
converting to a numerical result.


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: How Do You Reduce Multiple Elements in a List?
  • Next by Date: Re: How Do You Reduce Multiple Elements in a List?
  • Previous by thread: Re: Re: Integrate malfunction?
  • Next by thread: MathLink dynamic parameter in function