Plotting the graph of change in Work wrt Crank Angle Degree

3 ビュー (過去 30 日間)
Vishwajeet Ranjane
Vishwajeet Ranjane 2021 年 4 月 1 日
回答済み: darova 2021 年 4 月 2 日
I am trying to plot the graph of Work with respect to Crank Angle Degrees. I have tried the code in following way.
% The pressure data
pressure=xlsread('C:\Users\HP\Desktop\PROJECT WORK\Data.csv','M2:M1242');
Q=pressure*100;
% The Volume data
volume=xlsread('C:\Users\HP\Desktop\PROJECT WORK\Data1.csv','C2:C1242');
Z=volume*10^-9;
P0=101.325;
x=-160:0.25:150;
n=numel(x);
V= zeros(n,1);
w= zeros(n,1);
A= zeros(n,1);
for i= 1:numel(x)
v=Z(i);
V(i)=((0.249)*(10^-3))*sind(x(i)).*(1+((0.28*cosd(x(i)))./(sqrt(1-(0.0784*(sind(x(i)))^2)))));
P=Q(i);
w(i)=(P-P0).*V(i);
A(i)=trapz(i, w);
end
plot(x,A','r')
X axis values are in Crank Angle Degrees
Y axis values are in Kilo Joules (kJ)
Kindly Suggest me the following things:
1.) If the code that I have written is correct.
2.) If the syntax for trapezoidal rule for Integration is right.
3.) How to check where the errors in getting the exact plot lies
  2 件のコメント
darova
darova 2021 年 4 月 1 日
Please attach original equations
Vishwajeet Ranjane
Vishwajeet Ranjane 2021 年 4 月 2 日
Dear Sir/ Mam,
I need to plot the values for W at each value of x. The values of x vary from x(i=1)= -50 to x(i=100)= +50. W Vs x is the plot that I want to obtain. The equation is attached over here. Kindly help. The P values at each x are available.
Thanks and Regards

サインインしてコメントする。

回答 (1 件)

darova
darova 2021 年 4 月 2 日
What about limits? Here are limits for . But what about limits for ?
I think this line should be changed
%A(i)=trapz(i, w);
A(i) = trapz(x(1:i),w(1:i));
Read about cumtrapz

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by