- #1
muppet
- 608
- 1
I'm getting an error message that suggests my attempts to increase the variable MaxRecursion in NIntegrate aren't working.
I define
f[n_,b_]:=NIntegrate[q*BesselJ[0,q*b]*(-(2/(n (2+n) q^4))+(1-q^2)^(n/2) HeavisideTheta[1-q^2] ((2+n q^2)/(n (2+n) q^4)-Hypergeometric2F1[1,n/2,1+n/2,1-1/q^2]/(n q^2))),{q,0,Infinity},Method->"DoubleExponentialOscillatory",MaxRecursion->50,WorkingPrecision->30]
and upon trying to evaluate f[3,4] I get the message
NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in q near {q} = {1.00125749138406369739184946806}. NIntegrate obtained 0.0302818978835504820230915378392`30. and 1.04354107472455181267006501674`30.*^-16 for the integral and error estimates. >>
9 being the default value of MaxRecursion.
Does anyone have any ideas why?
I'm also finding that when I try and
Plot[f[3,b],{b,0,1},WorkingPrecision->30]
I'm getting the message
NIntegrate::precw: The precision of the argument function (q BesselJ[0,0.0000204286 q] (-(2/(15 q^4))+(1-q^2)^(3/2) ((2+3 Power[<<2>>])/(15 q^4)-(-1+1/q^2+Power[<<2>>] ArcTanh[<<1>>])/((1+Times[<<2>>])^2 q^2)) HeavisideTheta[1-q^2])) is less than WorkingPrecision (30.`). >>
How do I fix this?
Thanks in advance.
I define
f[n_,b_]:=NIntegrate[q*BesselJ[0,q*b]*(-(2/(n (2+n) q^4))+(1-q^2)^(n/2) HeavisideTheta[1-q^2] ((2+n q^2)/(n (2+n) q^4)-Hypergeometric2F1[1,n/2,1+n/2,1-1/q^2]/(n q^2))),{q,0,Infinity},Method->"DoubleExponentialOscillatory",MaxRecursion->50,WorkingPrecision->30]
and upon trying to evaluate f[3,4] I get the message
NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in q near {q} = {1.00125749138406369739184946806}. NIntegrate obtained 0.0302818978835504820230915378392`30. and 1.04354107472455181267006501674`30.*^-16 for the integral and error estimates. >>
9 being the default value of MaxRecursion.
Does anyone have any ideas why?
I'm also finding that when I try and
Plot[f[3,b],{b,0,1},WorkingPrecision->30]
I'm getting the message
NIntegrate::precw: The precision of the argument function (q BesselJ[0,0.0000204286 q] (-(2/(15 q^4))+(1-q^2)^(3/2) ((2+3 Power[<<2>>])/(15 q^4)-(-1+1/q^2+Power[<<2>>] ArcTanh[<<1>>])/((1+Times[<<2>>])^2 q^2)) HeavisideTheta[1-q^2])) is less than WorkingPrecision (30.`). >>
How do I fix this?
Thanks in advance.