1
$\begingroup$

I know there are lots of posts like this one, but there is no hope for me to adopt any other experiences since the task seems to be very specific, at least from my level of understanding.

I have to integrate the function:

t = 0.2; w = 1; a = 4/w^2;

XX[lf_, mf_, l_, mg_, p_] := Abs[YY[lf, mf, l, mg, p]]^2;
YY[lf_, mf_, l_, mg_, p_] :=WignerD[{lf, mf, l}, t] Exp[-((a r^2)/4)] Sum[((Abs[mg - l] + p)!/((p - j)! (Abs[mg - l] + j)! j!)) (Sqrt[2]/w)^(2 j + mg - l) (2/a)^(2 j + mg - l + 1) (Gamma[.5 (Abs[mg - mf] + mg - l + 2 + 2 j)]/(r Gamma[Abs[mg - mf] + 1])) a^(0.5 (2 j + mg - l + 1)) ((a r^2)/2)^(1/2 Abs[mg - mf] + .5)Hypergeometric1F1[( Abs[mg - mf] - 2 j - mg + l)/2, Abs[mg - mf] + 1, (a r^2)/4], {j, 0, p}];
MLG[lf_, l_, mg_, p_] := Sum[XX[lf, ii, l, mg, p], {ii, -lf, lf, 1}];
Res1 = (MLG[2, 1, 3, 0] - MLG[2, -1, 1, 0])/(MLG[2, 1, 3, 0] + MLG[2, -1, 1, 0]);

NIntegrate[Res1, {r, 0, 1000}, MaxPoints -> 500000, PrecisionGoal -> 10, MaxRecursion -> 50, WorkingPrecision -> 10]

I get the following message

enter image description here

which is, unfortunately, not surprising.

If I plot the function, I do see the singularity close to zero and diverging behavior at big $r$

enter image description here

But maybe there is still a way to evaluate this. If not directly, maybe someone can suggest tricks...

I tried to use FullSimplify and Rationalize to make it nicer, but the expression is so complicated that the calculation takes forever.

$\endgroup$
  • 1
    $\begingroup$ NIntegrate[Simplify[Res1, 0<r<1000], {r,0.01,1000}, MaxPoints->500000, PrecisionGoal->10, MaxRecursion->50, WorkingPrecision->10] completes almost instantly with a result 999.9900000 but Plot[Simplify[Res1, 0<r<1000], {r,.01,1000}, WorkingPrecision->32, PlotRange->All] seems to indicate the answer should be much closer to 317.9. Even NIntegrate[Simplify[Res1, 0<r<1000], {r,0.01,1000}] quickly yields 689.639 with a couple of warnings $\endgroup$ – Bill Dec 2 '16 at 3:59
  • $\begingroup$ Changing approximate numbers to exact ones (2/10 for 0.2, 1/2 for 0.5) throughout, then NIntegrate[Res1, {r, 0, 1000}, PrecisionGoal -> 8, WorkingPrecision -> 50] works. That suggests there's too much rounding error in your integrand. $\endgroup$ – Michael E2 Aug 20 '17 at 17:34
2
$\begingroup$
t=0.2;w=1;a=4/w^2;

XX[lf_,mf_,l_,mg_,p_,r_]:=Abs[YY[lf,mf,l,mg,p,r]]^2;
YY[lf_,mf_,l_,mg_,p_,r_]:=WignerD[{lf,mf,l},t] Exp[-((a r^2)/4)]Sum[((Abs[mg-l]+p)!/((p-j)! (Abs[mg-l]+j)! j!)) (Sqrt[2]/w)^(2 j+mg-l) (2/a)^(2 j+mg-l+1) (Gamma[.5 (Abs[mg-mf]+mg-l+2+2 j)]/(r Gamma[Abs[mg-mf]+1])) a^(0.5 (2 j+mg-l+1)) ((a r^2)/2)^(1/2 Abs[mg-mf]+.5)Hypergeometric1F1[(Abs[mg-mf]-2 j-mg+l)/2,Abs[mg-mf]+1,(a r^2)/4],{j,0,p}];
MLG[lf_,l_,mg_,p_,r_]:=Sum[XX[lf,ii,l,mg,p,r],{ii,-lf,lf,1}];
Res1[r_?NumericQ]:=(MLG[2,1,3,0,r]-MLG[2,-1,1,0,r])/(MLG[2,1,3,0,r]+MLG[2,-1,1,0,r]);

NIntegrate[Res1[r],{r,0,1000},MaxPoints->500000,PrecisionGoal->10,MaxRecursion->50,WorkingPrecision->10]

Let Res1 only accept numerical values did the trick for me. I guess, otherwise MMA tries some symbolic processing of the function and fails.

$\endgroup$

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.