Advertisement
Guest User

Untitled

a guest
May 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.77 KB | None | 0 0
  1. clc;clear all;
  2. %% Problem 5
  3.  
  4. %N2 Properties
  5. R = 296.8; %N2 J/kg*K
  6. Tv = 3521; %K, characteristic vibrational temp
  7. T1 = 300; %K
  8. T2 = 3000; %K
  9.  
  10. % Since density is constant:
  11. density_ratio = 1;
  12.  
  13. %% Calorically Perfect Gas
  14. Cv_cpg = (5/2)*R;
  15. Cp_cpg = Cv_cpg + R;
  16. gamma_cpg = Cp_cpg/Cv_cpg;
  17.  
  18. entropy_change_cpg = Cv_cpg*log(T2/T1) - R*log(density_ratio);
  19. disp(['Assuming CPG, the change in entropy is: ', num2str(entropy_change_cpg), ' J/K', newline]);
  20. %% Thermally Perfect Gas
  21. theta_v1 = Tv/(2*T1);
  22. theta_v2 = Tv/(2*T2);
  23. entropy_change_tpg = R*(log(((T2/T1)^1/(gamma_cpg-1))*density_ratio) + ((theta_v2*coth(theta_v2)) + log(sinh(theta_v1)/sinh(theta_v2)) - ((theta_v1*coth(theta_v1)))));
  24. disp(['Assuming TPG, the change in entropy is: ', num2str(entropy_change_tpg), ' J/K']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement