a new title
1.
% curvefit programming
% load the data sheet
cp_data = load('data');
temperature = cp_data (:,1);
cp = cp_data(:,2);
% polynomial equation
co_effs = polyfit(temperature,cp,3);
% predict the particular no.
predicted_cp = polyval(co_effs,temperature);
% compare the curverfit with the original data.
plot(temperature, cp, 'linewidth',3)
xlabel ('Temperature[k]')
ylabel ('specific heat[KJ/KMOL-K]')
hold on
plot(temprature, predicted_cp,'linewidth',3, 'color', 'r')
legend ('original datasheet','curvefit')
Results- if we compare the curve of the [cp vs T] data, according to the number of polynomials, then we will see that it is a good approximation.
2. In order to make the curve fit perfect, we have to increase the order of the polynomial so that the error will be minimum. then the curve will be perfect.