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].ParallelDeveloperQueueRun::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;

   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) 

aA[g_?NumberQ,b_?NumberQ,i_]:=Pi-2 b  
    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^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},

  NIntegrate[2*(1-Cos[aA[g,b,i]]) b,
             MaxRecursion->i, Method-> {Automatic,"SymbolicProcessing"->0}];

  (1/T^3) NIntegrate[(g^5*qQ[g,i])/E^(g^2/T),
  • $\begingroup$ You might be able to answer your problem if you study the page here. $\endgroup$ – Ted Ersek Jul 13 '13 at 19:06
  • $\begingroup$ @TedErsek , do you think that is a problem only about the integration method ? $\endgroup$ – Lucas G Leite F Pollito Jul 13 '13 at 19:26

Go to the NIntegrate documentation, then from that page go to Options -> Methods -> Integration Rules, scroll to the bottom of Integration Rules, and there are examples that suggest NIntegrate will use a Cartesian product of Gaussian points if you used Method->{“GaussKronrodRule”,”GaussKronrodRule”,”GaussKronrodRule”} It seems you did that in Fortran except with MaxRecursion->0 assuming you didn't use Kronrod's extension. However, GaussKronrodRule may not be a good method for your problem. You will find MonteCarlo methods implemented in Mma here and here. MonteCarlo methods are good for quadrature in multiple dimensions when a few digits of precision are needed. Earlier I sent you here. That describes some advanced methods that can be used for quadrature in multiple dimensions. I am not familiar those methods, I don’t have access to Mma today and I haven’t had a close look at the function you want to integrate. Hence I can’t be much more help.

  • $\begingroup$ that didnt help, because it take hours to solve , and i didnt have this time ... really i cant wait, so i abort the command evaluate after 1 hour .. any ideas ? $\endgroup$ – Lucas G Leite F Pollito Jul 15 '13 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.