Hi, I hope you are all doing well. I would like to plot the results of this integral as a function of “A”. However, when “A” reaches a certain value, the integral starts to diverge, resulting in a drop in the graph. If anyone has any ideas on how to solve this problem, I would greatly appreciate it. Thank you all in advance.
Just above r == 1000, the integrand underflows, even with arbitrary precision.
Table[func, {r, {1.`16*^3}}, {A, 10^Range[-4, 7]}] (* really small numbers *)
Table[func, {r, {2.`16*^3}}, {A, 10^Range[-4, 7]}] (* Underflow[] *)
For just above r == 0.0008, it underflows at machine precision. Perhaps you can truncate the integration interval to {r, 0, 0.001}. For large values of A, it takes forever, though.
Perhaps the problem can be rescaled to better fit with floating-point numbers, but I have doubts it will be much more effective.
With rescaling works fine:
Regards M.I
Nice, as usual. From my view, it’s the FullSimplify that makes the problem feasible. One can integrate to “infinity” by just going out to 0.001. NIntegrate does not sample very high in this case. If you want to break your approach
try this:
NIntegrate[newfunc /. A -> 1000, {t, 0, 10000, Infinity}]
With arbitrary precision, one can avoid problems with high values of A and extend the plot to A = 10^10 (using your simplified func).
LogLogPlot[
Abs[NIntegrate[func, {r, 0, 1*^-3}, PrecisionGoal -> 6,
WorkingPrecision -> 32]], {A, 10^-10, 10^10}, PlotRange -> All,
WorkingPrecision -> 32]
Thank you all. If I change the ABS to ArcSin, I’m not sure if this will still work, though
