<<

25.108 Introduction to Engineering For ECE Experiment 5 Curve Fitting and Data Analysis

Objectives: To learn how to do linear and polynomial curve fitting in analysis; To learn basic data analysis techniques in Matlab; To learn to use graphical visualization techniques to understand system behavior

Procedure:

Year Winner and Country Time (secs) 1928 , USA 12.2 1932 Stella Walsh, POL 11.9 1936 , USA 11.5 1948 Fanny Blankers-Koen, NED 11.9 1952 Marjorie Jackson, AUS 11.5 1956 , AUS 11.5 1964 , USA 11.4 1968 Wyomia Tyus, USA 11.08 1972 , E. Ger 11.07 1976 , W. Ger 11.08 1980 , USSR 11.06 1984 , USA 10.97 1988 , USA 10.54 1992 , USA 10.82 1996 Gail Devers, USA 10.94 2000 , USA 10.75

(a) Using Matlab, load in year and finishing times, and plot finish time versus year. (That is, year is on the x-axis.) Note the steady, albeit irregular, decrease in finish time over time.

Now that we’ve got the data plotted as individual points, let’s label our axes: xlabel(‘Year’) ylabel(‘Finishing Time (sec)’) title(‘Curve Fitting Exercise’)

(b) Using Polyfit, find a best first order least squares fit to the data by a line. Fit1=polyfit(year,finish,1);

(c) What is the root mean square (RMS) error in the line?

(d) Plot that best line on the same plot as the recorded times. You will need the Matlab command “hold”.

(e) In 1960, the 100 meter dash was won by of the USA in 11.0 seconds. How accurately does your line reflect that value? How does the error in this result compare to the RMS error for the line as a whole? Plot this point separately on the same graph.

(f) Extend the best-fit line to include the year 2004. What do you predict as the finish time for that year? In 2004, the 100 meter dash was actually won by Yuliya Nesterenko of Belarus in 10.93 seconds. How does your prediction compare to the correct time? How does the error in it compare to the RMS error for the line? This part of the problem asks you to extrapolate beyond the known data set. Typically, extrapolation is risky (as is predicting the future in general), even though it may work pretty well in this case.

The process of estimating a value in between known data points is called interpolation, and it is a valid numerical technique.

Part II.

Download the file CurveFitData from the website and load it in

I am not going to tell you what the order is, but try order 1,2,3 and find the fit which provides the minimum mean square error between prediction and data. Plot both your fit and your original data on the same plot.

Answer: Best Fit Polynomial fit.

RMS error.