Project 1 - Parsing NASA thermodynamic data
Report:
THERMO.dat file was read and assinged to datafile (fopen)
first for loop was used to get the 5 lines(fgetl)
second for loop was performed to access the 6th line in the file as 1:53
each time the line was assinged to data_values
each string was split using a delimiter 'spacetab' and assinged to each_string
the first string was assinged to speciesname
the lastterm -1, lastterm-2, lastterm-3 was assinged to low-temp, high_temp, mid_temp respectively.
the 14 coefficients were extracted by identifying the letter E
coefficient is seperated and ssigned to a1 by counting the first string to the 3 +position after E using the command a1 = str2double(line1(1:(pos(1)+3)))
from a2 : a5 is assinged from the first position of E + 4 positions and ends at the second position +3.
it is repeated in the same a6 : a15
T array is created for 1000 values with the range of lowtemp to hightemp
computing the CP S H with R = 8.314
if local temp is greater than mid_temp else the different coefficients from a8:a14
making a folder
ploting the three plots inside the created folder and each species has a seperate folder containing the 3 plots.
then calling a function MW to calculate the molecular weight and passing the species name
two arrays were created one for the elements and another for their respective molecular weight array
assinging the weight as zero initially
first for loop counter 1:number of speciesname length
second for loop counter 1 : lenthof the atom
a condition statement was used to if the speciesname matches with the atam elements then weight is added with the weight of the element placed at that position in the array mass.
after the conditions statement and second for loop ends
num is assinged to speciesname position, since it is converted to numerical a condition is applied if its more than one then new weight is computed by old weight added to the value in the mass multiplied by the assinged num -1
and returns in M