Matlab Code For Graphical Development of Rayleigh Line

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

MATLAB CODE FOR GRAPHICAL DEVELOPMENT OF

Rayleigh LINE
CODE:
% Cv=718;T1=333;P1=5.75;R=287;
Cv=input('Enter the Value of Specific Heat at constant Volume Cv in J/kgK:');
T1=input('Enter the value of Temprature T1 in Kelvin(K):');
P1=input('Enter the value of Density P1 in (kg/m^3):');

R=input('Enter the value of Gas Constant for Gas in J/KgK:');


V_min=input('Enter Starting value of Velocity(m/s):');
V_max=input('Enter Final Desired value of Velocity(m/s):');
V_inc=input('Enter Step size for Velocity Increments:');
N=V_max/V_inc;

fprintf('\tNumber of Iteration \tVelocity(V_min)\t \t T2 \t\t \tEntropy \tMa\n')

for i=1:N
P2=863.702/V_min;
T2=(778000-(P2*(V_min^2)))/(P2*R);

s=Cv*log(T2/T1)-R*log(P2/P1);
Ma=V_min/sqrt(1.4*287*T2);
V_new=V_min+V_inc;
fprintf('\t\t\t%0.05f \t\t\t%0.05f \t %0.05f \t\t\t%0.05f \t\t%0.05f \n',[i;V_min;T2;s;Ma])
V_min=V_new;

end
OUTPUT:
Iteration Velocity V_min
Temprature T2 (K) Entropy s(J/kgK) Ma
s (m/s)
1 10 31.03741 -3053.37768 0.08955
2 30 91.02164 -1965.57688 0.15687
3 50 148.21841 -1468.88055 0.20489
4 70 202.62772 -1147.80626 0.24533
5 90 254.24958 -912.73182 0.28158
6 110 303.08398 -728.99136 0.31521
7 130 349.13092 -579.49502 0.34709
8 150 392.39041 -454.55529 0.37777
9 170 432.86244 -348.15264 0.40763
10 190 470.54701 -256.2952 0.43697
11 210 505.44413 -176.20435 0.46599
12 230 537.55379 -105.87288 0.49489
13 250 566.876 -43.80812 0.52383
14 270 593.41075 11.12549 0.55294
15 290 617.15804 59.80733 0.58236
16 310 638.11788 102.92744 0.61222
17 330 656.29026 141.03231 0.64263
18 350 671.67518 174.55682 0.67373
19 370 684.27265 203.84694 0.70564
20 390 694.08266 229.17615 0.73851
21 410 701.10521 250.75718 0.77248
22 430 705.34031 268.75053 0.80773
23 450 706.78795 283.27035 0.84443
24 470 705.44813 294.38821 0.8828
25 490 701.32086 302.13523 0.92307
26 510 694.40613 306.50246 0.96551
27 530 684.70395 307.4397 1.01046
28 550 672.21431 304.85263 1.05829
29 570 656.93721 298.59779 1.10945
30 590 638.87265 288.47512 1.1645
31 610 618.02064 274.21707 1.22412
32 630 594.38118 255.47319 1.28915
33 650 567.95425 231.78807 1.36067
34 670 538.73987 202.56954 1.44006
35 690 506.73804 167.04196 1.52916
36 710 471.94874 124.17564 1.63044
37 730 434.37199 72.57657 1.74738
38 750 394.00779 10.30681 1.88497
39 770 350.85612 -65.42413 2.05079
40 790 304.91701 -158.82644 2.257
GRAPHICAL PLOT:

You might also like