I would like to define the following function $F(A,\nu)$, which is the result of a numerical integration, and needs the following function definitions.
χ[x_] := (1 - x^2) Exp[-x^2/2.]
v1[x_, T_, A_, ν_] :=
Sqrt[2 ν A] (-Tanh[Sqrt[A/ 2. ν] (x - Sqrt[-Sqrt[A] T])] +
Tanh[Sqrt[A/ 2. ν] (x + Sqrt[-Sqrt[A] T])])
u1[x_, T_, A_, ν_] := v1[x, T, A, ν]/v1[0., T, A, ν]
P[x_, T_] := -x Abs[x]/(8. T^2)
F[A_?NumericQ, ν_?NumericQ] :=
NIntegrate[
P[x, T] u1[x, T, A, ν] P[y, T] u1[y, T, A, ν] χ[
x - y], {y, - Infinity, Infinity}, {x, - Infinity,
Infinity}, {T, -Sqrt[A], -1/Sqrt[A]}, WorkingPrecision -> 6]
$F(A,\nu)$ is the integral of the product of the function $P(x,T)\, u_1(x,T,A,\nu)$ (displayed in the image) at two different points, x and y, and a kernel $(1-x^2) \exp(-x^2/2)$. The image was generated for $T=-10.$, $A=10.$ and $\nu=100.$ (these are typical values for these variables, $T$ is always negative and $A$ is always larger than 1).
The evaluation of this function takes a long time and returns some numerical warnings. For instance,
F[1000., 100.]
returns these messages:
NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.
NIntegrate::eincr: The global error of the strategy GlobalAdaptive has increased more than 2000 times. The global error is expected to decrease monotonically after a number of integrand evaluations. Suspect one of the following: the working precision is insufficient for the specified precision goal; the integrand is highly oscillatory or it is not a (piecewise) smooth function; or the true value of the integral is 0. Increasing the value of the GlobalAdaptive option MaxErrorIncreases might lead to a convergent numerical integration. NIntegrate obtained 288.76382016096916666703282912247185710989612309233822429
56. and 5.4011184087238421426993848117761301626885820484484066096
56. for the integral and error estimates.
What options can I use for better convergence of this integral, and how can I decide which method is the best, from looking at the properties of the integrand?
WorkingPrecision
less than machine precision? In any case if you want to go to high precision you,ll need to specify exact values for your literals ( make8.
8
, etc) $\endgroup$0
is not in theT
interval, so the integrand is ok (or if not, I haven't discovered the pathological part). $\endgroup$