4. (14m) This question compares 2-point finite difference derivatives of the noisy data to those calculated analytically
Posted: Mon Jun 06, 2022 2:34 pm
t1=[0 1 2 3 4 5];
y1=[1.0 2.7 5.8 6.6 7.5 9.9]
4. (14m) This question compares 2-point finite difference derivatives of the noisy data to those calculated analytically on a polynomial model fitted to the data. (a) (1m) Calculate the first and second 2-point central finite difference derivatives on the data, e.g. using the function derivative. (b) (4m) Fit a polynomial to the data using the MATLAB functions polyfit and polyval. Chose a polynomial order that maximizes the performance of the method. Explain the process you used the estimate the polynomial order and give the optimal order. (c) (2m) Calculate the first and second analytical derivatives on the polynomial model using the MATLAB function polyder. (d) (3m) Make a single figure with three plots, arranged as a column: (a) the experimental data versus the underlying polynomial model; (b) three first derivatives: the underlying model, the 2-point finite difference calculated on the data and the analytical derivative calculated from the fitted polynomial model; and (c) same as (b) except second derivatives. Make sure you have a title and a legend on each plot. (e) (4m) Calculate and discuss the error, as we did in class, between the first and second un- derlying model derivatives versus the analytical derivatives of the fitted polynomial model. Discuss the pros and cons of using a polynomial as a model and of smoothing versus mod- elling noisy data.