Chapter 3 Interpolation

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
Computational Methods in Physics PHYS 3437
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
INFINITE SEQUENCES AND SERIES
Ch 5.2: Series Solutions Near an Ordinary Point, Part I
Curve Fitting and Interpolation: Lecture (II)
Infinite Sequences and Series
1 Chapter 3 INTERPOLATION. 2 WHAT IS INTERPOLATION? Given (x 0,y 0 ), (x 1,y 1 ), …, (x n,y n ), finding the value of ‘y’ at a value of ‘x’ in ( x 0,
Chapter 6 Numerical Interpolation
Zeros of Polynomial Functions
Chapter 4 – Polynomials and Rational Functions
Chapter 3 Limits and the Derivative
Applied Numerical Analysis Chapter 2 Notes (continued)
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
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.
Chapters 5 and 6: Numerical Integration
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
MA2213 Lecture 4 Numerical Integration. Introduction Definition is the limit of Riemann sums I(f)
Infinite Series Copyright © Cengage Learning. All rights reserved.
difficult if we consider Didn’t you say it’s a very
Copyright © 2014, 2010 Pearson Education, Inc. Chapter 2 Polynomials and Rational Functions Copyright © 2014, 2010 Pearson Education, Inc.
Integration Copyright © Cengage Learning. All rights reserved.
Polynomials. Intro An algebraic expression in which variables involved have only non-negative integral powers is called a polynomial. E.g.- (a) 2x 3 –4x.
4.5: More on Zeros of Polynomial Functions The Upper and Lower Bound Theorem helps us rule out many of a polynomial equation's possible rational roots.
1. Interpolating polynomials Polynomial of degree n,, is a linear combination of Definitions: (interval, continuous function, abscissas, and polynomial)
Chapter 5-The Integral Calculus, 2ed, by Blank & Krantz, Copyright 2011 by John Wiley & Sons, Inc, All Rights Reserved.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
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.
CHAPTER 3 NUMERICAL METHODS
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
EE3561_Unit 5(c)AL-DHAIFALLAH14361 EE 3561 : Computational Methods Unit 5 : Interpolation Dr. Mujahed AlDhaifallah (Term 351) Read Chapter 18, Sections.
1 © 2010 Pearson Education, Inc. All rights reserved © 2010 Pearson Education, Inc. All rights reserved Chapter 3 Polynomial and Rational Functions.
 3.3 Hermite Interpolation Chapter 3 Interpolation and Polynomial Approximation -- Hermite Interpolation Find the osculating polynomial P(x) such that.
By: Mark Coose Joetta Swift Micah Weiss. What Problems Can Interpolation Solve? Given a table of values, find a simple function that passes through the.
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.
5. Interpolation 5.1 Definition of interpolation. 5.2 Formulas for Interpolation. 5.3 Formulas for Interpolation for unequal interval. 5.4 Applications.
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
Answers for Review Questions for Lectures 1-4. Review Lectures 1-4 Problems Question 2. Derive a closed form for the estimate of the solution of the equation.
1 Approximating functions, polynomial interpolation (Lagrange and Newton’s divided differences) formulas, error approximations.
Computational Methods CMSC/AMSC/MAPL 460 Polynomial Interpolation Ramani Duraiswami, Dept. of Computer Science.
CHAPTER 3 NUMERICAL METHODS
In the special case c = 0, T (x) is also called the Maclaurin Series: THEOREM 1 Taylor Series Expansion If f (x) is represented by a power series.
College Algebra Chapter 3 Polynomial and Rational Functions
Copyright © Cengage Learning. All rights reserved.
Numerical Analysis Lecture 25.
3.7 The Real Zeros of a Polynomial Function
Sullivan Algebra and Trigonometry: Section 5
Zeros of Polynomial Functions
Interpolation.
3.7 The Real Zeros of a Polynomial Function
Ch 5.2: Series Solutions Near an Ordinary Point, Part I
Numerical Analysis Lecture 23.
Numerical Analysis Lecture 26.
Copyright © Cengage Learning. All rights reserved.
MATH 174: Numerical Analysis
Numerical Computation and Optimization
Infinite Sequences and Series
3.6 Polynomial Functions Part 2
Numerical Integration
9.7 Taylor Polynomials & Approximations
Numerical Analysis Lecture 21.
Copyright © Cengage Learning. All rights reserved.
Chapter 2 Limits and the Derivative
Presentation transcript:

Chapter 3 Interpolation and Polynomial Approximation If a function y = f(x) is too complicated for calculation or is even unknown, one way to approximate it is to first obtain its values y0 = f(x0), … yn = f(xn) at a sequence of points x0 … xn, and then construct a relatively simple approximating function g(x)  f(x). If g(x) satisfies that g(xi) = f(xi) for all i = 0, … n, it is called the interpolating function of f(x). The most commonly used interpolating functions are …? algebraic polynomials. g(x)  f(x) x0 x1 x2 x3 x4 x 1/19

satisfying L1,i(xj)=ij /* Kronecker Delta */ Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial  3.1 Interpolation and the Lagrange Polynomial Find a polynomial of degree n, Pn(x) = a0 + a1x + … + anxn, such that Pn(xi) = yi for all i = 0, …, n. Note: for any i  j, we must have xi  xj . Lagrange Basis, satisfying L1,i(xj)=ij /* Kronecker Delta */ Given x0 , x1; y0 , y1 . Find P1(x) = a0 + a1x such that P1(x0) = y0 and P1(x1) = y1 . n = 1 P1(x) is the line function through the two given points ( x0 , y0 ) and ( x1, y1 ) . ) ( 1 x y P - + = 1 x - = y0 + y1  = 1 ) ( i 1, i y x L L1,0(x) L1,1(x) 2/19

The n-th Lagrange interpolating polynomial Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial The mathematician S. had to move to a new place. His wife didn't trust him very much, so when they stood down on the street with all their things, she asked him to watch their ten trunks, while she got a taxi. Some minutes later she returned. Said the husband: "I thought you said there were ten trunks, but I've only counted to nine!" The wife said: "No, they're TEN!" "But I have counted them: 0, 1, 2, ..." Find Ln,i(x) for i = 0, …, n such that Ln,i(xj)=ij . Then let . Hence Pn(xi) = yi .  = n i y x P ) ( Ln,i(x) n  1 Ln,i(x) Each Ln,i has n roots x0 … xi … xn The n-th Lagrange interpolating polynomial  = - n j j  i i x C ) ( )...( Ln,i(x)  - = j  i j i x C ) ( 1 Ln,i 3/19

D(x) = Pn(x) – Qn(x) is a polynomial of degree  n Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial Theorem: If x0, x1, …, xn are n + 1 distinct numbers and f is a function whose values are given at these numbers, then the n-th Lagrange interpolating polynomial is unique. Proof: If not… Then there exists two polynomials Pn(x) and Qn(x) both satisfying the interpolating conditions. D(x) = Pn(x) – Qn(x) is a polynomial of degree  n Yet D(x) has distinct roots x0, x1, …, xn . n + 1 Note: The interpolating polynomial is NOT unique unless its degree is constrained to be no greater than n. A counterexample is where p(x) can be a polynomial of any degree. 4/19

   Analyze the Remainder ! ) 1 ( + = n f x K = + - ! ) 1 )( ( n x K Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial  Analyze the Remainder Suppose Consider the truncation error and f  Cn + 1[a, b].  = - n i x K R ) ( Rolle’s Theorem: If (x) is sufficiently smooth with (x0) = (x1) = 0, then there exists   (x0 , x1) such that  ’() = 0. Rn(x) has at least roots n+1 Fix any x  xi for all i = 0, …, n. Define the function g for t in [a, b] by In general, if (x0) = (x1) = (x2) = 0  = -  n i x t K Rn ) ( g(t) such that There exist g(x) has n+2 distinct roots x0 … xn x such that There exists = + - ! ) 1 )( ( n x K P f ! ) 1 ( + - n x K R ! ) 1 ( + = n f x K such that There exists 5/19

Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial Note:  Since in most of the cases x cannot be determined, we obtain the upper bound of f (n+1) instead. That is, estimate an Mn+1 such that for all x(a,b) and take as the upper bound of the total error.  The interpolating polynomial is accurate for any polynomial function f with degree  n since f (n+1)(x)  0. Quiz: Given xi = i +1, i = 0, 1, 2, 3, 4, 5. Which is the graph of L5, 2(x)? y - 1 0.5 2 3 4 5 6 x A B C  6/19

h  1.72  10–3 Simply take n = 1000 and h = 0.001. Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial Example: Suppose a table is to be prepared for the function f(x) = ex for x in [0, 1]. Assume that each entry of the table is accurate up to 8 decimal places and the step size is h. What should h be for linear interpolation to give an absolute error of at most 10– 6 ? Solution: Suppose that [0, 1] is partitioned into n equal-spaced subintervals [x0, x1], [x1, x2], …, [xn–1 , xn], and x is in the interval [xk, xk+1]. Then the error estimation gives h  1.72  10–3 Simply take n = 1000 and h = 0.001. 7/19

In general, interpolation is better than extrapolation. Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial Example: Given Use the linear and the quadratic Lagrange polynomial of sin x to compute sin 50 and then estimate the errors. Solution: First use x0, x1 and x1, x2 to compute the linear interpolations.  Use In general, interpolation is better than extrapolation. ) 18 5 ( 50 sin 1  p P 0.77614 Here and sin 50 = 0.7660444… Error of extrapolation  0.01001  Use sin 50  0.76008, Error of interpolation  0.00596 8/19

Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial Now use x0, x1 and x2 to compute the quadratic interpolation. ) 18 5 ( 50 sin 2  p P 0.76543 sin 50 = 0.7660444… Error of the quadratic interpolation  0.00061 Interpolation with higher degree usually obtain better results. The higher the better? Nooooooo…. 9/19

When you start writing the program, Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial When you start writing the program, you will find how easy it is to calculate the Lagrange polynomial. Oh yeah? What if I find the current interpolation not accurate enough? Right. Then all the Lagrange basis, Ln,i(x), will have to be re-calculated. Then you might want to take more interpolating points into account. Excellent point ! Let’s look at Neville’s Method… 10/19

Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial Definition: Let f be a function defined at x0, x1, …, xn, and suppose that m1, …, mk are k distinct integers with 0  mi  n for each i. The Lagrange polynomial that agrees with f(x) at the k points denoted by Theorem: Let f be defined at x0, x1, …, xk, and let xi and xj be two distinct numbers in this set. Then describes the k-th Lagrange polynomial that interpolates f at the k+1 points x0, x1, …, xk . Proof: For any 0  r  k and r  i and j, the two interpolating polynomials on the numerator are equal to f(xr) at xr , so P(xr) = f(xr). The first polynomials on the numerator equals f(xi) at xi , while the second term is zero, so P(xi) = f(xi). Similarly P(xj) = f(xj). The k-th Lagrange polynomial that interpolates f at the k+1 points x0, x1, …, xk is unique. 11/19

HW: p.119 #5; p.120 #17  Neville’s Method x0 x1 x2 x3 x4 P0 P1 P2 P3 Chapter 3 Interpolation and Polynomial Approximation -- Interpolation and the Lagrange Polynomial  Neville’s Method x0 x1 x2 x3 x4 P0 P1 P2 P3 P4 P0,1 P1,2 P2,3 P3,4 P0,1,2 P1,2,3 P2,3,4 P0,1,2,3 P1,2,3,4 P0,1,2,3,4 HW: p.119 #5; p.120 #17 12/19

 3.2 Divided Differences ] , ... [ = x f Chapter 3 Interpolation and Polynomial Approximation -- Divided Differences  3.2 Divided Differences The 1st divided difference of f w.r.t. xi and xj The 2nd divided difference of f w.r.t. xi , xj and xk The k+1st divided difference of f w.r.t. x0 … xk+1 1 ] , ... [ + - = k x f 13/19

Warning: my head is exploding… What is the point of this formula? Chapter 3 Interpolation and Polynomial Approximation -- Divided Differences As a matter of fact, where Warning: my head is exploding… What is the point of this formula? The value of f [ x0, …, xk ] is independent of the order of the numbers x0, …, xk . 14/19

… … … … ai = f [ x0, …, xi ]  Newton’s Interpolation Nn(x) Rn(x) 1 2 Chapter 3 Interpolation and Polynomial Approximation -- Divided Differences  Newton’s Interpolation 1 2 … … … … n1 1 + (x  x0)  2 + … … + (x  x0)…(x  xn1)  n1 Nn(x) ai = f [ x0, …, xi ] Rn(x) 15/19

 Since the n-th interpolating polynomial is unique, Nn(x)  Pn(x). Chapter 3 Interpolation and Polynomial Approximation -- Divided Differences Note:  Since the n-th interpolating polynomial is unique, Nn(x)  Pn(x).  They must have the same truncation error. That is,  The procedure is similar to Neville’s method. f (x0) f (x1) f (x2) … f (xn1) f (xn) f [x0, x1] f [x1, x2] … … f [xn1, xn] f [x0, x1 , x2] … … f [xn2, xn1, xn] f [x0, …, xn] f (xn+1) f [xn, xn+1] f [xn1, xn, xn+1] f [x1, …, xn+1] f [x0, …, xn+1] 16/19

 Formulae with Equal Spacing Chapter 3 Interpolation and Polynomial Approximation -- Divided Differences  Formulae with Equal Spacing If the points are equally spaced: i f - =  + 1 forward difference i k f 1 ) ( - +  = i1 i f - =  backward difference 1 -  = i k f 其中 centered difference 17/19

   Some important properties  Linearity: Chapter 3 Interpolation and Polynomial Approximation -- Divided Differences  Some important properties  Linearity:  If f (x) is a polynomial of degree m , then is a polynomial of degree m – k and  The values of the differences can be obtained from the function  = - + D n j k f ) 1 (  where /* binomial coefficients */ k j n f D  = +  And vice-versa k h f x ! ] , ... [ D = n 1  - From Rn  k h f ) ( D = x 18/19

Chapter 3 Interpolation and Polynomial Approximation -- Divided Differences Newton’s formulae  Newton’s forward-difference formula Let , then ) ( x f k t h N n  = +  HW: p.131 #5(a)(b); p.132 #13  Newton’s backward-difference formula Reverse the order of the points Let , then ) ( 1 n k x f t h N  - = +  19/19