0
$\begingroup$

I have some function $u(x,y)$ which I'm representing using a series expansion, and I'm trying to integrate $u(x,y)\frac{\partial u(x,y)}{\partial x}$ over a diamond shaped area with coordinates $(0,-\Delta y), (\Delta x,0), (0,\Delta y),(\Delta x,0)$

In Mathematica I tried doing it as follows:

uSeries[x_, x0_, y_, y0_] = Normal@Series[u[x, y], {x, x0, 2}, {y, y0, 2}];
Integrate[uSeries[x, 0, y, 0] D[uSeries[x, 0, y, 0], x],{x, y} \[Element]Polygon[{{0, -\[CapitalDelta]y}, {\[CapitalDelta]x, 
 0}, {0, \[CapitalDelta]y}, {-\[CapitalDelta]x, 0}}], Assumptions -> \[CapitalDelta]x > 0 && \[CapitalDelta]y > 0]

When I try to evaluate this, Mathematica just spits the integral back at me. If I try other methods, such as dividing the domain into 4 triangles, Mathematica has no issues:

Integrate[uSeries[x, 0, y, 0] D[uSeries[x, 0, y, 0], x], {x, y} \[Element] 
   Triangle[{{0, 0}, {\[CapitalDelta]x, 0}, {0, \[CapitalDelta]y}}], 
  Assumptions -> \[CapitalDelta]x > 0 && \[CapitalDelta]y > 0] + 
 Integrate[
  uSeries[x, 0, y, 0] D[uSeries[x, 0, y, 0], x], {x, y} \[Element] 
   Triangle[{{0, 0}, {0, -\[CapitalDelta]y}, {\[CapitalDelta]x, 0}}], 
  Assumptions -> \[CapitalDelta]x > 0 && \[CapitalDelta]y > 0] + 
 Integrate[
  uSeries[x, 0, y, 0] D[uSeries[x, 0, y, 0], x], {x, y} \[Element] 
   Triangle[{{0, 0}, {-\[CapitalDelta]x, 0}, {0, -\[CapitalDelta]y}}],
   Assumptions -> \[CapitalDelta]x > 0 && \[CapitalDelta]y > 0] + 
 Integrate[
  uSeries[x, 0, y, 0] D[uSeries[x, 0, y, 0], x], {x, y} \[Element] 
   Triangle[{{0, 0}, {0, \[CapitalDelta]y}, {-\[CapitalDelta]x, 0}}], 
  Assumptions -> \[CapitalDelta]x > 0 && \[CapitalDelta]y > 0]

Doing a regular double integral over the domain also works fine, and yields the same results as integrating over the triangles:

Integrate[
  Integrate[
   uSeries[x, 0, y, 0] D[uSeries[x, 0, y, 0], 
     x], {x, -\[CapitalDelta]x (1 - 
       y/\[CapitalDelta]y), \[CapitalDelta]x (1 - 
       y/\[CapitalDelta]y )}], {y, 0, \[CapitalDelta]y}] +
 Integrate[
  Integrate[
   uSeries[x, 0, y, 0] D[uSeries[x, 0, y, 0], 
     x], {x, -\[CapitalDelta]x (1 + 
       y/\[CapitalDelta]y), \[CapitalDelta]x (1 + 
       y/\[CapitalDelta]y)}], {y, -\[CapitalDelta]y, 0}]

Any ideas why the integration over the Polygon fails?

$\endgroup$
2
  • $\begingroup$ The integration over {x,y} elem someDomain is numerical. The polygon vertices should be numerically fixed. $\endgroup$ Sep 22, 2017 at 14:57
  • $\begingroup$ That seems to be contradicted by the fact that the integration over the triangular domains I mentioned in the original quesiton does work. $\endgroup$ Sep 22, 2017 at 15:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.