Re: Numerical integration and list of points

*To*: mathgroup at smc.vnet.net*Subject*: [mg87654] Re: [mg87622] Numerical integration and list of points*From*: Curtis Osterhoudt <cfo at lanl.gov>*Date*: Tue, 15 Apr 2008 05:49:52 -0400 (EDT)*Organization*: LANL*References*: <200804141053.GAA13528@smc.vnet.net>*Reply-to*: cfo at lanl.gov

Hi, Gueromo, It seems to work for me: In[1]:= data = ({#1, Sin[13.4*#1]} & ) /@ Range[0, 4, 0.01]; f = Interpolation[data]; NIntegrate[f[x], {x, 0, 4}] Integrate[f[x], {x, 0, 4}] Integrate[Sin[a*x], x] % /. a -> 13.4 (% /. {x -> 4}) - (% /. {x -> 0}) During evaluation of In[1]:= NIntegrate::ncvb: NIntegrate failed to \ converge to prescribed accuracy after 9 recursive bisections in x \ near {x} = {0.126211}. NIntegrate obtained 0.14786850709355207` and \ 1.9590212682839143`*^-7 for the integral and error estimates. >> Out[3]= 0.147869 Out[4]= 0.147869 Out[5]= -(Cos[a x]/a) Out[6]= -0.0746269 Cos[13.4 x] Out[7]= 0.147869 On Monday 14 April 2008 04:53:33 guerom00 wrote: > Hello everyone, > > I have a function which I read as a list of points. I want then to > estimate its integral. I do more or less this : > > data={{x1,y1},{x2,y2},...,{xN,yN}} > f=Interpolation[data] > NIntegrate[f[x],{x,x1,xN}] > > Is it the correct way ? Because Mathematica hangs without giving me an > answer although it seems a pretty straightforward thing to do... > > Thanks for any suggestions. -- ========================================================== Curtis Osterhoudt cfo at remove_this.lanl.and_this.gov PGP Key ID: 0x4DCA2A10 Please avoid sending me Word or PowerPoint attachments See http://www.gnu.org/philosophy/no-word-attachments.html ==========================================================

**References**:**Numerical integration and list of points***From:*guerom00 <guerom00@gmail.com>