All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Project 1 - Parsing NASA thermodynamic data AIM: The thermodynamic data for various species are studied and the coefficients of temperature in the characteristic…
pradeep meesala
updated on 14 Sep 2021
Project 1 - Parsing NASA thermodynamic data
AIM: The thermodynamic data for various species are studied and the coefficients of temperature in the characteristic equations for entropy. enthalpy and specific heat are obtained using a Matlab code.
The equations are as follows:
Cp=Râ‹…(a1+a2t+a3t2+a4t3+a5t4+a6t5+a7t6+a8t7+a9t8+a10t9+a11t10+a12t11+a13t12)+a14t13)
H=RTâ‹…(a1+a2t2+a3t23+a4t34+a5t45+a6t56+a7t67+a8t78+a9t89+a10t910+a11t1011+a12t1112+a13t1213+a14t1314)
S=Râ‹…(a1log(t)+a2t+a3t22+a4t33+a5t44+a6t55+a7t66+a8t77+a9t88+a10t99+a11t1010+a12t1111+a13t1212+a14t1313)
CODE:
clear all
close all
clc
f1=fopen('THERMO.dat','r');
for i=1:5
fgetl(f1);
end
for j=1:53
tline1=fgetl(f1);
A=strsplit(tline1,' ');
species_cell=char(A(1));
p=strfind(tline1,'.');
low_local_temp=str2double(tline1(p(1)-3:p(1)+3));
high_local_temp=str2double(tline1(p(2)-4:p(2)+3));
mid_local_temp=str2double(tline1(p(3)-4:p(3)+3));
tline2=fgetl(f1);
y=strfind(tline2,'E');
a1=str2double(tline2(1:y(1)+3));
a2=str2double(tline2(y(1)+4:y(2)+3));
a3=str2double(tline2(y(2)+4:y(3)+3));
a4=str2double(tline2(y(3)+4:y(4)+3));
a5=str2double(tline2(y(4)+4:y(5)+3));
tline3=fgetl(f1);
z=strfind(tline2,'E');
a6=str2double(tline3(1:z(1)+3));
a7=str2double(tline3(z(1)+4:z(2)+3));
a8=str2double(tline3(z(3)+4:z(4)+3));
a9=str2double(tline3(z(4)+4:z(5)+3));
tline4=fgetl(f1);
x=strfind(tline2,'E');
a10=str2double(tline4(1:x(1)+3));
a11=str2double(tline4(x(1)+4:x(2)+3));
a12=str2double(tline4(x(2)+4:x(3)+3));
a13=str2double(tline4(x(3)+4:x(4)+3));
a14=str2double(tline4(x(3)+4:x(4)+3));
%universal gas constant
R=8.314;
t = low_local_temp:high_local_temp;
C_p=R*(a1+(a2*t)+(a3*(t.^2))+(a4*(t.^3))+(a5*(t.^4))+(a6*(t.^5))+(a7*(t.^6))+(a8*(t.^7))+(a9*(t.^8))+(a10*(t.^9))+(a11*(t.^(10)))+(a12*(t.^(11)))+(a13*(t.^(12)))+(a14*(t.^(13))));
H = R*(a1+a2*(t/2)+a3*(t.^2)/3+a4*(t.^3)/4+a5*(t.^4)/5+a6*(t.^5)/6+a7*(t.^6)/7+a8*(t.^7)/8+a9*(t.^8)/9+a10*(t.^9)/10+a11*(t.^10)/11+a12*(t.^11)/12+a13*(t.^12)/13+a14*(t.^13)/14);
S=R*((a1*log(t))+(a2*t)+(a3*((t.^2)/2))+(a4*((t.^3)/3))+(a5*((t.^4)/4))+(a6*((t.^5)/5))+(a7*((t.^6)/6))+(a8*((t.^7)/7))+(a9*((t.^8)/8))+(a10*((t.^9)/9))+(a11*((t.^10)/10))+(a12*((t.^11)/11))+(a13*((t.^12)/12))+(a14*((t.^13)/13)));
%calaculate molecular weight
molecular_weight = func_molecular_weight(species_cell)
q=sprintf('%s',species_cell);
mkdir(q)
cd(q)
figure(1)
%specific heat vs temperature
plot(C_p,t,'r')
xlabel('specific heat');
ylabel('temperature');
title('Specific_heat');
saveas(1,'C_p.jpeg')
figure(2)
%Enthalphy vs temperature
plot(H,t,'r')
xlabel('Enthalphy');
ylabel('temperature');
title('Enthalpy');
saveas(2,'H.jpeg')
figure(3)
%Entropy vs temperature
plot(S,t,'r')
xlabel('Entropy');
ylabel('temperature');
title('Entropy');
saveas(3,'S.jpeg')
cd ..
end
Function code:
function[out] = func_molecular_weight(species)
elements = ['H','C','N','O','R'];
Atomic_weight = [1 12 14 16 40];
out = 0;
for i=1:length(species)
for j=1:length(elements)
if strcmp(species(i),elements(j))
out=out+Atomic_weight(j);
p=j;
end
end
n=str2double(species(i));
if n>1
out = (out+Atomic_weight(p))*(n-1);
end
end
RESULTS:
SPECIFIC HEAT:
ENTHALPHY:
ENTROPHY:
FORDERS:
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Radar Mast & Final Assembly of Yacht
Radar Mast : MODELING AND ASSEMBLY OF YACHT …
26 Oct 2021 10:37 AM IST
Photo Realistic Rendering
American Chopper Moto Design and Assembly Objective: The objective of this project is to understand and demonstrate the design philosophy of a retro American chopper motorcycle model using…
07 Oct 2021 05:33 AM IST
FRONTAL CRASH ANALYSIS-BIW
FRONTAL CRASH ANALYSIS-BIW AIM: To perform a frontal crash Analysis of the givein model.…
20 Sep 2021 11:37 AM IST
Project 1 - Parsing NASA thermodynamic data
Project 1 - Parsing NASA thermodynamic data AIM: The thermodynamic data for various species are studied and the coefficients of temperature in the characteristic…
14 Sep 2021 11:00 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.