I have a dataset of x and y coordinates in UTM units, and cumulative erosion or sedimentation in depth (m) units, I need the volume of erosion or accretion in cubic metres
1 view (last 30 days)
Show older comments
I have a dataset of x and y coordinates in UTM units, and cumulative erosion or sedimentation in depth (m) units, I need the volume of erosion or accretion in cubic metres. Attaching a snap of the data received in excel sheet format. Hoping to receive a code to convert the data to volume in m^3 units. Preferably in Trapezoidal or Simpsons method.
2 Comments
Torsten
on 6 Apr 2025
I'd use "ScatteredInterpolant" to get an integration function for your erosion data depending on x and y and integrate this function using "integral2" or "trapz".
dpb
on 6 Apr 2025
Attach the file itself, nothing can do with the image...but if it is cumulative, the integration would appear already done; just multiply area by height after converting to consistent units? I don't have any of the mapping toolboxes so not sure the functions to turn the UTM coordinates into surface area.
Answers (1)
John D'Errico
on 6 Apr 2025
Edited: John D'Errico
on 6 Apr 2025
Difficult, since you don't show the data. A picture of numbers is useless. A bigger problem is your data is surely not on some nice regular domain. And that means you will need to deal with an integration over the scattered region of your data (with sort of fuzzy edges). As such, tools like trapz or integral2 will be problematic, and really not even necessary. Trapz would be completely useless. (Simpson's method makes no sense in multiple dimensions, though there are other methods available.) Beyond that, you will need to deal with a domain that may not even be convex.
What would I do?
First, triangulate the domain in (x,y). This allows you to deal with an irregular domain. That leaves you with a bunch of triangular prisms. The total volume is now just the sum of the volumes inside each triangular prism.
The simplest way to triangulate a domain is to use the MATLAB delaunay triangulation tools. But delaunay will create a convex domain, bounded by the convex hull of your data. If your domain is not convex, then delaunay will not be right. You should be able to use an alpha shape though, to triangulate a non-convex domain.
How do you compute the volume in a single triangular prism? That part is easy. The volume is simply the height of the prism, interpolated at the centroid of the triangle in (x,y), times the area of the triangular base. (This is effectively the 2-d equivalent of trapz.) By using the interpolated value at the centroid, this becomes a low order gaussian integration, which will be exact for a triangular prism with a top planar facet. And that will surely be adequate for your purposes.
Again, without seeing any data (NOT A PICTURE OF DATA) that is about the limit of what I could suggest.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!