Project 1 - Parsing NASA thermodynamic data
AIM:To a function that extracts the 14 co-efficients and calculates the enthalpy, entropy and specific heats for all the species in the data file of nasa thermo data file and plot them of every species
EXPLATION:
- Firstly, we will Input the parameter R and we will open a file THERMO.dat file and reading this file using fopen command.
- Then, we will read first THERMO using fgetl command and then we read temperature file and we will split the temperatures using strsplit command to convert it into cell array and then we will convert this string to number using str2num command to find low, high and mid temperatures.
- Then we will assign temperature range using linspace command. Then we run loop to skip command lines the data file using fgetl command inside the loop.
- Now, we will run the loop to find 53 element in the data file by assigning fgetl command and then spliting into the cell array to find the species line and then find the species name and then find the number of the temperatures in the species line.
- Then we read the new line. In order to read the coefficient in the data file we will first find the 'E' string using strfind command to find before and after numbers of the coefficients then we will find remaining 14 coefficients and convert them to numbers from strings.
- Out of which we will find the first 7 Coefficients which are for Higher temperature and then Second 7 Coefficients which are for Lower temperature.
- Now we will specify Specific heat Cp, Entropy S, Enthalpy H functions to find these parameters using these 14 coefficients for Lower and higher Temperature. then we will specify molecular weight W function to find the Molecular weight of the different species.
- Now we will write the Molecular weight.txt file and fprintf all the molecular weights of the species. and then close the txt file using fclose command.
- Now we change the directory using cd command and then creating directory folder where we have to save our files using mkdir command and then we will change the directory to this created folder.
- Now, we will plot Specific heat, Entropy and Enthalpy with the Temperature for different species. We we will use scanf command to in the title command to create different species title.
- Then we will use saveas command to save the plots of different species in the directory folder. Now we will change the directory to which our main code file runs in the MATLAB.
- And i was faces a lot of erros while wrting the code like syntax error mostly and the function code erorrs and cross check all the code of errors and overcome with them and finaly i was complted the project successfully