1 / 42

Chapter 6 Numerical Interpolation

Chapter 6 Numerical Interpolation. Given some sample measurements, we may need to estimate the values at some other points by fitting a curve to the measured points . Interpolation is required in many engineering applications that use tabular data as input .

keely-gross
Download Presentation

Chapter 6 Numerical Interpolation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 6 Numerical Interpolation • Given some sample measurements, we may need to estimate the values at some other points by fitting a curve to the measured points. • Interpolation is required in many engineering applications that use tabular data as input. • The basis of all interpolation algorithms is the fitting of some type of curve or function to a subset of the tabular data.

  2. Method of Undetermined Coefficients • The nth-order polynomial is used as the interpolation function: • Example: To estimate (2.2)3 by using the following data (obtained from the cubic function).

  3. The linear interpolation function: The linear interpolation form in algebra Substituting xi=2 and xi+1=3, we get The prediction of (2.2)3 is f(2.2)=11.8 The true value of (2.2)3 is 10.648. The error is 10.8%.

  4. The second-order polynomial function: Set x=1, x=2, and x=3. We get three simultaneous equations: Solving the equations, we obtain b0=6, b1=-11, and b2=6. The interpolation function is The prediction of (2.2)3 isf(2.2)=10.8640. The error is 1.8%. • The nth-order polynomial interpolation function requires n+1 distinct data points for determining its coefficients.

  5. Gregory-Newton Interpolation Method • A higher order interpolation polynomial has more accuracy. However, it becomes more complex to solving the larger set of simultaneous equations. • The nth-order Gregory-Newton interpolation formula:

  6. We can obtain the values of a1, a2, a3, …, an+1 by the following procedure: • The Gregory-Newton method yields the same polynomial as the solution of the simultaneous equations in the method of undetermined coefficients.

  7. Example: Cubic Function

  8. Finite-Difference Interpolation • This scheme can be applied when the known values of the independent variable are equally spaced.

  9. If the original polynomial is of degree n, then the ith finite difference is a polynomial of degree n-i.

  10. Example: Finite-Difference Interpolation

  11. Finite Difference Table

  12. Example: Finite-difference Table for Cubes

  13. Newton’s Method

  14. Newton’s interpolation formula:

  15. Example: Tangents of Angles • Assume the tangents of angles () between 30º and 40 º with an increment of 2 º is available in the next table. • We want to develop a nonlinear interpolation polynomial to estimate tan(36.5).

  16. The true value of tan(36.5) is 0.73996. Thus, the error is 0.00004.

  17. Lagrange Polynomials • In Newton’s method, it is assumed that x is measured at a constant interval, x. • In Lagrange’s method, x is measured on a variable interval x.

  18. Lagrangian interpolating equation for estimating f(x0):

  19. Example: Sine Function The computed value equals the true value to 5 significant digits.

  20. Linear Splines (First-order Spline)

  21. Example: Linear Spline for Well-water Elevation

  22. Figure: Linear Spline for Well-water Elevation

  23. Quadratic Splines (Second-order Splines) • The general form of a quadratic equation between (xi,f(xi)) and (xi+1,f(xi+1)) : • Every two adjacent data points have an interpolation equation as above. • Rule 1: The splines must pass through the data points.

  24. Rule 2: At one interior point, the first derivatives (slope) of the two interpolation functions representing it must be equal. • Rule 3: The second derivative for the spline between the first two data points is zero. That is, the function should be linear. • The above equations provide 3(n-1) conditions to solve the 3(n-1) unknownsai, bi, ci, i=1,2, …, n-1.

  25. Example: Quadratic Spline for Well-water Elevation By rule 1 (a): By rule 1(b):

  26. By rule 2: By rule 3:

  27. The solution of the system of the equations:

  28. Figure: Quadratic Spline for Well-water Elevation

  29. Cubic Splines (Third-order Spline) • The general form of a cubic equation between (xi,f(xi)) and (xi+1,f(xi+1)) : • Every two adjacent data points have an interpolation equation as above. • Rule 1: The splines must pass through the data points.

  30. Rule 2: At one point, the first derivatives (slopes) of the two interpolation functions representing it must be equal. • Rule 3: The second derivatives must be equal at the interior points.

  31. Rule 4: The second derivatives for the spline at the first and last data points are zero. • The above equations provide 4(n-1) conditions to solve the 4(n-1) unknownsai, bi, ci, di, i=1,2, …, n-1. • Higher-order splines can be developed similarly. However, the computational difficulty greatly increases by needing to solve larger system of simultaneous equations.

  32. Guidelines for Choice of Interpolation Method • The method of undetermined coefficients is perhaps the easiest method to understand conceptually. However, the method does require the solution of a set of n+1 simultaneous equations for an nth-order interpolation polynomial. One advantage of this method is that the interpolation polynomial can be customized for the particular problem at hand; for example, some of the terms of the general nth-order interpolation polynomial can be dropped, if desired. This is not possible in most of the other interpolation methods.

  33. Both the Gregory-Newton and Lagrange polynomial interpolation methods eliminate the need to solve a set of simultaneous equations. Of the two methods, the Lagrange polynomial scheme is perhaps the easier to program. Although both of these methods (as well as the method of undetermined coefficients) work with unequally spaced data points, the best accuracy is usually achieved when the differences in the spacing of the data points are minimal. • The finite-difference interpolation scheme requires equally spaced data points for its application. • Interpolation using splines can be more accurate than other methods, especially in cases where the data show large sudden changes. • All the interpolation schemes can also be used for extrapolation; but the accuracy usually becomes worse.

  34. Linear Interpolation in Two Dimensions • The form of the data set for 2 independent variables x1 and x2:

  35. For given values of x1 and x2, the value of f(x1,x2) needs to be determined. The values at the four corners are known. Step 1: A one-dimensional interpolation over x1 to obtain f(x1,x2j):

  36. Step 2: A one-dimensional interpolation over x1 to obtain f(x1,x2(j+1)): Step 3: A one-dimensional interpolation over x2 to obtain f(x1,x2):

More Related