MATLAB Answers

Integral evaluation in an alphashape

2 views (last 30 days)
berk can acikgoz
berk can acikgoz on 11 Mar 2020
Edited: Matt J on 12 Mar 2020
I have an alphashape created by alphaShape function and an integral. Is there a way to evaluate this volume integral in the alpha shape? i.e. I have a function and I want to find the volume integral of this function in the shape defined by
x coordinates:
0
0.0107
0.0160
0.0101
y coordinates:
0
0
0
0.0106
z coordinates:
0
0.0101
0
0

  5 Comments

Show 2 older comments
darova
darova on 11 Mar 2020
I plotted the sphere and points. Looks as following:
You want to calculate the volume numerically?
I found some links for area calculation: wolfram
berk can acikgoz
berk can acikgoz on 12 Mar 2020
It is actually a volume integral. Also it is a tetrahedral. I know how to integrate 3D but i dont want to since there are too many of these tetrahedrals and each time i will have to calculate the integration boundaries etc.
darova
darova on 12 Mar 2020
What about triangulation?

Sign in to comment.

Answers (1)

Matt J
Matt J on 11 Mar 2020
Edited: Matt J on 11 Mar 2020
Perhaps as follows. Here, shp refers to your alphaShape object.
fun=@(x,y,z) (x.^2+y.^2+z.^2).*shp.inShape(x,y,z);
range=num2cell( [min(shp.Points);max(shp.Points)] );
result=integral3(fun,range{:});

  7 Comments

Show 4 older comments
Matt J
Matt J on 12 Mar 2020
Is the calculated integral value very different in each case? And what does "unacceptably slow" mean? How fast is it meant to be?
berk can acikgoz
berk can acikgoz on 12 Mar 2020
Integral is calculated allright. But it takes 182 seconds to evaluate the integral
Matt J
Matt J on 12 Mar 2020
If both versions give the same result, then go back to the first method (the fast one) and ignore the warnings.

Sign in to comment.

Sign in to answer this question.


Translated by