Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.

Slides:



Advertisements
Similar presentations
9.7 Taylor Series. Brook Taylor Taylor Series Brook Taylor was an accomplished musician and painter. He did research in a variety of areas,
Advertisements

NUMERICAL DIFFERENTIATION AND INTEGRATION
Numerical Computation
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
Lecture 18 - Numerical Differentiation
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
MATH 685/ CSI 700/ OR 682 Lecture Notes
Chapter 18 Interpolation The Islamic University of Gaza
Computational Methods in Physics PHYS 3437
ES 240: Scientific and Engineering Computation. InterpolationPolynomial  Definition –a function f(x) that can be written as a finite series of power functions.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
Chapter 4 Roots of Equations
INFINITE SEQUENCES AND SERIES
Curve-Fitting Interpolation
Lecture 2: Numerical Differentiation. Derivative as a gradient
Curve-Fitting Polynomial Interpolation
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 22 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Interpolation Chapter 18.
CSE Interpolation Roger Crawfis.
ON MULTIVARIATE POLYNOMIAL INTERPOLATION
Chapter 6 Numerical Interpolation
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
19.5 Numeric Integration and Differentiation
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
Taylor’s Polynomials & LaGrange Error Review
Now that you’ve found a polynomial to approximate your function, how good is your polynomial? Find the 6 th degree Maclaurin polynomial for For what values.
Interpolation and Approximation To the question, "Why approximate?", we can only answer, "Because we must!" Mathematical models of physical or natural.
Integration of 3-body encounter. Figure taken from
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
1. Interpolating polynomials Polynomial of degree n,, is a linear combination of Definitions: (interval, continuous function, abscissas, and polynomial)
Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values at intermediate.
In section 11.9, we were able to find power series representations for a certain restricted class of functions. Here, we investigate more general problems.
Numerical Methods.
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
In this section we develop general methods for finding power series representations. Suppose that f (x) is represented by a power series centered at.
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
This is an example of an infinite series. 1 1 Start with a square one unit by one unit: This series converges (approaches a limiting value.) Many series.
Iteration Methods “Mini-Lecture” on a method to solve problems by iteration Ch. 4: (Nonlinear Oscillations & Chaos). Some nonlinear problems are solved.
Principles of Extrapolation
Advanced Engineering Mathematics, 7 th Edition Peter V. O’Neil © 2012 Cengage Learning Engineering. All Rights Reserved. CHAPTER 4 Series Solutions.
The purpose of Chapter 5 is to develop the basic principles of numerical integration Usefule Words integrate, integral 积分(的), integration 积分(法), quadrature.
Fourier Approximation Related Matters Concerning Fourier Series.
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Interpolation - Introduction
NUMERICAL ANALYSIS I. Introduction Numerical analysis is concerned with the process by which mathematical problems are solved by the operations.
1 Approximating functions, polynomial interpolation (Lagrange and Newton’s divided differences) formulas, error approximations.
Keywords (ordinary/partial) differencial equation ( 常 / 偏 ) 微分方程 difference equation 差分方程 initial-value problem 初值问题 convex 凸的 concave 凹的 perturbed problem.
Computational Methods CMSC/AMSC/MAPL 460 Polynomial Interpolation Ramani Duraiswami, Dept. of Computer Science.
NUMERICAL DIFFERENTIATION Forward Difference Formula
Part 6 - Chapter 21.
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.
Taylor series in numerical computations (review)
Interpolation.
Chapter 18.
Chapter 23.
Taylor Polynomials & Approximation (9.7)
Chapter 7 Numerical Differentiation and Integration
Today’s class Multiple Variable Linear Regression
Calculus BC AP/Dual, Revised © : Lagrange's Error Bound
POLYNOMIAL INTERPOLATION
5.3 Higher-Order Taylor Methods
SKTN 2393 Numerical Methods for Nuclear Engineers
SKTN 2393 Numerical Methods for Nuclear Engineers
Numerical Analysis Lecture 21.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

Interpolation

Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of the function at a set of points.

Interpolation Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of the function at a set of points. The values for f(x i ) may be the results from a physical measurement (conductivity at different points around UWI)

Interpolation It may also be from some long numerical calculation which can’t be put into a simple equation.

