Re: Quite Upset with NIntegrate

*To*: mathgroup at smc.vnet.net*Subject*: [mg54286] Re: Quite Upset with NIntegrate*From*: Anton Antonov <antonov at wolfram.com>*Date*: Wed, 16 Feb 2005 14:36:04 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Dear Ismail Turan, As some of the guys in the forum mentioned, it is difficult to answer your question without more detailed information. Some questions/remarks: 1. From what field this integral comes from? 2. How you have entered the integrand in Mathematica? Have you imported it from, say, a FORTRAN file? 3. Have you tested are your integrand and boundaries of integration correctly implemented? 4. Using MaxPoints invokes the MonteCarlo method. You might try QuasiMonteCarlo method -- it is as fast as MonteCarlo, and has more deterministic nature. 5. The default option settings in NIntegrate invoke the MultiDimensional integration method. You might try using a Cartesian rule method with Method->GaussKronrod. Also, you can send me your notebook, and I will look at it. Best regards, Anton Antonov Wolfram Research, Inc. > Dear Yehuda, > > [Attachments like the Sample.nb below are not permitted. Contact > the author to obtain it - moderator] > > It is kind of hard to show the details here but I am enclosing the > Sample.nb file (hopefully you will get it) including a slightly simplified > integrand (I have much more complicated integrands). When I integrate "in" > with using default options of NIntegrate, I am getting the following data > points : > > -12 -38 > 150 9.58287 10 + 1.4816 10 I > -11 -58 > 152 8.1392 10 + 2.82326 10 I > -11 -53 > 154 2.02365 10 + 1.1625 10 I > -6 -58 > 156 1.05475 10 + 2.71146 10 I > -12 -39 > 158 6.94259 10 + 1.63694 10 I > -12 -53 > 160 5.42794 10 + 6.25923 10 I > -11 -39 > 162 1.02786 10 + 1.63133 10 I > -11 -39 > 164 4.53046 10 + 2.37653 10 I > -12 -59 > 166 9.44247 10 + 4.01258 10 I > -11 -40 > 168 4.8126 10 + 3.48983 10 I > -10 -40 > 170 3.71222 10 + 3.94167 10 I > > Here the first column is the varying parameter (mt) and the full range of > it is from 150 to 200 but I only include part of the data points. > > The behavior of the curve is certainly expected to increase smoothly as > "mt" increases. Obviously, there is no such pattern here. Setting > MaxPoints something like 500000 (I checked that at least I need to set it > 10 times bigger to be sure that data points are accurate enough > but this will increase process time enormously) makes the above values > better looking but still far from being accaptable. So, What is wrong > here? > > Thanks, > > ismail > > > > On Sat, 12 Feb 2005, yehuda ben-shimol wrote: > > > It is difficult to comment without seeing the details. Is there any > > way we can see it? > > yehuda > > > On Fri, 11 Feb 2005 03:34:40 -0500 (EST), I. Turan > > <ituran at bohr.concordia.ca> wrote: > > > Hi: > > > > > > I have been trying to evaluate a 4-dimensional integral by using > > > NIntegrate with Mathematica 4 w2k. The integrand and even the > > > integration limits are quite complicated (depending on int. > > > variables). The length of the integrand is around 2000 lines in the > > > FortranForm. > > > > > > If I don't play with any options of NIntegrate, It takes one day to > > > get one data point and gives very unreasonably weird values. By > > > setting, however, MaxPoints something like 100000 it is possible to > > > get faster results but still it seems that Mathematica couldn't handle > > > it. When I draw a figure from these data points, it appears very very > > > spiky such that it is even not possible to fit the curve. However, it > > > is supposed to be very smooth. > > > > > > Should I accept that Mathematica can not handle such a > > > numerical integration or is there a way to make Nintegrate working > > > better? > > > > > > Thanks a lot, > > > > > > Ismail > > > > > > > >