| Author |
Comment/Response |
Michael
|
07/05/12 03:01am
Hi,
I've been trying to think how best to answer. Certainly it can be done. It's not clear what you know about your functions. Do you know them only at the points of the triangulation? Or do you know the formulas (e.g. for the density)?
If you want to do an approximate integral based on the triangular mesh, you can sum up for each triangle {P, Q, R}, the vertices in counterclockwise order,
1/6 (f[Px, Py] + f[Qx, Qy] + f[Rx, Ry]) (Px Qy + Qx Ry +
Rx Py - (Py Qx + Qy Rx + Ry Px))
where f is the function. If you can get a list of the triangles, you can use the function Sum to do this.
Another way is to parametrize the region and use a double integral.
Yet another way is that you might get lucky and be able to use Green's Theorem and use a line integral.
The notebook in the URL shows one way to compute the centroid of a polygon( CountryData's polygon for Italy, which seemed like a complex domain, unless you meant a domain in the complex numbers).
Anyway, I hope it might help you get started.
URL: https://www.dropbox.com/sh/d4htdmemfd4j0xr/r6ZWPFixeM/LineIntegral-Polygon.nb, |
|