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 Center および File ExchangeThermodynamics 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