calulate the indicated mean pressure with a p-v diagramm
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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!
0 commentaires
Réponse acceptée
Mathieu NOE
le 26 Juin 2024
Modifié(e) : Mathieu NOE
le 28 Juin 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
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Elementary Polygons dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!