I am attempting to compute a numerical integral but I seem to not get the desired numerical stability. The integral in question is
num[c_, w_, prec_, rec_] := NIntegrate[
SetPrecision[(y^((2*π)/11*(1/w - c) + 1)*E^-y)/(1-(y*11*w)/(2*π)),prec+1],
{y,0,SetPrecision[(2*π)/11*1/w,prec+1],∞},
WorkingPrecision->prec,
MinRecursion->rec,
Method-> "PrincipalValue"
]
for instance, if I evaluate
num[1, 0.1, 30, 3]=-145.67943817523307026331395062
where I get many error messages. But If I increase the working precision and the amount of minimal recursion I instead get
num[1, 0.1, 40, 4]=-10171.12237422827887743490803771360414548
which is totally different from the previous result. I have attempted going to higher values in the arguments prec and rec but I do not get any kind of stability. I think I am making a suboptimal use of NIntegrate. I have attempted reading the NIntegrate pages online, and I have attempted playing with AccuracyGoal and PrecisionGoal but I haven't really obtained any improvement. How should I improve my expression?
num
it with exact input:num[1, 1/10, 40, 3]
. Or, in the body ofnum
, set the precision of the inputs to higher precision before submitting them toNIntegrate
. $\endgroup$