1
$\begingroup$

This integration has an analytical solution and its behavior is described by 1/r^2 function, but Mathematica gives some weird oscillating answer. Can anybody explain this and help me overcome this issue.

R  = 1500;
f[r_] := NIntegrate[BesselJ[2, r*k]*BesselJ[1, R*k], {k, 0, Infinity},AccuracyGoal -> 12]
sol = Table[Abs[f[r]]^2, {r, R, 2000, 10}];
ListLinePlot[sol, PlotRange -> All]
$\endgroup$
2
  • 1
    $\begingroup$ Integrate[BesselJ[2, pk]*BesselJ[1, Rk], {k, 0, Infinity}, Assumptions -> p > R] $\endgroup$ Mar 20 '14 at 16:10
  • $\begingroup$ Numerically R = 1500; f[r_] := NIntegrate[BesselJ[2, r*k]*BesselJ[1, R*k], {k, 0, Infinity}] sol = Table[Abs[f[r]]^2, {r, R, 2000, 10}]; ListLinePlot[sol, PlotRange -> All] $\endgroup$ Mar 20 '14 at 16:12
0
$\begingroup$
R = 1500;
f[r_] := NIntegrate[BesselJ[2, r*k]*BesselJ[1, R*k], {k, 0, Infinity}]
sol = Table[Abs[f[r]]^2, {r, R, 2000, 10}];
ListLinePlot[sol, PlotRange -> All]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Hi. So the problem was the AccuracyGoal? Why? Also, I get a warning NIntegrate::ncvb while calculating this. $\endgroup$
    – bordart
    Mar 20 '14 at 16:32
  • $\begingroup$ @artalexan I'mon version 9, and NIntegrate doesn't show any warning. Perhaps a version or configuration mismatch $\endgroup$ Mar 20 '14 at 17:34

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.