Clear Filters
Clear Filters

plot p-V-diagramm cycle process

13 views (last 30 days)
Alex2030
Alex2030 on 30 Dec 2021
Answered: Poorna on 12 Sep 2023
hey guys,
For my study I need to plot a p-V-diagramm,
here are the data:
adiabaric compression:
T1 = 343.15 K, T2 = 423.15 K
p1 = 100000 Pa, p2 = 152061.995 Pa
V1 = 0,0285 m^3, V2 = 0.0243 m^3
isobar compression:
T3 = 423.15 K, T4 = 343.15 K
p3 = 152061.995
V3 = 0.0243 m^3, V4 = 0.0197 m^3
isothermal expansion:
T5 = 343.15 K
p5 = 152061.995 Pa
p6 = 100000 Pa
V5 = 0.0197 m^3
V6 = 0.0285 m^3
I tried to plot it with folowing code:
% adiabaric compression
Vv2 = linspace(0.0285, 0.0243, 42);
Vv1 = 0.0243;
% [T1m,V1m] = ndgrid(Tv1,Vv1);
R = 8.314472;
n = 1;
p1=100000;
p=zeros(42,1);
kappa = 20.78618/12.471708;
i=1;
while i<=42
p(i) = (p1*(Vv1^kappa))./(Vv2(i)^kappa);
i=i+1;
end
% isobar compression
p3=linspace(152061, 152061, 42);
Vv3 = linspace(0.0243, 0.0197, 42);
% isothermal expansion
T = 343.15;
m=1;
Vv4 = linspace(0.0197, 0.0285, 88);
% p4 = (m*R*T)./Vv4;
% p4 = @(T,V) m*R*T./V;
p4=1.520619949963026e+05;
p5=zeros(88,1);
Vv34 = 0.0197;
j=1;
while j<=30
p5(j) = (p4*Vv34)./(Vv4(j));
j=j+1;
end
figure
plot (Vv2, p);
hold on
plot(Vv3, p3);
hold on
% plot(Vv4, p5(T,Vv4));
plot(Vv4, p5);
hold off
title('p-V-diagram')
xlabel('volume V [m^3]')
ylabel('Pressure p [Pa]')
% axis([0.02 0.03 0.5*10^5 2.1*10^5])
legend('adiabaric compression', 'isobar compression', 'isothermal expansion')
The diagramm should look like in picture in the attachment. Can someone help me to plot this diagram or explain how I can solve it numericly?
Best regards

Answers (1)

Poorna
Poorna on 12 Sep 2023
Hi Alex,
I understand that you want to plot the PV graph for the given compressions and expansions so that the resulting graph looks similar to the reference graph.
Initially, it is important to note that there are some imperfections in the given constants.
  • For an isothermal process PV should be constant, but p5*v5 is not equal to p6*v6.
  • For an adiabatic process PVɣ should be constant. The adiabatic constant that you calculated in line 9 evaluates to 5/3. But again p1*(v1^(5/3)) is not equal to p2*(v2^(5/3)).
So, I suggest you recheck the values so that all the conditions are satisfied.
Once you get all the values correct you can generate the data points for all the plots as below:
  • Adiabatic compression
v_adiabatic = linspace(0.0243, 0.0285, 42);
p_adiabatic = p1*(v1^kappa) ./ (v_adiabatic .^ kappa);
  • Isobaric compression:
v_isobar = linspace(0.0243, 0.0197, 42);
p_isobar = linspace(152061, 152061, 42);
  • Isothermal expansion
v_isothermal = linspace(0.0197, 0.0285, 88);
p_isothermal = p5*v5 ./ v_isothermal;
Hope this Helps!

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!