interpolation and curve fitting - civil departmentminamdar/ce603/notes/interpolation.pdf ·...
TRANSCRIPT
![Page 1: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/1.jpg)
Interpolation and Curve Fitting
Wednesday 10 August 2011
![Page 2: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/2.jpg)
Discrete Data
Fitting predominantly done with polynomials
Intractable functions replaced by interpolating polynomials
Polynomial of order n
Laplace’s method: Unique polynomial of degree n-1 that can pass through n points
for n = 2, linear polynomial
Obviously the polynomialpasses through all the points
error in polynomial interpolation
Wednesday 10 August 2011
![Page 3: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/3.jpg)
Lagrange’s method is
straightforward, but does not lend itself to algorithm.Newton’s method
is better
Newton’s Method
Wednesday 10 August 2011
![Page 4: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/4.jpg)
Evaluation of Coefficients in NewtonIntroducing divided differences
for n = 5
Wednesday 10 August 2011
![Page 5: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/5.jpg)
Limitations of Interpolation with polynomials
dangers of using too many points (oscillatory behavior)Runge Phenomenon
1. Works well when the total number of points used is few.2. If many close points: linear interpolation is good.3. Interpolation between 3 to 6 points is ok.4. Too many points are neither useful (possibly dangerous)5. Polynomial extrapolation outside the data points is
dangerous. Better to use low order nearest neighborinterpolation (linear or quadratic). Can work with plot of log(x) vs log(y), which is generally a straight line.
absurd extrapolation beyond 12.0 linear extrapolation on log-log plot
Wednesday 10 August 2011
![Page 6: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/6.jpg)
Wednesday 10 August 2011
![Page 7: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/7.jpg)
Spline Interpolation
Since q = 0, the solution is cubic (at most)Slope and bending moment and thus curvature is
continuous. At the ends curvature is zero.
This is called natural cubic splineData points are called knots.
Wednesday 10 August 2011
![Page 8: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/8.jpg)
Mathematical Description
put together from n-1 cubics
continuity of second derivative
The second derivatives are linear
therefore
Integrating
Using
Thus
Wednesday 10 August 2011
![Page 9: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/9.jpg)
to obtain k’s
results in simultaneous equations, which can be solved very easily becauseof the tri-diagonal nature of the matrix of k’s
Given data points:Matlab function
to obtain k’s
Wednesday 10 August 2011
![Page 10: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/10.jpg)
Finally: Obtain the values of the function at any x
function to obtain in which i,i+1 does x fall
Wednesday 10 August 2011
![Page 11: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/11.jpg)
Least Square Fit
Smooth curve that fits data points on average
n: no of data pointsm: number of fitting parameters (n > m)
The form of the smooth curve is generallyknown or at least assumed.
Best fit is the one which minimizes the residual
The spread of the curve is denoted by
Wednesday 10 August 2011
![Page 12: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/12.jpg)
Wednesday 10 August 2011
![Page 13: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/13.jpg)
Wednesday 10 August 2011
![Page 14: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/14.jpg)
polynFit:Function to
obtain coefficients
of polynomial
Wednesday 10 August 2011
![Page 15: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/15.jpg)
stdDev:To obtain
the standard deviation
Wednesday 10 August 2011
![Page 16: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/16.jpg)
Wednesday 10 August 2011
![Page 17: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/17.jpg)
Wednesday 10 August 2011
![Page 18: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/18.jpg)
Wednesday 10 August 2011
![Page 19: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/19.jpg)
Wednesday 10 August 2011
![Page 20: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/20.jpg)
Wednesday 10 August 2011
![Page 21: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/21.jpg)
Wednesday 10 August 2011
![Page 22: Interpolation and Curve Fitting - Civil Departmentminamdar/ce603/Notes/Interpolation.pdf · Limitations of Interpolation with polynomials dangers of using too many points (oscillatory](https://reader031.vdocuments.us/reader031/viewer/2022022504/5ab4aa0c7f8b9a7c5b8c0aab/html5/thumbnails/22.jpg)
Wednesday 10 August 2011