Integration of Numeric Data in cycle

8 vues (au cours des 30 derniers jours)
Yogan
Yogan le 11 Déc 2022
Réponse apportée : Torsten le 11 Déc 2022
Hello.
I have a data set that represents the cycle of a compressor. In the X axis is the volume and in the Y axis is the Pressure.
We know that the area inside of the cycle represents the Work done by the compressor.
How could I get this area (integral of discrete points) in MATLAB?
and applied this command line: Area = trapz(Pressure)
The output that I received is: Area = 3.2682e+03
Is that the correct approach?
I am attachin the plot.

Réponses (1)

Torsten
Torsten le 11 Déc 2022
Work on your data first so that you get a closed, non-overlapping curve. Especially "clean" the upper and the right part. Then apply "polyshape" and "area" or "polyarea".
But you should check for plausibility by looking at the graph.
r = 1;
phi = 0:2*pi/100:2*pi;
x = r*cos(phi);
y = r*sin(phi);
s = polyshape(x(1:end-1),y(1:end-1))
s =
polyshape with properties: Vertices: [100×2 double] NumRegions: 1 NumHoles: 0
a1 = area(s)
a1 = 3.1395
a2 = polyarea(x,y)
a2 = 3.1395

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by