I need to calculate two different integrals containing a Bessel function in the Laplace domain. I have tried different kinds of quadrature but didn't have any luck. I don’t know how to help Mathematica along to treat the Laplace variable (s) in the equations:
@ RolfMertig, thanks to the details. I have successfully added the inversion algorithm for time domain. But the results do not look very good and take a very long time to compute… This is really bugging me out! And I still couldn't find a way to compute this efficiently…
eq1[(s_)?NumericQ] := NIntegrate[BesselK[0, Sqrt[u^2 + s]], {u, 0, 40}];
eq2[(s_)?NumericQ] := NIntegrate[BesselK[0, Sqrt[u^2 + s]], {u, 0, -10}];
eq3[(s_)?NumericQ, (n_)?NumericQ] :=
NIntegrate[BesselK[0, Sqrt[(-Log[t])^2 + ((n^2*Pi^2)/100 + s)]]*
Cos[n*Pi*((50 + (15 - Log[t]/Sqrt[(n^2*Pi^2)/100 + s])*
Cot[30*Degree])/100)]*(1/t), {t, 0, -10*Sqrt[(n^2*Pi^2)/100 + s]}];
eq4[(s_)?NumericQ, (n_)?NumericQ] :=
NIntegrate[BesselK[0, Sqrt[(-Log[t])^2 + ((n^2*Pi^2)/100 + s)]]*
Cos[n*Pi*((50 + (15 - Log[t]/Sqrt[(n^2*Pi^2)/100 + s])*
Cot[30*Degree])/100)]*(1/t), {t, 0, 40*Sqrt[(n^2*Pi^2)/100 + s]}];
PD[s_] = (1/(s^(3/2)*100*Sin[30*Degree]))*(eq1[s] - eq2[s]) +
(2/(s*100*Sin[30*Degree]))*Sum[(1/Sqrt[(n^2*Pi^2)/100 + s])*
Cos[n*(Pi/2)]*(eq3[s, n] - eq4[s, n]), {n, 1, 10}];
SetOptions[NIntegrate, Method -> "ClenshawCurtisRule",
WorkingPrecision -> 5, MaxRecursion -> 12, AccuracyGoal -> 2];
Ni = 8;
V[i_, NN_] = (-1)^(i + NN/2)*Sum[(k^(1 + NN/2)*(2*k)!)/((i - k)!*
k!^2*(-i + 2*k)!*(-k + NN/2)!), {k, Floor[(1 + i)/2], Min[i, NN/2]}];
PD1[tD_] = (Log[2]*Sum[PD[(i*Log[2])/tD]*V[i, Ni], {i, 1, Ni}])/tD;
LogLogPlot[{PD1[y], y*Derivative[1][PD1][y]}, {y, 1, 100},
PlotStyle -> {{Black}, {Dashed, Black}}, Frame -> True]
I'm not sure if I’m missing something obvious or computing these equations in a completely rough way. Can anyone provide an insight?
eq1
seems to be fine, but I'd have done something likeeq1[s_?NumericQ] := NIntegrate[BesselK[0, Sqrt[u^2 + s]], {u, 0, -10}, Method -> "ClenshawCurtisRule"]
myself. $\endgroup$PD[]
has calls toeq1
and others when they should beeq1[s]
; also your functions being numeric preclude constructions likePD1'[y]
; you will have to implement a separate method for the derivative if you need it. $\endgroup$eq3
andeq4
have "n" it it, so you should useeq3[s_?NumericQ,n_?NumericQ]
for these and call them inPD
with 2 parameters. And you should usePD[s_]:=...
. Than you can call e.g.PD[2]
and get a value (0.0182218 + 0.0011354 I
). But the integrals seem to convert badly, because you'll get a bunch of messages, so you can't trust this value. $\endgroup$