Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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]
share|improve this question
1  
Integrate[BesselJ[2, pk]*BesselJ[1, Rk], {k, 0, Infinity}, Assumptions -> p > R] –  belisarius Mar 20 at 16:10
    
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] –  belisarius Mar 20 at 16:12

1 Answer 1

up vote 0 down vote accepted
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

share|improve this answer
    
Hi. So the problem was the AccuracyGoal? Why? Also, I get a warning NIntegrate::ncvb while calculating this. –  artalexan Mar 20 at 16:32
    
@artalexan I'mon version 9, and NIntegrate doesn't show any warning. Perhaps a version or configuration mismatch –  belisarius Mar 20 at 17:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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