I'm trying to integrate an interpolating function, but when I use NIntegrate
, Mathematica gives me a series of error messages. I give you some examples:
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::inumri: The integrand <<1>> has evaluated to Overflow, Indeterminate, or Infinity for all sampling points in the region with boundaries {{14.6836,14.6953},{-12.0000170249736609318194678966418287302531098248437047004699707031,-12.0133777475052196583721331180072411370929330587387084960937500000}}.
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.
General::stop: Further output of NIntegrate::inumri will be suppressed during this calculation.
I hope someone will help me to solve this problem. Here is the code of a simplified version of my problem:
Ω =
ImplicitRegion[
0 <= x <= 34 && -18 <= y <=
0 && ! (12 < x < 15 && -12 < y || 15 < x < 20 && -3 < y ||
20 < x < 23 && -7 < y || 23 < x <= 34 && -3 < y), {x, y}];
RegionPlot[Ω, AspectRatio -> 0.5]
fi = NDSolve[{\!\(
\*SubsuperscriptBox[\(∇\), \({x, y}\), \(2\)]\(φ[x,
y]\)\) == NeumannValue[0,
x == 0 && -18 < y < 0 || 0 < x < 34 && y == -18 ||
x == 34 && -18 < y < -3 || x == 23 && -7 < y < -3 ||
20 < x < 23 && y == -7 || x == 20 && -7 < y < -3 ||
15 < x < 20 && y == -3 || x == 15 && -12 < y < -3 ||
12 < x < 15 && y == -12 || x == 12 && -12 < y < 0],
DirichletCondition[φ[x, y] == 1.5,
0 <= x <= 12 && y == 0],
DirichletCondition[φ[x, y] == 0.4,
23 <= x <= 34 && y == -3]}, φ, {x,
y} ∈ Ω]
φ[x_, y_] = φ[x, y] /. fi;
Integrale =
NIntegrate[D[φ[x, y], x], {x, y} ∈ Ω]