Double integral over triangle with known nodes

I2=I2/3^2; %I2 is actually 3 times biggerIn summary, the conversation discusses the general analytic solutions to various integrals, specifically the first and second moments of area, over a triangle with given coordinates. The solution involves converting the integrals to u and v variables, calculating the area of the triangle, and then integrating over these variables. The final solution does not depend on the original x and y variables, but rather only on the coordinates of the triangle. This method can be applied to various types of triangles as long as the appropriate variables and limits are used in the integration.
  • #1
Zhigang Wei
1
0
I am wondering is there any general analytic solutions to the following integrals

First moment of area
Integral(xdxdy)
Integral(ydxdy)

Second moment of area)
Integral(x^2dxdy)
Integral(y^2dxdy)
Integral(xydxdy)

Over the triangle (x1,y1) (x2,y2) (x3,y3)

thanks

Wei
 
Physics news on Phys.org
  • #2
It looks like basic Calculus III with some attention to different cases (x1< x2< xc3 or x1< x3< x2, etc.).

Assuming that x1< x2< x3 and that y2 is larger than either y1 or y3, We can integrate from the line between (x1, y1) and (x3, y3) to the line between (x1, y1) to (x2, y2) for x going from x1 to x2, then from the line between (x1, y1) and (x3,y3) to the line between (x2,y2) and (x3,y3).

The line between (x1, y1) and (x3, y3) is given by y= y1+ ((y3- y1)/(x3-x1))(x- x1) and the line between (x1, y1) and (x2, y2) is given by y= y1+ ((y2- y1)/(x2- x1))(x- x1) so that first integral would be
[tex]\int_{x= x1}^{x2}\int_{y= y1+ ((y3- y1)/(x3- x1))(x- x1)}^{y1+ ((y2-y1)/(x2-x1))(x- x1)}f(x,y) dydx[/tex]
where f(x,y) is x, y, x^2, y^2, or xy.
 
  • #3
I suppose this will work for given type of triangle, I am not going to check it. But most people need universal solution. I took me a lot of time to get to this and it works (all is written in Matlab code).

Lets say you have triangle (x1,y1) (x2,y2) (x3,y3) and you want to calculate integral I=x^2+y^2 over it.

First you need to declare:
x=(1-u)*x1+u*((1-v)*x2+v*x3);
y=(1-u)*y1+u*((1-v)*y2+v*y3);

Then simple do integral I1=u*I(v) from 0 to 1, and then I2=I1(v) from 0 to 1. And then you have to multiply result by 2 areas of triangle.

This works great for me i tested it, and I get great results. Matlab code would be something like this:

syms x1 y1 x2 y2 x3 y3 x y u v
x=(1-u)*x1+u*((1-v)*x2+v*x3);
y=(1-u)*y1+u*((1-v)*y2+v*y3);
A=(x2*y1 - x1*y2 + x1*y3 - x3*y1 - x2*y3 + x3*y2)/2;
%A is area (watch for orientation of nodes clockwise/counterclockwise
I=x^2+y^2;
I2=2*A*int(int(u*I,v,0,1),u,0,1);

Let me know what you think
 
  • #4
x=(1-u)*x1+u*((1-v)*x2+v*x3);
y=(1-u)*y1+u*((1-v)*y2+v*y3);
%this way you went form x,y to u,v

I=x^2+y^2;
%concerning first change from x,y to u,v I should be:
%I=(u*(v*x3 - x2*(v - 1)) - x1*(u - 1))^2 + (u*(v*y3 - y2*(v - 1)) - y1*(u - 1))^2

A=(x2*y1 - x1*y2 + x1*y3 - x3*y1 - x2*y3 + x3*y2)/2;
%A is area of triangle (watch for orientation of nodes clockwise/counterclockwise not to get negative area)

I1=int(u*I,v,0,1);
%first integral ∫u*I(v) from 0 to 1
%solution is:
%I1=(u^3*(x2 - x3)^2)/3 + (u^3*(y2 - y3)^2)/3 + u*(u*x2 - x1*(u - 1))^2 + u*(u*y2 - y1*(u - 1))^2 - u^2*(u*x2 - x1*(u - 1))*(x2 - x3) - u^2*(u*y2 - y1*(u - 1))*(y2 - y3)
%notice that there is no longer v

I2=2*A*int(I1,u,0,1);
%twice area of triangle times second integral ∫I1(u) from 0 to 1
%solution is:
%I2=-(x1*y2 - x2*y1 - x1*y3 + x3*y1 + x2*y3 - x3*y2)*(x1^2/12 + (x1*x2)/12 + %(x1*x3)/12 + x2^2/12 + (x2*x3)/12 + x3^2/12 + y1^2/12 + (y1*y2)/12 + (y1*y3)/12 + y2^2/12 + (y2*y3)/12 + y3^2/12);
%finally you got solution without x, y, u or v just through nodes of triangle
 

1. What is a double integral over a triangle with known nodes?

A double integral over a triangle with known nodes is a mathematical calculation that involves integrating a function over a two-dimensional region that is bounded by a triangle with known coordinates. This type of integral is commonly used in physics, engineering, and other scientific fields to calculate areas, volumes, and other quantities.

2. How do I calculate a double integral over a triangle with known nodes?

To calculate a double integral over a triangle with known nodes, you will need to first determine the limits of integration for both the x and y variables. This can be done by plotting the triangle and identifying the coordinates of each vertex. Then, you can use the appropriate integration formula to solve for the double integral.

3. What are the applications of a double integral over a triangle with known nodes?

A double integral over a triangle with known nodes has many applications in science and engineering. It can be used to calculate the mass, center of mass, and moments of inertia of a two-dimensional object. It is also commonly used in fluid mechanics to calculate the flow rate of a liquid over a triangular region.

4. Can a double integral over a triangle with known nodes be solved numerically?

Yes, a double integral over a triangle with known nodes can be solved numerically using numerical integration methods such as Simpson's rule or the trapezoidal rule. These methods involve dividing the region into smaller, simpler shapes and then summing up the contributions from each shape to approximate the integral.

5. Are there any special cases or conditions for calculating a double integral over a triangle with known nodes?

Yes, there are a few special cases and conditions to keep in mind when calculating a double integral over a triangle with known nodes. These include when the triangle is a right triangle or an equilateral triangle, or when the function being integrated has singularities or discontinuities within the region. In these cases, special techniques or adjustments may be needed to accurately solve the integral.

Similar threads

Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Calculus
Replies
8
Views
2K
Replies
7
Views
2K
Replies
1
Views
1K
Replies
7
Views
1K
  • General Math
Replies
3
Views
877
  • Calculus and Beyond Homework Help
Replies
10
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
Back
Top