calulate the indicated mean pressure with a p-v diagramm

4 visualizaciones (últimos 30 días)
Julian
Julian el 21 de Jun. de 2024
Editada: Mathieu NOE el 28 de Jun. de 2024
Hello,
I have to calculate the indicated mean pressure. I have a p-v diagramm (in the attachements). I separated the two areas by finding the intersection. But know im not sure if the polyarea() function is the correct function to calculate the two areas.
The integral i have to implement is also in the attachements
(p: pressure in the cylinder; A: piston surface; V: volume of the cylinder; s: piston travel (path) as a function of the crank angle
Thanks for help!

Respuesta aceptada

Mathieu NOE
Mathieu NOE el 26 de Jun. de 2024
Editada: Mathieu NOE el 28 de Jun. de 2024
hello Julian
yes you can use polyarea, I believe you could also with trapz like in my example below (it uses this Fex submission : Fast and Robust Self-Intersections - File Exchange - MATLAB Central (mathworks.com))
results (two loops area) :
area = 71.3220 125.0467 (with trapz)
area2 = 72.5056 125.3691 (with polyarea)
code :
load('data.mat')
[x0,y0,segments]=selfintersect(x,y); % fex : https://fr.mathworks.com/matlabcentral/fileexchange/13351-fast-and-robust-self-intersections
figure(1)
plot(x,y,'b',x0,y0,'dr','markersize',15);
axis square
hold on
% compute area for each loop
for k = 1:numel(x0)
ind = (segments(k,1):segments(k,2));
x_tmp = x(ind);
y_tmp = y(ind);
% compute area
area(k) = trapz(x_tmp,y_tmp);
area2(k) = polyarea(x_tmp,y_tmp);
plot(x_tmp,y_tmp)
end
area
area2

Más respuestas (0)

Categorías

Más información sobre Elementary Polygons en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by