How to integrate discrete values over a surface
Show older comments
I'm working on the outputs from a numerical model in which I've used a quadrangular mesh around a cylinder. Each element is defined by its coordinates (x, y) and the corresponding value of the parameter that I want to integrate so I have 3 different arrays containing these information.
My problem is related to the domain because I'm working with two circles, one inside the other (e.g. a plate with a hole) and the data related to the smaller one are NaN. I've tried to use trapz in order to get the difference between the two integrals but of course it didn't work. Is there any other way on how to do this?
2 Comments
darova
on 28 Dec 2019
Do you have a picture? Please attach the data
Valeria Marangon
on 28 Dec 2019
Accepted Answer
More Answers (2)
darova
on 28 Dec 2019
0 votes
If your mesh if fine enough you can just multiply sides

For better precision cross product can be used
3 Comments
John D'Errico
on 28 Dec 2019
I think you mistake, that the problem is not to compute the area of a rectangle, but the integral of a function over such a domain, where the function value is given at the vertices of each rectangle in a mesh. But that is just a complete conjecture at this point.
darova
on 28 Dec 2019
- But that is just a complete conjecture at this point.
good
John D'Errico
on 29 Dec 2019
Edited: John D'Errico
on 29 Dec 2019
Actually, I was kind of close, though the area of a quadrilateral does figure into the solution. They were not rectangles though.
Deepanjan Das
on 13 Sep 2021
0 votes
Hi, I am simulating a very simple 2d electrostatic model in Matlab. I have calculated the electric field over a rectangular surface. Now I want to evaluate
. So I know the electric field value at each node but not the function. How can I do the integration? Please let me know. Thanks in advance.
2 Comments
darova
on 13 Sep 2021
Are
and
always the same?
Deepanjan Das
on 13 Sep 2021
Edited: Deepanjan Das
on 13 Sep 2021
No, it depends on the created mesh. Around the boundaries the elements are much smaller in size.
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