Interpolation It may also be from some long numerical calculation which can’t be put into a simple equation. What is required is that we estimate f(x)! i.e. Draw a smooth curve through x i.

Interpolation The method of estimating between two known points (values) is called interpolation. While estimating outside of know values is called extrapolation.

Interpolation Interpolation is carried out using approximating functions such as: 1. Polynomials 2. Trigonometric functions 3. Exponential functions 4. Fourier methods

Interpolation Theory

Yes approximate but what is a good approximation?

Clearly a good approximation should be, such that the error between the true function and the approximation function should be very small.

Other than this approximating functions should have the following properties: 1. The function should be easy to determine 2. It should be easy to differentiate 3. It should be easy to evaluate 4. It should be easy to integrate

There are numerous theorems on the sorts of functions, which can be well approximated by which interpolating functions. Generally these functions are of little use.

There are numerous theorems on the sorts of functions, which can be well approximated by which interpolating functions. Generally these functions are of little use. The following theorem is useful practically and theoretically for polynomial interpolation.

Weierstrass Approximation Theorem

If f(x) is a continuous real-valued function on [a, b] then for any  > 0, then there exists a polynomial P n on [a, b] such that |ƒ(x) – P n (x)| <  for all x  [a, b].

Weierstrass Approximation Theorem This tells us that, any continuous function on a closed and bounded interval can be uniformly approximated on that interval by polynomial to any degree of accuracy. However there is no guarantee that we will know f(x) to an accuracy for the theorem to hold.

Weierstrass Approximation Theorem Consequently, any continuous function can be approximated to any accuracy by a polynomial of high enough degree.

Polynomial Approximation Polynomials satisfy a uniqueness theorem: A polynomial of degree n passing exactly through n + 1 points is unique. The polynomial through a specific set of points may take different forms, but all forms are equivalent. Any form can be manipulated into another form by simple algebraic rearrangement.

Polynomial Approximation The Taylor series is a polynomial of infinite order. Thus ƒ(x) = ƒ(x 0 ) + ƒ'(x 0 )(x - x 0 ) + 1/2! ƒ''(x 0 ) (x - x 0 ) However it is impossible computationally to evaluate an infinite number of terms.

Polynomial Approximation Taylor polynomial of degree n is therefore usually defined as ƒ(x) = P n (x) + R n + 1 (x) where the Taylor polynomial P n (x) and the remainder term R n + 1 (x) are given by P n (x) = ƒ(x 0 ) + ƒ'(x 0 )(x - x 0 ) + … + 1/n! ƒ n (x 0 ) (x - x 0 ) n R n + 1 (x) = 1/(n+1)! ƒ n+1 ( ξ ) (x - x 0 ) n+1 where x 0 ≤ξ<x.

Polynomial Approximation The Taylor polynomial is a truncated Taylor series, with an explicit remainder, or error term. The Taylor polynomial cannot be used as an approximating function for discrete data, because the derivatives required in the coefficients cannot be determined. It does have great significance, however, for polynomial approximation because it has an explicit error term.

Polynomial Approximation When a polynomial of degree n, P n (x), is fitted exactly to a set of n + 1 discrete data points, (x 0, f 0 ), (x 1, f 1 ), …, (x n, f n ), the polynomial has no error at the data points themselves. However, at the locations between the data points, there is an error, which is defined by E(x) = ƒ(x) - P n (x) This error term has the form E(x) = 1/(n+1)! (x - x 0 ) (x – x 1 ) … (x – x n ) ƒ n+1 ( ξ ); x 0 ≤ξ≤x.

Interpolation In Practice

Interpolating Polynomials

Suppose we are given some values, the principle is that we fit a polynomial curve to the data. The reason for this is that polynomials are well-behaved functions, requiring simple arithmetic calculations.

Interpolating Polynomials Approximating polynomial (interpolating polynomial) should pass through all the known points. Where it does not pass through the points it should be close to the function.

Interpolating Polynomials Approximating polynomial (interpolating polynomial) should pass through all the known points. Where it does not pass through the points it should be close to the function. True function Approx 1 Approx 2

Interpolating Polynomials Note that the interpolating polynomial may miss points of discontinuity. There is only one interpolating polynomial P(x i ) or less that matches the exact values; f(x 0 ), f(x 1 ),…, f(x n ) at n+1 distinct base points. True function Approx 1 Approx 2

Interpolating Polynomials Using Polynomials to approximate a function given discrete points

Interpolating Polynomials We will be looking at two interpolating methods: 1.Lagrange Interpolation 2.Divided Difference

Lagrange Interpolation

Lagrange Polynomials A straightforward approach is the use of Lagrange polynomials. The Lagrange Polynomial may be used where the data set is unevenly spaced.

Lagrange Polynomials The formula used to interpolate between data pairs (x 0,f(x 0 )), (x 1,f(x 1 )),…, (x n,f(x n )) is given by, Where the polynomial P j (x) is given by,

Lagrange Polynomials In general,

Lagrange Polynomials Consider the table of interpolating points we wish to fit. ixf(x) 0x0x0 f(x 0 ) 1x1x1 f(x 1 ) 2x2x2 f(x 2 ) 3x3x3 f(x 3 )

Lagrange Polynomials The interpolation polynomial is, ixf(x) 0x0x0 f(x 0 ) 1x1x1 f(x 1 ) 2x2x2 f(x 2 ) 3x3x3 f(x 3 )

Lagrange Polynomials

Note that the Lagrangian polynomial passes through each of the points used in its construction.

Advantages The Lagrange formula is popular because it is well known and is easy to code. Also, the data are not required to be specified with x in ascending or descending order.

Disadvantages Although the computation of P n (x) is simple, the method is still not particularly efficient for large values of n. When n is large and the data for x is ordered, some improvement in efficiency can be obtained by considering only the data pairs in the vicinity of the x value for which P n (x) is sought. The price of this improved efficiency is the possibility of a poorer approximation to P n (x).

Diagram showing Interpolation (incrementally from one to 5 points)

Newton’s Divided differences

The nth degree polynomial may be written in the special form:

Newton’s Divided differences The nth degree polynomial may be written in the special form: If we take a i such that P n (x) = ƒ(x) at n+1 known points so that P n (x i ) = ƒ(x i ), i=0,1,…,n, then P n (x) is an interpolating polynomial.

Newton’s Divided differences A divided difference is defined as the difference in the function values at two points, divided by the difference in the values of the corresponding independent variable. Thus, the first divided difference at point is defined as

Newton’s Divided differences Thus, the first divided difference at point is defined as The second difference is given as: In general,

Newton’s Divided differences A divided difference table.

Newton’s Divided differences One with actual values.

Newton’s Divided differences The 3rd degree polynomial fitting all points from x 0 = 3.2 to x 3 = 4.8 is given by P 3 (x) = (x - 3.2) (x - 3.2)(x - 2.7) – 0.528(x - 3.2)(x - 2.7)(x - 1.0) The 4th degree polynomial fitting all points is given by P 4 (x) = P 3 (x) (x - 3.2)(x - 2.7)(x - 1.0)(x - 4.8) The interpolated value at x = 3.0 gives P 3 (x) =

Newton’s Divided differences There are two disadvantages to using the Lagrangian interpolation polynomial for interpolation. 1.It involves more arithmetic operations than does the divided differences. 2. If we desire to add or subtract a point from the set to construct the polynomial, we essentially have to start over in the computations. The divided difference avoids this.

Newton’s Divided differences Tabular data have a finite number of digits. The last digit is typically rounded off. Round off has an effect on the accuracy of the higher-order differences.

A Brief Word on Fitting Data Consider the table of data. Assume that in small regions the data can be approximated by a polynomial of low degree. ixf(x) 0x0x0 f(x 0 ) 1x1x1 f(x 1 ) 2x2x2 f(x 2 ) 3x3x3 f(x 3 )

A Brief Word on Fitting Data Because the fit is local there is a different polynomial for each region of the table. If the degree of the polynomial is low, many polynomials are needed to fit the entire region. These fits may behave better than one higher degree polynomial.

Fit using an eighth-degree polynomial Fit using a series of 3 rd degree polynomials True Curve

A Brief Word on Fitting Data Although it is tempting, higher order polynomials should not be used unless there is reason to believe that using one polynomial will give a good fit.