Integration on 2D domain

26 Ansichten (letzte 30 Tage)
Gabriele Librandi
Gabriele Librandi am 28 Okt. 2017
I should compute an integral on a 2D domain which has several holes. I know the positions and the sizes of these holes. The domain looks like a square with an array of holes arranged on a square lattice (i.e. big square with a lot of ordered equi-spaced holes in it). I would like to define the domain first, mesh it afterwards, and integrate a function such that f(x,y) on it. Is this possible in Matlab? How?
Thanks in advance

Antworten (1)

Vaidyanathan Thiagarajan
Vaidyanathan Thiagarajan am 2 Nov. 2017
Bearbeitet: Vaidyanathan Thiagarajan am 2 Nov. 2017
There are many possible solutions :
Solution 1 :
The simplest is to use the principle of superposition due to linearity of the integrals. Thus, using the linearity of integrals, you could compute the required integral as :
Integral_of_f = Integral_of_f_Over_Rectangle - Integral_of_f_Over_all_holes;
Integral_of_f_Over_Rectangle can be computed numerically using the 'integral2' function as explained here :
Integral_of_f_Over_all_holes is the summation of integrals of 'f' over each of these holes. Assuming the holes are circular, the integral could be computed using one of the following ways :
a. Convert to polar coordinates and then use 'integral2' function
b. Mesh the circular hole and then use specialized quadrature rules for triangles. You can mesh the geometry using the PDE toolbox function 'generatemesh'. Please see the following for more details :
c. Directly integrate over circular regions using specialized quadrature rules developed for disks. For instance, you could use the weights and nodes as given by the following function (accounting for the difference in radius) :
Solution 2 :
Alternatively, you can do the following :
1. Create a 2D geometry with holes using CSG operations as explained here (using PDE toolbox) :
2. Generate a triangular mesh of the geometry from step 1 using 'generateMesh' function
3. Use triangular quadrature rule over every triangle of the mesh to compute the integral of 'f' over each of those triangles and then sum the result. You can use one of the following MATLAB file exchange submissions to generate the any order quadrature rule for a triangular element :
Hope it helps!
Best Regards,

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by