Re: Re: Integrate vs Nintegrate for impulsive functions

*To*: mathgroup at smc.vnet.net*Subject*: [mg61751] Re: [mg61728] Re: Integrate vs Nintegrate for impulsive functions*From*: Pratik Desai <pdesai1 at umbc.edu>*Date*: Fri, 28 Oct 2005 03:25:29 -0400 (EDT)*References*: <200510270902.FAA19481@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Bill Rowe wrote: >On 10/26/05 at 2:44 AM, chris.chiasson at gmail.com (Chris Chiasson) >wrote: > > > >>My computer gives the same answer as yours for NIntegrate, but it >>thought for a long while on Integrate and then spit out: >>Complex[-4.4073414839228176`*^145,6.238877585945074`*^146] Bug?? >>Version Number: 5.2.0.0 >>Platform: Windows >> >> > >Using version 5.2 on MacOS 10.4.2, for Integrate I get > >Out[2]= >4.651767835491884*^136 + 1.162941958872971*^136*I > >and for NItegrate, I get the same result reported by Pratik Desai. > >The function being integrated is specified with machine precision coefficients. I strongly suspect this is the root of the problem. > >Integrate will first get a symbolic answer then compute the final answer by substituting the end points into the symbolic answer. It is entirely possible this leads to problems even when the orginal function being integrated has reasonable values over the range of integration. > >So, I would be inclined to accept the answer given by NIntegrate as valid and reject the answer given by Integrate. But I would not consider this to be a bug. Instead, I would chalk this up as one of the issues with doing machine precision computations. >-- >To reply via email subtract one hundred and four > > > Hi Bill I tried to increase the precision of my calculation (I hope this my understanding of your post is correct ), but to no avail. I am begining to think that NIntegrate is correct ( I guess you can't have much of a fourier series without the fourier coefficient :-) ) So the function looks like this gss[x_]=(-0.24982234345508192767999985675352186955264330379714847631`38.487710383706414 - 0.042973298321580602789058629777534550745591195188598656308`38.14780044850824*I)* Sin[(3.173442724268721537583815006655640900135040283203125`40. + 0.329548078108167386002236298736534081399440765380859375`40.* I)*x]*(Cosh[1000.`40.*(-0.40000000000000002220446049250313080847263336181640625`40. + x)^2] - 1.`40.*Sinh[1000.`40.*(-0.40000000000000002220446049250313080847263336181640625`40. + x)^2]) Integrate[gss[x],{x,0,1}] >>\!\(0``-116.81875683192678 + 0``-116.86787428327584\ \[ImaginaryI]\) NIntegrate[gss[x],{x,0,1}] >>-0.0133612 - 0.00285551 \[ImaginaryI] Thanks for your input Best Regards Pratik -- Pratik Desai Graduate Student UMBC Department of Mechanical Engineering Phone: 410 455 8134

**References**:**Re: Integrate vs Nintegrate for impulsive functions***From:*Bill Rowe <readnewsciv@earthlink.net>