I'm performing multidimensional Numerical integrations with mathematica I was wondering what was the default method that mathematica was using. Also i'm changing some parameter inside the integration, and for some of those (which are not known before) the integrand is very small $(\approx 0)$ and the method becomes very slow; is there an automatic way to spot this?
here is an example of the code i'm using:
Gslip33timesxintegrated[h_, λ_, θ_, l_] :=
NIntegrate[
x*distance[s, h, θ]*
Exp[-u/2]*(distance[s, h, θ] + λ*u)*
GDz[surfacecoord[x, 0, θ, ν, h][[1]] -
imagelinedensitycoord[s, θ, h][[1]],
surfacecoord[x, 0, θ, ν, h][[2]] -
imagelinedensitycoord[s, θ, h][[2]],
surfacecoord[x, 0, θ, ν, h][[3]] -
imagelinedensitycoord[s, θ, h][[3]] + λ*u][[
3]] -x*distance[s, h, θ]*Exp[-u/2]*
GSDzz[surfacecoord[x, 0, θ, ν, h][[1]] -
imagelinedensitycoord[s, θ, h][[1]],
surfacecoord[x, 0, θ, ν, h][[2]] -
imagelinedensitycoord[s, θ, h][[2]],
surfacecoord[x, 0, θ, ν, h][[3]] -
imagelinedensitycoord[s, θ, h][[3]] + λ*u][[
3]], {x, -l, l}, {s, -l, l}, {u, 0, Infinity}];
Where the function GDz and GSDzz are defined in the following way:
GDz[x_, y_, z_] = -D[sourcesing[x, y, z], z];
GSDzz[x_, y_, z_] = -D[stokesletz[x, y, z], z];
In turn the functions sourcesing and stokesletz are defined as:
sourcesing[x_, y_, z_] =
{(x/(Sqrt[x^2 + y^2 + z^2])^(3)), (y/(Sqrt[
x^2 + y^2 + z^2])^(3)), (z/(Sqrt[x^2 + y^2 + z^2])^(3))};
stokesletz[x_, y_, z_] =
{{1/(Sqrt[
x^2 + y^2 + z^2]) + (x^2)/((Sqrt[x^2 + y^2 + z^2])^3), (x*
y)/((Sqrt[x^2 + y^2 + z^2])^3), (x*
z)/((Sqrt[x^2 + y^2 + z^2])^3)}, {(x*
y)/((Sqrt[x^2 + y^2 + z^2])^3),
1/(Sqrt[x^2 + y^2 +
z^2]) + (y^2)/((Sqrt[x^2 + y^2 + z^2])^3), (y*
z)/((Sqrt[x^2 + y^2 + z^2])^3)}, {(x*
z)/((Sqrt[x^2 + y^2 + z^2])^3), (y*
z)/((Sqrt[x^2 + y^2 + z^2])^3),
1/(Sqrt[x^2 + y^2 +
z^2]) + (z^2)/((Sqrt[x^2 + y^2 + z^2])^3)}}.{0, 0, 1};
the argument of the functions GDz and GSDzz is the difference between the components of the following two vectors:
surfacecoord[x_, r_, θ_, ν_, h_] =
{x*Cos[θ] + r*Sin[θ] Sin[ν], r*Cos[ν],
x*Sin[θ] + h - r*Cos[θ]*Sin[ν]};
imagelinedensitycoord[s_, θ_, h_] = {s*Cos[θ], 0,
s*Sin[θ] - h};
Finally the function distance is defined as:
distance[s_, h_, θ_] = h - s*Sin[θ];
what typically happens is that when $\theta$ is close to zero the integrand is nearly zero...