calulate the indicated mean pressure with a p-v diagramm

조회 수: 4 (최근 30일)
Julian
Julian 2024년 6월 21일
편집: Mathieu NOE 2024년 6월 28일
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!

채택된 답변

Mathieu NOE
Mathieu NOE 2024년 6월 26일
편집: Mathieu NOE 2024년 6월 28일
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개)

카테고리

Help CenterFile Exchange에서 Elementary Polygons에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by