Message Boards Message Boards

Solve the double integral with singularity using NIntegrate and speed up

Posted 5 years ago

I want to compute following double integral including singularity. f[alpha] and p(r) are the continuous functions and f[alpha] goes to zero around the UpperLimit=10. enter image description here

Due to the term 1/alpha I am not sure NIntegrate can compute the integral accurately. What should I do to obtain the accurate solution? You find attached the functions and the way i tried. (Since the expressions are quite long i did not put them here) Just the my main code:

A1 = Parallelize[
  Table[1/\[Pi] NIntegrate[
     1/\[Alpha] p[r]/Sqrt[1 - r] f[\[Alpha]]*
      Cos[\[Alpha] Cons (r - s[[k]])], {r, -1, 1}, {\[Alpha], 0, 
      UpperLimit}, 
     Method -> {"SymbolicPreprocessing", 
       "OscillatorySelection" -> False}, 
     "SingularityDepth" -> Infinity], {k, 1, NN - 1}]]

If i don't choose this method (maybe the method is not appropriate for this integral) for NIntegrate Mathematica does not give solution or it takes too much time. I also reduced the double integral to the one dimensional case using Gaussian quadrature integration rule. However the results are different from each other. So what is the best and accurate way for this integration? In addition, how can i speed up the integration ?

Thanks,

Attachments:
POSTED BY: Isa Comez
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract