MathGroup Archive 2006

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

Search the Archive

Re: NIntegrate[Abs] bug in v5.1, not v5.0

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64203] Re: [mg64191] NIntegrate[Abs] bug in v5.1, not v5.0
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Sun, 5 Feb 2006 04:44:56 -0500 (EST)
  • References: <200602040913.EAA15839@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Solomon, Joshua wrote:

>First, I establish that everything works in v5.0.
>
>In[1]:=
>
>f[x_]:=E^-(Sin[.1+x]^2)-E^-(Sin[.1-x]^2)
>
>
>In[2]:=
>
>{$Version,$ReleaseNumber}
>
>Out[2]=
>
>{5.0 for Mac OS X (June 10, 2003),0}
>
>
>In[3]:=
>
>Timing[NIntegrate[-f[x],{x,0,Pi/2},AccuracyGoal->1]]
>
>Out[3]=
>
>{0.001438 Second,0.125515}
>
>
>In[4]:=
>
>Timing[NIntegrate[Abs[f[x]],{x,0,Pi/2},AccuracyGoal->1]]
>
>Out[4]=
>
>{0.0015 Second,0.125515}
>
>
>Now I try again in v5.1.
>
>In[1]:=
>
>f[x_]:=E^-(Sin[.1+x]^2)-E^-(Sin[.1-x]^2)
>
>
>In[2]:=
>
>{$Version,$ReleaseNumber}
>
>Out[2]=
>
>{5.1 for Mac OS X (October 25, 2004),0}
>
>In[3]:=
>
>Timing[NIntegrate[-f[x],{x,0,Pi/2},AccuracyGoal->1]]
>
>Out[3]=
>
>{0.001286 Second,0.125515}
>
>
>In[4]:=
>
>Timing[NIntegrate[Abs[f[x]],{x,0,Pi/2},AccuracyGoal->1]]
>
>
>This produces no output for several minutes. Then the Kernel crashes. Any
>ideas?
>
>j
>  
>
How about using ListIntegrate?

In[1]:=
<<NumericalMath`ListIntegrate`
$Version
foo[x_]:=E^-(Sin[.1+x]^2)-E^-(Sin[.1-x]^2)//ExpToTrig//ComplexExpand
Timing[data=Table[foo[x]//Abs,{x,0,Pi/2,0.01}];
ListIntegrate[data,0.01]]


Out[2]=
5.1 for Microsoft Windows (January 27, 2005)

Out[4]=
{0.06 Second,0.125515}



  • Prev by Date: Re: notebook font encoding
  • Next by Date: Re: Goedel Numbers
  • Previous by thread: NIntegrate[Abs] bug in v5.1, not v5.0
  • Next by thread: Re: NIntegrate[Abs] bug in v5.1, not v5.0