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 Center および File ExchangeElementary Polygons についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by