Project 2 - Rankine cycle Simulator
% Rankine Cycle
% steam condition at the inlet of the turbine
% consider pressure in bar
clear all
close all
clc
p1=44;
t1=583;
p2=5.83;
% at stage 1
h1=XSteam('h_pT',p1,t1)
s1=XSteam('s_pT',p1,t1)
% at stage 2
s2=s1;
h2=XSteam('hV_p',p2)
% at stage 3
p3=p2;
h3=XSteam('hL_p',p3)
s3=XSteam('sL_p',p3)
t3=XSteam('Tsat_p',p3)
t2=t3
% at stage 4
s4=s3;
p4=p1;
h4=XSteam('hL_p',p4);
Cp4=XSteam('Cp_ps', p4, s4);
Cv4=XSteam('Cv_ps', p4, s4);
k=Cp4/Cv4;
t4=t3/((p3/p4)^((k-1)/k));
%At point
p5=p4;
h5=XSteam('hL_p', p5);
s5=XSteam('sL_p', p5);
t5=XSteam('Tsat_p', p1);
%At point 6
p6=p5;
t6=t5;
h6=XSteam('hV_p',p6);
s6=XSteam('sV_p',p6);
%Plotting the T vs s
figure(1)
hold on
plot([s1 s2], [t1 t2], 'color','b', 'linewidth', 3)
plot([s2 s3], [t2 t3], 'b', 'linewidth', 3)
plot([s3 s4], [t3 t4], 'b', 'linewidth', 3)
plot([s4 s5], [t4 t5], 'b', 'linewidth', 3)
plot([s5 s6], [t5 t6], 'b', 'linewidth', 3)
plot([s6 s1], [t6 t1], 'b', 'linewidth', 3)
title('T-s Diagram')
xlabel('Entropy')
ylabel('Temperature')
saveas(1,'t-s.jpg')