Chapter 6 Numerical Interpolation

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

Numerical Methods.  Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.  Several methods to obtain.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #14 Interpolation.
Chapter 3. Interpolation and Extrapolation Hui Pan, Yunfei Duan.
Chapter 7 Numerical Differentiation and Integration
Today’s class Romberg integration Gauss quadrature Numerical Methods
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
Chapter 18 Interpolation The Islamic University of Gaza
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
Notes Over 6.9Writing a Cubic Function Write the cubic function whose graph is shown.
Computational Methods in Physics PHYS 3437
EARS1160 – Numerical Methods notes by G. Houseman
ES 240: Scientific and Engineering Computation. InterpolationPolynomial  Definition –a function f(x) that can be written as a finite series of power functions.
PART 7 Ordinary Differential Equations ODEs
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Ordinary Differential Equations Equations which are.
Chapter 4 Roots of Equations
Curve-Fitting Interpolation
Chapter 1 Introduction The solutions of engineering problems can be obtained using analytical methods or numerical methods. Analytical differentiation.
Least Square Regression
Curve-Fitting Polynomial Interpolation
Polynomial Interpolation
Chapter 7 Differentiation and Integration
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 181 Interpolation Chapter 18 Estimation of intermediate.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 23 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 24 Regression Analysis-Chapter 17.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 181 Interpolation.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Interpolation Chapter 18.
1 Chapter 6 NUMERICAL DIFFERENTIATION. 2 When we have to differentiate a function given by a set of tabulated values or when a complicated function is.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 171 Least.
Differential Equations and Boundary Value Problems
Least-Squares Regression
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
Simpson Rule For Integration.
Lecture 22 - Exam 2 Review CVEN 302 July 29, 2002.
1 Interpolation. 2 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Applied Numerical Methods With MATLAB ® for Engineers.
Part 4 Chapter 17 Polynomial Interpolation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Polynomial Interpolation You will frequently have occasions to estimate intermediate values between precise data points. The function you use to interpolate.
Chapter 8 Curve Fitting.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 22.
CHAPTER 3 NUMERICAL METHODS
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #15 Spline Interpolation.
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 7 - Chapter 25.
Principles of Extrapolation
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Interpolation - Introduction
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 20 Numerical Integration of Functions.
CHAPTER 3 NUMERICAL METHODS
Part 7 - Chapter 25.
Part 5 - Chapter
Curve-Fitting Spline Interpolation
Numerical Analysis Lecture 25.
Interpolation.
Interpolation Estimation of intermediate values between precise data points. The most common method is: Although there is one and only one nth-order.
Chapter 18.
FE Exam Tutorial
Chapter 22.
Interpolation.
Chapter 18.
Chapter 23.
Today’s class Multiple Variable Linear Regression
Part 7 - Chapter 25.
SKTN 2393 Numerical Methods for Nuclear Engineers
SKTN 2393 Numerical Methods for Nuclear Engineers
Presentation transcript:

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.

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).

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%.

The prediction of (2.2)3 is f(2.2)=10.8640. The error is 1.8%. 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 is f(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.

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:

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.

Example: Cubic Function

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

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

Example: Finite-Difference Interpolation

Finite Difference Table

Example: Finite-difference Table for Cubes

Newton’s Method

Newton’s interpolation formula:

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).

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

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.

Lagrangian interpolating equation for estimating f(x0):

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

Linear Splines (First-order Spline)

Example: Linear Spline for Well-water Elevation

Figure: Linear Spline for Well-water Elevation

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.

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) unknowns ai, bi, ci, i=1,2, …, n-1.

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

By rule 2: By rule 3:

The solution of the system of the equations:

Figure: Quadratic Spline for Well-water Elevation

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.

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.

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) unknowns ai, 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.

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.

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.

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

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):

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