Re: Message: "Numerical interation converging too slowly"
- To: mathgroup at smc.vnet.net
- Subject: [mg83271] Re: Message: "Numerical interation converging too slowly"
- From: Andrew Moylan <andrew.j.moylan at gmail.com>
- Date: Fri, 16 Nov 2007 05:38:08 -0500 (EST)
- References: <fhh7h5$8p4$1@smc.vnet.net>
On Nov 15, 9:37 pm, "Hoa Bui" <hoabu... at gmail.com> wrote: > Hi all, > > Please help! > > I have a list of points: > lst={{0,0.0673209172484956`},{0.003449278068524249`,0.10109827933089396`},{\ > 0.014031516572727063`,0.19966139796005267`},{0.04649737451028208`,0.\ > 2870434103185859`}} > > I then define a function NN[x] that returns the linearly interpolated > value at x: > linN = Interpolation[lst, InterpolationOrder -> 1]; > NN[x_?NumberQ]:=linN[x]; > > In[17]:=NN[0] > Out[17]=0.0673209 > > In[18]:=NIntegrate[NN[s],{s,0,0.45}] > Out[18]=0.344713 > > However, if I want to make the integral a function of the upper limit, > and plot it: > Plot[NIntegrate[NN[s],{s,0,z}],{z,0,0.045}], > I get this message: > "NIntegrate::slwcon: Numerical integration converging too slowly; suspect one \ > of the following: singularity, value of the integration being 0, oscillatory \ > integrand, or insufficient WorkingPrecision. If your integrand is oscillatory \ > try using the option Method->Oscillatory in NIntegrate." > > Maybe there's nothing wrong with the result, but I'm not sure. And the > message is annoying, too. > Does anyone know how to make Mathematica do the work without complaining? > > I appreciate it. > HB This works in Mathematica 6. In your version, try e.g. inserting a Print[x] statement inside the definition of NN. This will let you find out which particular values of x are generating NIntegrate::slwcon warnings. NN[x_?NumberQ] := ( Print[x]; linN[x] )