I have this code. It is a triple integral, and using the automatic method gives me a wrong answer for $T=0.1$ (the correct answer is $5.44$, while I got $3.73$ ). I've tried to change the integral method to GaussKronrodRule
, but it takes too long (until now, hours) and also I received a message
Return::nofunc: Function Module not found enclosing Return[False,Module].Parallel
Developer
QueueRun::hmm: Received unexpected result .
And for $T > 1$ gives the correct results, in the automatic method mode. I think it is a problem in the method of NIntegrate
, right ?
1) How can I solve that ?
2) In Fortran, I have a gausslegendre method. Is this option available in Mathematica?
σ = 0.6;
minroot[g_?NumericQ,b_?NumericQ]:=
Module[{rts,r},
rts=r/.Solve[1-(b/r)^2-g^-2*(2/15*σ^9 (1/(r-1)^9-1/(r+1)^9-9/(8r)
(1/(r-1)^8-1/(r+1)^8))-σ^3 (1/(r-1)^3-1/(r+1)^3-3/(2r)
(1/(r-1)^2-1/(r+1)^2)))==0,r];
rts=Select[rts,With[{nval=N[#,100]},Im[nval]==0&&nval>0]&];
Max[rts]];
aA[g_?NumberQ,b_?NumberQ,i_]:=Pi-2 b
NIntegrate[
1/(r^2*Sqrt[1-(b/r)^2-g^-2*(2/15* σ^9 (1/(r-1)^9-1/(r+1)^9-9/(8r) (1/(r-1)^8-1/(r+1)^8)) -
σ^3 (1/(r-1)^3 - 1/(r+1)^3-3/(2r) (1/(r-1)^2-1/(r+1)^2)))]),
{r,minroot[g,b],Infinity},
Exclusions->
{r^2*Sqrt[1-(b/r)^2-g^-2*(2/15*σ^9 (1/(r-1)^9-1/(r+1)^9-9/(8r) (1/(r-1)^8- 1/(r+1)^8))-
σ^3 (1/(r-1)^3-1/(r+1)^3-3/(2r) (1/(r-1)^2- 1/(r+1)^2)))]==0},
MaxRecursion->i,Method->{Automatic,"SymbolicProcessing"->0}];
qQ[g_?NumberQ,i_]:=
NIntegrate[2*(1-Cos[aA[g,b,i]]) b,
{b,0,10},
MaxRecursion->i, Method-> {Automatic,"SymbolicProcessing"->0}];
o[T_,i_,j_]:=
(1/T^3) NIntegrate[(g^5*qQ[g,i])/E^(g^2/T),
{g,0,Infinity},
MaxRecursion->j,
Method->{Automatic,"SymbolicProcessing"->0}];