0
$\begingroup$

I want to evaluate the following integral numerically

NIntegrate[w E^(-w/0.001)/(w(w-0.0001))^2), {w,0, 0.0001, 1},
MaxRecursion -> 300, AccuracyGoal -> 10, Method -> "PrincipalValue"]

It gives the error

Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small

It seems that a lot of questions arose regarding this problem in the community, but I didn't find any concrete solution. I really appropriate if anyone help me out with a solution?

$\endgroup$
2
  • $\begingroup$ It seems that w=0 is another location of singularity? $\endgroup$ – tablecircle Nov 13 '16 at 5:58
  • $\begingroup$ @tablecircle Yeah. But I think that the principal value method takes care of that. $\endgroup$ – New Developer Nov 13 '16 at 6:42
2
$\begingroup$

Your Integral doesn't converge at all, it is Infinity, therefore the error message. As you see, the Denominator ist 0 at w=0 and at w=.0001. Make a logarithmic Plot to see it. Next hint: often it is better to use rationalized values instead of real numbers. Principalvalue only makes sense, if a positive part at the singularity is compensated by an equal large negative part. You have only positive parts at 0 and .0001.

       In[60]:= LogPlot[w E^(-w/0.001)/(w (w - 0.0001))^2, {w, 0, .0002}, 
MaxRecursion -> 15]

   In[9]:= w E^(-w 1000)/(w (w - 1/10000))^2

 Out[9]= E^(-1000 w)/((-(1/10000) + w)^2 w)

  In[38]:= Plot[((-(1/10000) + w)^2 w), {w, 0, 2/10000}]

  In[27]:= sol = Solve[(-(1/10000) + w)^2 w == 0, w]

   Out[27]= {{w -> 0}, {w -> 1/10000}, {w -> 1/10000}}

   In[29]:= E^(-1000 w) /. sol // N

   Out[29]= {1., 0.904837, 0.904837}

   In[35]:= 1/((-(1/10000) + w)^2 w) // ExpandAll

  Out[35]= 1/(w/100000000 - w^2/5000 + w^3)

   In[57]:= Integrate[w E^(-w 1000)/(w (w - 1/10000))^2, {w, 0,   1/100000}]

    During evaluation of In[57]:= Integrate::idiv: Integral of      E^(-1000 w)/((-(1/10000)+w)^2 w) does not converge on {0,1/100000}. >>

    Out[57]= \!\(
   \*SubsuperscriptBox[\(\[Integral]\), \(0\), 
   FractionBox[\(1\), \(100000\)]]\(
  \*FractionBox[
  SuperscriptBox[\(E\), \(\(-1000\)\ w\)], \(
  \*SuperscriptBox[\((\(-
  \*FractionBox[\(1\), \(10000\)]\) + 
       w)\), \(2\)]\ w\)] \[DifferentialD]w\)\)

     In[58]:= Integrate[w E^(-w 1000)/(w (w - 1/10000))^2, {w,   1/100000, 1}]

     During evaluation of In[58]:= Integrate::idiv: Integral of      E^(-1000 w)/((-(1/10000)+w)^2 w) does not converge on {1/100000,1}. >>

    Out[58]= \!\(
  \*SubsuperscriptBox[\(\[Integral]\), 
  FractionBox[\(1\), \(100000\)], \(1\)]\(
  \*FractionBox[
 SuperscriptBox[\(E\), \(\(-1000\)\ w\)], \(
  \*SuperscriptBox[\((\(-
 \*FractionBox[\(1\), \(10000\)]\) + 
   w)\), \(2\)]\ w\)] \[DifferentialD]w\)\)

     In[64]:= Plot[
     w E^(-w 1000)/(w (w - 1/10000))^2, {w, -1/100000, 1/100000}]

     In[65]:= NIntegrate[
    w E^(-w 1000)/(w (w - 1/10000))^2, {w, -1/100000, 0, 1/100000}, 
    Method -> "PrincipalValue"]

     Out[65]= 3.82496*10^7
$\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.