- #1

muppet

- 608

- 1

**MaxErrorIncreases option for NIntegrate in Mathematica 8**

Hi all,

I'm trying to do the following integral numerically in Mathematica 8 (defining a function of the parameter b):

[tex]\int^{\infty}_0 dq q J_0(b q) \left(\left(1-q^2\right)^{3/2} \theta \left(1-q^2\right) \left(\frac{3 q^2+2}{15 q^4}-\frac{\frac{1}{q^2}+\sqrt{1-\frac{1}{q^2}} \tanh ^{-1}\left(\sqrt{1-\frac{1}{q^2}}\right)-1}{\left(1-\frac{1}{q^2}\right)^2 q^2}\right)-\frac{2}{15 q^4}\right)[/tex]

I'm getting the NIntegrate::eincr error message, to the effect that the global error has increased more than 400 times when it's expected to go down with repeated recursive bisections of the integration region. It says that I should be able to work around this by using the method option Method->{GlobalAdaptive,MaxErrorIncreases->10000} to increase the patience of Mathematica in waiting for the oscillatory integral to converge. However, on using this option I'm still getting the same error message, still quoting the default value for MaxErrorIncreases of 400. I'm defining a function

maxerrinc[b_]:=NIntegrate[i[q,b],{q,0,Infinity}, Method->{"GlobalAdaptive",MaxErrorIncreases->10000}, MaxRecursion->100]

where i[q,b] is just the integrand above, and I get the standard error message when I try and plot it. I tried to test my syntax on the simple example given in the mathematica documentation, but it turns out that it evaluates fine without ever generating that error message

Is this a bug, or am I doing something dumb?

Thanks in advance.

Last edited: