How can I plot a curve with given x and y variables?

조회 수: 3 (최근 30일)
Eduard Spomer
Eduard Spomer 2022년 4월 25일
댓글: Eduard Spomer 2022년 4월 25일
Hello guys,
I have to plot a p-V Diagramm in thermodynamics. Its the isentropic compression from 1->2.
How can I do the curve? I got the straight line from this code.
p = linspace(p1, p2, ); p1=1 p2= 32
V=linspace(V1, V2, ); V1= 2176 V2= 181
plot([V], [p])
Is it possible to create a curve with this code? Or hould I use a funciton for the gradient? Maybe y = -K*(p/V) or p = @(T,V) m*R*T./V;
Best Regards Edi
  댓글 수: 2
Mathieu NOE
Mathieu NOE 2022년 4월 25일
hello
the topic has been already addressed in this forum
you can expand this code by adding those lines :
figure
plot(Vv1, p(Tv1,Vv1), 'LineWidth',2)
hold on
plot(Vv1, p(Tv2,Vv1), 'LineWidth',2)
plot(Vv1(1)*[1 1], p([Tv1(1) Tv1(end)],[1 1]*Vv1(1)), '-g', 'LineWidth',2)
plot(Vv1(end)*[1 1], p([Tv2(1) Tv2(end)],[1 1]*Vv1(end)), '-g', 'LineWidth',2)
hold off
grid
xlabel('V')
ylabel('p')
axis([125 225 2.0 3.3])
legend('T(273 - 323)', 'T(323 - 373)')
Eduard Spomer
Eduard Spomer 2022년 4월 25일
Think you very much for your answer. I already saw this and i didnt get it but i try it Again now.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Thermodynamics and Heat Transfer에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by