I have to find the values of the parametersω
and λ
that minimize the function Int[ω, λ]
defined as the sum of five quite complicated integrals of a trial function f[r, ω, λ]
, namely
a = -74.04252664070837;
b = 208.01432471151327;
d = -65.08706834153939;
A = 1.56692098226;
X0 = 3.9468;
X1 = 2.4323;
X2 = 3.6348;
f[r_, ω_, λ_] = r/Sqrt[r^2 + 2] (1 + 4 E^(-λ r) Sin[ω r])
Df[r_, ω_, λ_] = D[f[r, ω, λ], r];
j[x_, r_] = 2 A^2 r x;
g0[x_, r_] =
a + b/2 + 3 d/4 + A^2 (b + d) (x^2 + r^2) + d A^4 ((x^2 + r^2)^2 + 4 x^2 r^2);
g1[x_, r_] = j[x, r] (b + 2 d) + 4 d A^4 r x (r^2 + x^2);
Int1[ω_, λ_] = NIntegrate[(Df[r, ω, λ]^2 + f[r, ω, λ]^2/r^2) r, {r, 0, 100}];
Int2[ω_, λ_] =
Pi^1.5/A
NIntegrate[
((1 - f[r, ω, λ]^2) (1 - f[x, ω, λ]^2) r x E^(-A^2 (r^2 + x^2))
(g0[x, r] BesselI[0, j[x, r]] - g1[x, r] BesselI[1, j[x, r]])),
{x, 0, Infinity}, {r, 0, Infinity},
Method -> "LevinRule"]
Int3[ω_, λ_] =
-1/2 X0
NIntegrate[(1 - f[r, ω, λ]^2)^2 r, {r, 0, Infinity}, Method -> "LevinRule"];
Int4[ω_, λ_] =
-1/3 X1
NIntegrate[((1 - f[r, ω, λ]^2)^2 (2 + f[r, ω, λ]^2)) r, {r, 0, Infinity},
Method -> "LevinRule"];
Int5[ω_, λ_] =
1/4 X2
NIntegrate[
(1 -f[r, ω, λ]^2)^2 (f[r, ω, λ]^4 + 2 f[r, ω, λ]^2 + 3) r, {r, 0, Infinity},
Method -> "LevinRule"]
Int[ω_, λ_] = Int1[ω, λ] + Int2[ω, λ] + Int3[ω, λ] + Int4[ω, λ] + Int5[ω, λ];
I can't use any minimization algorithm since Mathematica doesn't seem to be able to minimize $Int[\omega,\lambda]$. At least I would like to plot or evaluate (also a table) $Int[\omega,\lambda]$ in a reasonable region for the parameters $0<\omega<2$ and $0<\lambda<2$ but Mathematica returns the values of very slowly $Int[\omega,\lambda]$ and for certain values in this region crashes and my pc with it.
Also, the output shows many errors. Since I'm quite new to Mathematica, I actually don't know how to solve the problem nor the best method of integration for Int2
and Int5
which seem to be the most difficult integrals to evaluate. I used also "LevinRule"
because the output of Mathematica seemed to suggest that option.
NIntegrate
. $\endgroup$\[Omega]
and\[Lambda]
before callingNIntegrate
? Also in you redefined code are missing expressions forInt2
,Int3
,Int4
,Int5
so you evaluated onlyInt1
while my main problem areInt2
andInt5
$\endgroup$