how do I plot temperature contours on a PV diagram?
3 views (last 30 days)
Show older comments
I have a set of values of pressures(p1) and two sets of values for specific volumes (vapour(v1) & liquid(l1)) plotting these sets (v1,p1) & (l1,v1) in a LOG scale on both axes gave me a parabola looking cuve. Now I’m trying to plot two isotherms at two specific temperatures but I’m unsure how to go about it.
Any help would he appreciated, it has me really confused :(
0 Comments
Answers (1)
Star Strider
on 12 Nov 2019
Try this example —
Tv1 = linspace(273, 323, 10);
Tv2 = linspace(323, 373, 10);
Vv1 = linspace(150, 200, 10);
[T1m,V1m] = ndgrid(Tv1,Vv1);
[T2m,V1m] = ndgrid(Tv2,Vv1);
R = 0.2871;
m = 5;
% p1 = 7.8378;
% V1 = 50;
p = @(T,V) m*R*T./V;
figure
surf(T1m, V1m, p(T1m,V1m))
hold on
surf(T2m, V1m, p(T2m,V1m))
hold off
grid on
xlabel('T')
ylabel('V')
zlabel('p')
view(90,0)
Here ‘Tv1’ and ‘Tv2’ are temperature vectors, and ‘Vv1’ is a volume vector (note that they do not all have to be the same lengths because of the ndgrid calls that create matrices from the vectors). The ‘P’ anonymous function returns the pressure for values of temperature and volume. Use your own ranges for pressure, volume, and temperature. The view call is optional.
Experiment to get the result you want.
0 Comments
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!