Challenge

Project 1 - Parsing NASA thermodynamic data

I first created a function called "NASA_coefficients" that extracts the 14 NASA thermodynamic coefficients for all 53 compounds along with their names and local temperature ranges. In this function, I used 'fgetl' to call each line from the NASA THERMO.dat file and extracted the coefficients using 'strfind' and 'str2num'. I faced difficulty in extracting the names but overcame this using 'strtok'.

Then I created a function called "MolWt" to calculate the molecular weight of each species. One of the output NASA_coefficients is the names of each chemical compound. I used this as input to the MolWt function and using 'eval' I coded the calculation of molecular weight. I found trouble trying to include 'AR' compound in the same loop but I was unable to do this. Hence I created separate 'if' condition when the function receives the compound 'AR' as input.

Finally, I created the last function called "NASAFileParsing.m" which uses the above two functions to first get the extracted coefficients, then calculate the Molecular Weight and finally specific heat, enthalpy and entropy of all the species. I struggled to get the double for-loop right because local temperature range changes for each compound. This caused an asymmetry in number of rows and columns. However, I figured it out and could get the function to calculate the Cp, Enthalpy and Entropy for all 53 species in their respective low and high temperature ranges, plot and save the figures to a specific folder.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.