Interpolation and Curve Fitting of Experimental Data
Summary
Learning Goals
Context for Use
Description and Teaching Materials
Teaching Notes and Tips
This project is individual or group-based. It is a classroom-based activity that can be extended to Lagrange interpolation, higher-order splines, and nonlinear curve fitting. It is assumed that students have been introduced to these topics earlier in the semester. They will be given three different datasets. Students will construct a polynomial of degree n-1 and Cubic splines of piecewise polynomials ensuring smoothness at knots. They will be asked to find curves that best represent the points using Linear, Quadratic, Cubic, or Non-Linear regression. For example, the exponential function y = a*exp(bx) using MATLAB's fit() function.
Students will use MATLAB functions: polyfit, polyval, spline, fit, plot, and Goodness of fit, evaluated using the coefficient of determination (R²) and residual error.
Tools to be used:
- MATLAB functions: polyfit, polyval, spline, fit, plot.
- Goodness of fit evaluated using the coefficient of determination (R²) and residual error.
Students will be provided a final report detailing the results expected from them.
Assessment
The rubric for the project will have the following criteria:
A scoring scale of 1 -5, where 5 means excellent and 0 means poor.
The results should show the following:
Interpolation
- Polynomial interpolation produces an exact fit but oscillations for higher degrees.
- Cubic spline interpolation produced smoother curves without oscillations.
Curve Fitting
- Linear fit captured the overall trend but underestimated curvature.
- Quadratic and cubic fits improved accuracy significantly.
- Nonlinear exponential fit provided the best match, with R².
4.3 Graphical Comparison
Figures generated in MATLAB should be inserted here.
- Plot 1: Polynomial interpolation
- Plot 2: Cubic spline interpolation
- Plot 3: Linear, quadratic, cubic curve fitting
- Plot 4: Nonlinear exponential fitting
References and Resources
2. MathWorks Documentation: Interpolation (https://www.mathworks.com/help/matlab/ref/interp1.html), Curve Fitting Toolbox (https://www.mathworks.com/help/curvefit/).
3. Burden, R. L., & Faires, J. D. Numerical Analysis. Brooks Cole.