270 likes | 448 Views
Faculty of Applied Engineering and Urban Planning. Civil Engineering Department. Numerical Analysis. Polynomial Interpolation. Lecture 12 Week 10. 2 nd Semester 2007/2008. From Dr. Arafa Lecture Notes. From Dr. Arafa Lecture Notes. From Dr. Arafa Lecture Notes.
E N D
Faculty of Applied Engineering and Urban Planning Civil Engineering Department Numerical Analysis Polynomial Interpolation Lecture 12 Week 10 2nd Semester 2007/2008
Definition • Curve fitting is the process of finding equations to approximate straight lines and curves that best fit given sets of data. • Regression is the process of finding the dependent variable from some data of the independent variable . Regression can be linear (straight line) or curved (quadratic, cubic, etc.)
Polynomial Interpolation For a given set of N + 1 data points {(x0, y0), (x1, y1), . . . , (xN, yN)}, we want to find the coefficients of an Nth-degree polynomial function to match them: Why polynomials?!!
Lagrange Interpolating The coefficients can be obtained by solving the following system of linear equations:
Polynomial Interpolation • Lagrange Interpolating Polynomials • Newton’s divided-difference interpolating polynomial • Spline Interpolation
Lagrange Interpolating Lagrange Interpolating takes the following general formula:
Quadratic Interpolation For 3 points of data
Example Use a Lagrange interpolating polynomial of the first and second order to evaluate f(2) on the basis of the data: x0 = 1 f(x0) = 0 x1 = 4 f(x1) = 1.386294 x2 = 6 f(x2) = 1.791760
Example These values are taken by substitution into equation f(x) = ln(x): x0 = 1 f(x0) = ln(1) = 0 x1 = 4 f(x1) = ln(4) = 1.386294 x2 = 6 f(x2) = ln(6) = 1.791760 f(2) = ln(2) = 0.693147 f1(2) = 0.462098 f2(2) = 0.565844
Newton’s Divided Difference Interpolation Method This method, has the advantage that the values x0, x1, x2, …, xn need not be equally spaced, or taken in consecutive order. It uses the formula: where f(x0, x1), f(x0, x1, x2), and f(x0, x1, x2, x3) are the first, second, and third divided differences respectively.
Newton’s Divided Difference Interpolation Method Use Newton’s divided-difference method to compute f(2) from the experimental data shown in the following table: