Interpolation A standard idea in interpolation now is to find a polynomial pn(x) of degree n (or less) that assumes the given values; thus (1) We call.

Slides:



Advertisements
Similar presentations
Section 11.6 – Taylor’s Formula with Remainder
Advertisements

Chapter 7 Numerical Differentiation and Integration
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Infinite Sequences and Series
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
INFINITE SEQUENCES AND SERIES
DERIVATIVES Linear Approximations and Differentials In this section, we will learn about: Linear approximations and differentials and their applications.
Curve-Fitting Interpolation
INTEGRALS Areas and Distances INTEGRALS In this section, we will learn that: We get the same special type of limit in trying to find the area under.
Curve-Fitting Polynomial Interpolation
INTEGRALS 5. INTEGRALS We saw in Section 5.1 that a limit of the form arises when we compute an area.  We also saw that it arises when we try to find.
Copyright © Cengage Learning. All rights reserved. 5 Integrals.
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.
Chapter 6 Numerical Interpolation
APPLICATIONS OF DIFFERENTIATION 4. In Sections 2.2 and 2.4, we investigated infinite limits and vertical asymptotes.  There, we let x approach a number.
8 TECHNIQUES OF INTEGRATION. There are two situations in which it is impossible to find the exact value of a definite integral. TECHNIQUES OF INTEGRATION.
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
DERIVATIVES 3. We have seen that a curve lies very close to its tangent line near the point of tangency. DERIVATIVES.
19.5 Numeric Integration and Differentiation
DERIVATIVES 3. We have seen that a curve lies very close to its tangent line near the point of tangency. DERIVATIVES.
Copyright © Cengage Learning. All rights reserved. 2 Derivatives.
Integrals 5.
Chapter 4 Numerical Differentiation and Integration 1/16 Given x 0, approximate f ’(x 0 ). h xfhxf xf h )()( lim)('    x0x0 x1x1 h x1x1 x0x0.
Instructor: Prof.Dr.Sahand Daneshvar Presented by: Seyed Iman Taheri Student number: Non linear Optimization Spring EASTERN MEDITERRANEAN.
In Section 4.1, we used the linearization L(x) to approximate a function f (x) near a point x = a:Section 4.1 We refer to L(x) as a “first-order” approximation.
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.
Interpolation and Approximation To the question, "Why approximate?", we can only answer, "Because we must!" Mathematical models of physical or natural.
Integrals  In Chapter 2, we used the tangent and velocity problems to introduce the derivative—the central idea in differential calculus.  In much the.
Copyright © Cengage Learning. All rights reserved. 4 Integrals.
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.
Chap. 11 Numerical Differentiation and Integration
CHAPTER 3 NUMERICAL METHODS
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
Chapter 3 Interpolation
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
1 6. Mean, Variance, Moments and Characteristic Functions For a r.v X, its p.d.f represents complete information about it, and for any Borel set B on the.
In Chapters 6 and 8, we will see how to use the integral to solve problems concerning:  Volumes  Lengths of curves  Population predictions  Cardiac.
1 What happens to the location estimator if we minimize with a power other that 2? Robert J. Blodgett Statistic Seminar - March 13, 2008.
INTEGRALS We saw in Section 5.1 that a limit of the form arises when we compute an area. We also saw that it arises when we try to find the distance traveled.
5 INTEGRALS.
Maclaurin and Taylor Polynomials Objective: Improve on the local linear approximation for higher order polynomials.
Fourier Approximation Related Matters Concerning Fourier Series.
5. Interpolation 5.1 Definition of interpolation. 5.2 Formulas for Interpolation. 5.3 Formulas for Interpolation for unequal interval. 5.4 Applications.
9.3 Taylor’s Theorem: Error Analysis yes no.
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.
CSE 330 Numerical Methods Lecture 05 Chapter 5: Numerical Differentiation Md. Omar Faruqe
LIMITS Calculating Limits Using the Limit Laws LIMITS In this section, we will: Use the Limit Laws to calculate limits.
Copyright © Cengage Learning. All rights reserved. 4 Integrals.
Copyright © Cengage Learning. All rights reserved Applications of Taylor Polynomials.
1 Approximating functions, polynomial interpolation (Lagrange and Newton’s divided differences) formulas, error approximations.
Copyright © Cengage Learning. All rights reserved.
Trigonometric Identities
CHAPTER 3 NUMERICAL METHODS
Copyright © Cengage Learning. All rights reserved.
Numerical Analysis Lecture 25.
Advanced Numerical Methods (S. A. Sahu) Code: AMC 51151
Trigonometric Identities
Calculus BC AP/Dual, Revised © : Lagrange's Error Bound
Numerical Analysis Lecture 23.
POLYNOMIAL INTERPOLATION
Section 11.6 – Taylor’s Formula with Remainder
Numerical Analysis Lecture 26.
MATH 174: Numerical Analysis
Numerical Analysis Lecture 19.
Numerical Analysis Lecture 24.
Presentation transcript:

Interpolation A standard idea in interpolation now is to find a polynomial pn(x) of degree n (or less) that assumes the given values; thus (1) We call this pn(x) an interpolation polynomial and x0, ‥‥, xn the nodes. And if ƒ(x) is a mathematical function, we call pn(x) a polynomial approximation of ƒ. We use pn(x) to get (approximate) values of ƒ for x’s between x0 and xn (“interpolation”) or sometimes outside this interval (“extrapolation”). 797 continued

Lagrange Interpolation Linear interpolation is interpolation by the straight line through (x0, ƒ0), (x1, ƒ1); see Fig. 428. Thus the linear Lagrange polynomial p1 is a sum p1 = L0ƒ0 + L1ƒ1 with L0 the linear polynomial that is 1 at x0 and 0 at x1; similarly, L1 is 0 at x0 and 1 at x1. Obviously, This gives the linear Lagrange polynomial (2) 798 continued

Fig. 428. Linear interpolation 798

Most importantly, since pn is unique, as we have shown, we have Thus |εn(x)| is 0 at the nodes and small near them, because of continuity. The product (x – x0) ‥‥ (x – xn) is large for x away from the nodes. This makes extrapolation risky. And interpolation at an x will be best if we choose nodes on both sides of that x. Also, we get error bounds by taking the smallest and the largest value of ƒ(n+1)(t) in (5) on the interval x0 ≤ t ≤ xn (or on the interval also containing x if we extrapolate). Most importantly, since pn is unique, as we have shown, we have 800

E X A M P L E 1 Linear Lagrange Interpolation Compute a 4D-value of ln 9.2 from ln 9.0 = 2.1972, ln 9.5 = 2.2513 by linear Lagrange interpolation and determine the error, using ln 9.2 = 2.2192 (4D). Solution. x0 = 9.0, x1 = 9.5, ƒ0 = ln 9.0, ƒ1 = ln 9.5. In (2) we need and obtain the answer 798 continued

The error is ε = a – a = 2.2192 – 2.2188 = 0.0004. Hence linear interpolation is not sufficient here to get 4D-accuracy; it would suffice for 3D-accuracy. 798 continued

Fig. 429. L0 and L1 in Example 1 799

Quadratic interpolation The interpolation of given (x0, ƒ0), (x1, ƒ1), (x2, ƒ2) by a second-degree polynomial p2(x), which by Lagrange’s idea is (3a) with L0(x0) = 1, L1(x1) = 1, L2(x2) = 1, and L0(x1) = L0(x2) = 0, etc. We claim that (3b) 799 continued

E X A M P L E 2 Quadratic Lagrange Interpolation Compute ln 9.2 by (3) from the data in Example 1 and the additional third value ln 11.0 = 2.3979. Solution. In (3), so that (3a) gives, exact to 4D, 799 continued

Fig. 430. L0, L1, L2 in Example 2 799

General Lagrange Interpolation Polynomial For general n we obtain (4a) where Lk(xk) = 1 and Lk is 0 at the other nodes, and the Lk are independent of the function ƒ to be interpolated. We get (4a) if we take (4b) We can easily see that pn(xk) = ƒk. 800 continued

Error Estimate If ƒ is itself a polynomial of degree n (or less), it must coincide with pn because the n + 1 data (x0, ƒ0), ‥‥, (xn, ƒn) determine a polynomial uniquely, so the error is zero. Now the special ƒ has its (n + 1)st derivative identically zero. This makes it plausible that for a general ƒ its (n + 1)st derivative ƒ(n+1) should measure the error If ƒ(n+1) exists and is continuous, then with a suitable t between x0 and xn (5) 800 continued

Error of Interpolation THEOREM 1 Formula (5) gives the error for any polynomial interpolation method if ƒ(x) has a continuous (n + 1)st derivative. 800

E X A M P L E 3 Error Estimate (5) of Linear Interpolation E X A M P L E 3 Error Estimate (5) of Linear Interpolation. Damage by Roundoff. Error Principle Estimate the error in Example 1 first by (5) directly and then by the Error Principle (Sec. 19.1). Solution. (A) Estimation by (5). We have n = 1, ƒ(t) = ln t, ƒ'(t) = 1/t, ƒ"(t) = –1/t2. Hence t = 9.0 gives the maximum 0.03/92 = 0.00037 and t = 9.5 gives the minimum 0.03/9.52 = 0.00033, so that we get 0.00033 ≤ ε1(9.2) ≤ 0.00037, or better, 0.00038 because 0.3/81 = 0.003 703 ‥‥. 801 continued

But the error 0.0004 in Example 1 disagrees, and we can learn something! Repetition of the computation there with 5D instead of 4D gives with an actual error ε = 2.21920 – 2.21885 = 0.00035, which lies nicely near the middle between our two error bounds. This shows that the discrepancy (0.0004 vs. 0.00035) was caused by rounding, which is not taken into account in (5). 801 continued

(B) Estimation by the Error Principle. We calculate p1(9. 2) = 2 (B) Estimation by the Error Principle. We calculate p1(9.2) = 2.21885 as before and then p2(9.2) as in Example 2 but with 5D, obtaining The difference p2(9.2) – p1(9.2) = 0.00031 is the approximate error of p1(9.2) that we wanted to obtain; this is an approximation of the actual error 0.00035 given above. 801

Newton’s Divided Difference Interpolation The kth divided difference, recursively denoted and defined as follows: and in general (8) 802

With p0(x) = ƒ0 by repeated application with k = 1, ‥‥, n this finally gives Newton’s divided difference interpolation formula (10) 802

Table 19.2 Newton’s Divided Difference Interpolation 803 continued

803

E X A M P L E 4 Newton’s Divided Difference Interpolation Formula Compute ƒ(9.2) from the values shown in the first two columns of the following table. 803 continued

Solution We compute the divided differences as shown. Sample computation: The values we need in (10) are circled. We have The value exact to 6D is ƒ(9.2) = ln 9.2 = 2.219 203. Note that we can nicely see how the accuracy increases from term to term: 804 continued

Equal Spacing: Newton’s Forward Difference Formula Newton’s formula (10) is valid for arbitrarily spaced nodes as they may occur in practice in experiments or observations. However, in many applications the xj’s are regularly spaced—for instance, in measurements taken at regular intervals of time. Then, denoting the distance by h, we can write (11) We can show how (8) and (10) now simplify considerably! 804 continued

Let us define the first forward difference of ƒ at xj by and the second forward difference of ƒ at xj by and, continuing in this way, the kth forward difference of ƒ at xj by (12) 804

where the binomial coefficients in the first line are defined by (15) Formula (10) becomes Newton’s (or Gregory–Newton’s) forward difference interpolation formula (14) where the binomial coefficients in the first line are defined by (15) and s! = 1 • 2 ‥‥ s. 805 continued

Error From (5) we get, with x – x0 = rh, x – x1 = (r – 1)h, etc., (16) with t as characterized in (5). 805

E X A M P L E 5 Newton’s Forward Difference Formula. Error Estimation Compute cosh 0.56 from (14) and the four values in the following table and estimate the error. 806 continued

Solution We compute the forward differences as shown in the table. The values we need are circled. In (14) we have r = (0.56 – 0.50)/0.1 = 0.6, so that (14) gives 806 continued

Error estimate. From (16), since the fourth derivative is cosh(4) t = cosh t, where A = –0.000 003 36 and 0.5 ≤ t ≤ 0.8. We do not know t, but we get an inequality by taking the largest and smallest cosh t in that interval: 806 continued

Since this gives Numeric values are The exact 6D-value is cosh 0.56 = 1.160 941. It lies within these bounds. Such bounds are not always so tight. Also, we did not consider roundoff errors, which will depend on the number of operations. 806

Equal Spacing: Newton’s Backward Difference Formula A formula similar to (14) but involving backward differences is Newton’s (or Gregory–Newton’s) backward difference interpolation formula (18) 807

E X A M P L E 6 Newton’s Forward and Backward Interpolations Compute a 7D-value of the Bessel function J0(x) for x = 1.72 from the four values in the following table, using (a) Newton’s forward formula (14), (b) Newton’s backward formula (18). 807 continued

which is exact to 6D, the exact 7D-value being 0.386 4185. Solution. The computation of the differences is the same in both cases. Only their notation differs. (a) Forward. In (14) we have r = (1.72 – 1.70)/0.1 = 0.2, and j goes from 0 to 3 (see first column). In each column we need the first given number, and (14) thus gives which is exact to 6D, the exact 7D-value being 0.386 4185. 807 continued

(b) Backward. For (18) we use j shown in the second column, and in each column the last number. Since r = (1.72 – 2.00)/ 0.1 = –2.8, we thus get from (18) 808

Central Difference Notation This is a third notation for differences. The first central difference of ƒ(x) at xj is defined by and the kth central difference of ƒ(x) at xj by (19) 808