Project 1 - Parsing NASA thermodynamic data
Aim- Write a function that extracts the 14 coefficients and calculates the enthalpy, entropy and specific heats for all the species in the data file.
Objective:
- To extract the coefficients from the file for each compound.
- To calculate the molecular weight of each species.
- Plot the Specific Heat(Cp),Enthalpy(H) and Entropy(S) of each species with respect to both the low and high temperature coefficients.
- Save the plots in respective folders of the species.
File parsing is done to extract data from the file, it should be as generic as possible to fetch the data from different files. In this program we are getting the 14 co-effecients from the data and by using this we calculate enthalpy, entropy and specific heat for different species and the condition is that the FIRST 7 coefficients are HIGH-temperature coefficients and the SECOND 7 coefficients are LOW-temperature coefficients.
The following equations have been used to calculate the properties of enthalpy, entropy and specific heats for all the species in the data file-

Procedure-
Program approach-

- At the very outset, the THERMO.dat file is imported to the program by using the 'fopen' command and every line is read by using 'fgetl' command.
- In order to get the header information 'strsplit' command is used to split the string and the global temperatures are fetched.
- Now the species data is read , since there are 53 species and the logic remains the same hence \'for loop\' for the 53 species is declared and the main program is given inside the \'for loop\'.
- The species first line contains the species name and local temperatures and the next three lines contains the co-effecients. Hence by using the \'strsplit\' command the species_name and the local temperatures are obtained.
- In order to get the co-effecients \'strfind\' command is used find the variable\'E\' by using this as reference co-effecients are assigned.
- To create a seperate folder to save the plot for every species \'mkdir\' command is used.
- For plotting we need a set of temperatures hence the local species temperature are splitted into 1000 points by using \'linspace\' command.
- To assign the high and low temperature co-effecients each and every local temperature is compared with the local mid temperature.
- Thus by using the formulae specific heat, entropy and enthalpy are calculated and plotting is carried out.
- For saving the plots \'cd\' command is used.
- To find the molecular mass for every element atomic weight is assigned by using the 'strcmp' command each species elements are compared and molecular mass is stored using two \'for loops\', one to iterate the species element and one to compare the elements.
- In some species the element's atomic weight to be added twice (or) thrice, hence flag operator is used to get the position and that element atomic weight is added to the molecular weight by using the \'if\' condition.
Program:











CONCLUSION:
By parsing of data from NASA's Thermodynamic Data file, variation of thermodynamic properties with temperature of 53 species of molecules are observed with the help of plots obtained. Molecular masses of 53 species are also calculated.