Curve Fitting-Comparison of linear and cubic model
cp_data=load(\'data\');
temperature=cp_data(:,1);
cp=cp_data(:,2);
% original data plot
plot(temperature,cp);
coeff_lin=polyfit(temperature,cp,1);
coeff_cubic=polyfit(temperature,cp,3);
predicted_lin=polyval(coeff_lin,temperature);
predicted_cubic=polyval(coeff_cubic,temperature);
hold on;
plot(temperature,predicted_lin);
plot(temperature,predicted_cubic);
xlabel(\'Temperature[K]\');
ylabel(\'Sp. Heat\');
legend(\'Original Value\',\'Predicted Value(linear)\',\'Predicted Value(cubic)\');
hold off;
1.Curve Fitting coming at cubic equation is quite close to the result while linear doesn\'t seems to be a good option.Variance Analysis(ANOVA) should be done to check if its good for checking design data or not.
2.Curve fitting can be improved by using some modified function terms(checking for transformation function) and calculating the leverage from the residuals from actual and predicted data.