clear all; close all; clc
%conversion constant Celsius-Kelvin
c=273.16;
%load PianoTSacqua.mat non necessario->ho direttamente il grafico
T1= py.CoolProp.CoolProp.PropsSI('T','P',101325,'Q',0,'Water')
T_min=0+c;
T_max=600+c;
T = linspace(T_min,T_max,50000);
P = [0.01 0.1 1 5 30 100 250 500 1000]*10^5;
fh = figure;
for i=1:length (P)
for j=1:length (T)
S(i,j)= py.CoolProp.CoolProp.PropsSI('S','P',P(i),'T',T(j),'Water');
if S(i,j)<0
S(i,j)=NaN;
else
S(i,j)=S(i,j);
end
end
end
curve limite-saturazione costruzione diagramma Entropico
T_crit = py.CoolProp.CoolProp.PropsSI('Tcrit','Water')
P_crit = py.CoolProp.CoolProp.PropsSI('Pcrit','Water')
for j=1:length (T)
if T(j)>=T_min && T(j)<=T_crit;
T_sat(j)=T(j);
sliq(j)= py.CoolProp.CoolProp.PropsSI('S','T',T_sat(j),'Q',0,'Water');
svap(j)= py.CoolProp.CoolProp.PropsSI('S','T',T_sat(j),'Q',1,'Water');
else
T_sat(j)=NaN;
sliq(j)= NaN;
svap(j)= NaN;
end
end
figure(1)
hold on
plot (S,T,'--', 'Color',[17 17 17]/255)
ylim([0 T_max])
xlabel('Entropia (J/(kgK)')
ylabel('Temperatura (K)')
for i=1:length(P)
text(S(i,end), T(end), sprintf('%1.1f MPa', P(i)/10^6, 'Rotation',90))
end
plot(svap,T_sat, 'r-')
plot(sliq,T_sat, 'b-')
ylim([0 873])
save

 채택된 답변

Les Beckham
Les Beckham 2023년 4월 17일

0 개 추천

P = [1 2]*10^7; % made up data to test with
S = [1 2;
2 3];
T = [0 70;
0 100];
plot(S(1,:),T(1,:), S(2,:), T(2,:))
grid on
ylim([0 130])
xlim([0 4])
for i=1:length(P)
% text(S(i,end), T(end), sprintf('%1.1f MPa', P(i)/10^6, 'Rotation',90))
% ^ ^
% move the paren at the end to here ^---------------| paren to here
text(S(i,end), T(i,end), sprintf('%1.1f MPa', P(i)/10^6), 'Rotation',90)
% ^ also index T
end

댓글 수: 3

locatelli vinicio
locatelli vinicio 2023년 4월 18일
Perfect thanks was the parenthesis to move
Grazie mille ciao
Vinicio
Les Beckham
Les Beckham 2023년 4월 19일
You are quite welcome (prego)
Les Beckham
Les Beckham 2023년 4월 19일
If your problem is solved, would you please "Accept this answer". Thanks.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2023년 4월 17일

댓글:

2023년 4월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by