Advertisement
shamzed

problem 1

Jul 16th, 2022
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.88 KB | None | 0 0
  1. % Problem 1
  2.  
  3. % Opening the excel file in octave
  4. pkg load io;
  5. data = xlsread('Air properties.xlsx');
  6. temp = data(:,1);
  7. h = data(:,2);
  8. pr = data(:,3);
  9. u = data(:,4);
  10. vr = data(:,5);
  11. s = data(:,6);
  12.  
  13. % given data:
  14. p1 = 100;
  15. p2 = 1000;
  16. p3 = 1000;
  17. p4 = 100;
  18. t1 = 300;
  19. t3 = 1400;
  20. flowrate = 5;
  21.  
  22. % finding h1
  23. index1 = find(temp == t1);
  24. h1 = h(index1);
  25.  
  26. % finding pr1 and pr2
  27. pr1 = pr(index1);
  28. pr2 = pr1 * (p2/p1);
  29.  
  30. % interpolating h2
  31. h2 = interp1(pr, h, pr2);
  32.  
  33. % finding h3
  34. index2 = find(temp == t3);
  35. h3 = h(index2);
  36.  
  37. % interpolating h4
  38. pr3 = pr(index2);
  39. pr4 = pr3 * (p4/p3);
  40. h4 = interp1(pr, h, pr4);
  41.  
  42. % a) finding the thermal efficiency
  43. therm_eff = ((h3 - h4) - (h2 - h1))/(h3 - h2);
  44.  
  45. % b) back work ratio
  46. bwr = (h2 - h1)/(h3 - h4);
  47.  
  48. % c) Net power in KW
  49. m_dot = ((flowrate * (10^5))/((8.314/28.97)*300)) * (1/10^3);
  50. W_cycle = m_dot * ((h3 - h4) - (h2 - h1));
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement