Project 1 - Parsing NASA thermodynamic data
Aim:
To parse the NASA thermodynamic data file and calculate the thermodynamic properties of various gas species namely Specific Heat(Cp), Enthalpy(H) and Entropy(S).
Inputs from the data file:
- Global Temperatures
- Name of the Species or Elements
- Local Temperature of each species
- Temperature coefficients for each species - 14
Outputs:
- Specific Heat - Cp
- Enthalpy - H
- Entropy - S
- The molecular weight of each species or element.
Formulae:
Here R = 8.314 is the universal gas constant, T is the temperature and a1 to a14 are the temperature coefficients. The FIRST 7 coefficients are HIGH-temperature coefficients and the SECOND 7 coefficients are LOW-temperature coefficients.
Objectives:
- To write a function in MATLAB that extracts the 14 coefficients and calculates the enthalpy, entropy and specific heats for all the species in the data file
- To calculate the molecular weight of each species and display it in the command window
- To plot the Specific Heat, Enthalpy, and Entropy for the local temperature range specific for each species
- To save the plots as images with appropriate names and dump them in separate folders for each species with a suitable name automatically in the code
Screenshot of the folder:
Plots:
1) O2
2) N2
3) CO2
Similar are the plots of other species for all the three properties as shown in the screenshot.
Approach:
While there were some errors that popped up during the project, the basic approach was to first code everything in a single file and see what the outcomes are and then make functions to just keep what is necessary for the main file.
After solving all the errors, I started making the functions.
Making functions help reduce the number of variables in the workspace and thus the program requires less storage. Due to this, the computing time decreases as well.
References:
- https://in.mathworks.com/help/matlab/ref/strcmp.html
- https://in.mathworks.com/help/matlab/ref/fullfile.html
- https://in.mathworks.com/matlabcentral/answers/86318-separating-values-in-cell-arrays
- https://courses.skill-lync.com/premium/challenges/?courseId=2upFvlglcPfcA9EU&challengeId=FtvGNCE4LUtwEDVp
- https://courses.skill-lync.com/premium/videos/?courseId=2upFvlglcPfcA9EU&batchId=bExY2zvVJIrwWy0Y