I am trying to Plot an integral equation that involves exponential function. My code is as follow,
w=1;
L[α_] :=
NIntegrate[
1/(k + I*0.1) (
Exp[I*k*x] (Exp[Sqrt[k^2 + α/w^2]*w] - 1) (Exp[k*w] - 1 +
I*0.1) Sqrt[
k^2 + α/
w^2])/((Sqrt[k^2 + α/w^2] + k) (Exp[
Sqrt[k^2 + α/w^2]*w - Exp[k*w]]) + (Sqrt[
k^2 + α/w^2] -
k) (Exp[(k + Sqrt[k^2 + α/w^2]) w] -
1)), {k, -100, 100}];
Plot[{Re[L[10]], Re[L[100]], Re[L[500]]}, {x, -0.45, 0.45},
PlotRange -> Full].
But this integral gives a lot of oscillations which it should not. This is fig 2 in this article "https://arxiv.org/pdf/1508.00836.pdf" and Eq: 38 that I am trying to plot. Any help will be highly appreciated.
w=1;
, what are you using? I changedL[alpha_]
toL[alpha_,x_]
I changed yourI*0.1
toI/10
and addedWorkingPrecision->32
toNIntegrate
and changedPlot
toListPlot[Table
with exact rational steps, all to see if this is a precision problem. I get errors aboutNIntegrate
not being able to get 32 bits of precision and I still see the oscillations you see. Plotting your integrand shows it doesn't blow up but oscillates wildly so I am guessing that you need to find a way to tellNIntegrate
that it has to work much harder to get accurate results from your integrand. $\endgroup$k == 100
:Block[{w = 1, \[Alpha] = 10, x = 0.10}, Plot[ Abs[ 1/(k + I*0.) (Exp[ I*k*x] (Exp[Sqrt[k^2 + \[Alpha]/w^2]*w] - 1) (Exp[k*w] - 1 + I*0.) Sqrt[ k^2 + \[Alpha]/w^2])/((Sqrt[k^2 + \[Alpha]/w^2] + k) (Exp[ Sqrt[k^2 + \[Alpha]/w^2]*w - Exp[k*w]]) + (Sqrt[ k^2 + \[Alpha]/w^2] - k) (Exp[(k + Sqrt[k^2 + \[Alpha]/w^2]) w] - 1)) ], {k, -200, 200}] ]
$\endgroup$