Lecture 10 Polynomial interpolation

Similar documents
Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

(0, 0), (1, ), (2, ), (3, ), (4, ), (5, ), (6, ).

3.1 Interpolation and the Lagrange Polynomial

Interpolation. Escuela de Ingeniería Informática de Oviedo. (Dpto. de Matemáticas-UniOvi) Numerical Computation Interpolation 1 / 34

1 Piecewise Cubic Interpolation

Chapter 4: Interpolation and Approximation. October 28, 2005

Computational Physics

BSM510 Numerical Analysis

Global polynomial interpolants suffer from the Runge Phenomenon if the data sites (nodes) are not chosen correctly.

Cubic Splines; Bézier Curves

Q1. Discuss, compare and contrast various curve fitting and interpolation methods

Interpolation Theory

We consider the problem of finding a polynomial that interpolates a given set of values:

Lecture 6 Simplex method for linear programming

November 20, Interpolation, Extrapolation & Polynomial Approximation

Scientific Computing: An Introductory Survey

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2.

Lectures 9-10: Polynomial and piecewise polynomial interpolation

Preliminary Examination in Numerical Analysis

CS 323: Numerical Analysis and Computing

CS 323: Numerical Analysis and Computing

Data Analysis-I. Interpolation. Soon-Hyung Yook. December 4, Soon-Hyung Yook Data Analysis-I December 4, / 1

Applied Math for Engineers

Numerical Methods I: Polynomial Interpolation

CHAPTER 4. Interpolation

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University

Cubic Splines MATH 375. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Cubic Splines

Interpolation. 1. Judd, K. Numerical Methods in Economics, Cambridge: MIT Press. Chapter

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University

Math 660-Lecture 15: Finite element spaces (I)

Chapter 1 Numerical approximation of data : interpolation, least squares method

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2?

Hermite Interpolation

Outline. 1 Interpolation. 2 Polynomial Interpolation. 3 Piecewise Polynomial Interpolation

Math Numerical Analysis Mid-Term Test Solutions

Function approximation

University of Houston, Department of Mathematics Numerical Analysis, Fall 2005

Numerical Methods. King Saud University

Polynomial Interpolation

Chapter 3 Interpolation and Polynomial Approximation

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes).

Lecture 4 Eigenvalue problems

Convergence rates of derivatives of a family of barycentric rational interpolants

1 Motivation for Newton interpolation

Integration, differentiation, and root finding. Phys 420/580 Lecture 7

A first order divided difference

Curve Fitting and Interpolation

Numerical Analysis: Interpolation Part 1

Lecture 14 Numerical integration: advanced topics

[2] (a) Develop and describe the piecewise linear Galerkin finite element approximation of,

1) The line has a slope of ) The line passes through (2, 11) and. 6) r(x) = x + 4. From memory match each equation with its graph.

Fixed point iteration and root finding

1 Review of Interpolation using Cubic Splines

Applied Numerical Analysis Quiz #2

Scientific Computing

Geometric Interpolation by Planar Cubic Polynomials

Numerical Methods I Orthogonal Polynomials

Interpolation & Polynomial Approximation. Hermite Interpolation I

Chapter 2 Interpolation

Physics 331 Introduction to Numerical Techniques in Physics

Neville s Method. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Neville s Method

Applied Numerical Analysis Homework #3

Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation

The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods

Applied Math 205. Full office hour schedule:

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Numerical interpolation, extrapolation and fi tting of data

Additional exercises with Numerieke Analyse

Interpolation. Chapter Interpolation. 7.2 Existence, Uniqueness and conditioning

Cubic Splines. Antony Jameson. Department of Aeronautics and Astronautics, Stanford University, Stanford, California, 94305

Scientific Computing: Numerical Integration

Numerical Methods I: Interpolation (cont ed)

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

Introduction Linear system Nonlinear equation Interpolation

Math 2142 Homework 5 Part 1 Solutions

Interpolation and extrapolation

Ay190 Computational Astrophysics

Chapter 2 notes from powerpoints

CS412: Introduction to Numerical Methods

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

NUMERICAL METHODS. x n+1 = 2x n x 2 n. In particular: which of them gives faster convergence, and why? [Work to four decimal places.

Q 0 x if x 0 x x 1. S 1 x if x 1 x x 2. i 0,1,...,n 1, and L x L n 1 x if x n 1 x x n

Introductory Numerical Analysis

CALCULUS JIA-MING (FRANK) LIOU

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

In practice one often meets a situation where the function of interest, f(x), is only represented by a discrete set of tabulated points,

Polynomial Interpolation Part II

Chapter 2: First Order DE 2.6 Exact DE and Integrating Fa

STOP, a i+ 1 is the desired root. )f(a i) > 0. Else If f(a i+ 1. Set a i+1 = a i+ 1 and b i+1 = b Else Set a i+1 = a i and b i+1 = a i+ 1

Interpolation and polynomial approximation Interpolation

Applied Numerical Analysis (AE2220-I) R. Klees and R.P. Dwight

Numerical Marine Hydrodynamics

Section 0.2 & 0.3 Worksheet. Types of Functions

( 3) ( ) ( ) ( ) ( ) ( )

Lecture 15 Random variables

Lecture 1 Numerical methods: principles, algorithms and applications: an introduction

GENG2140, S2, 2012 Week 7: Curve fitting

Interpolation and Approximation

Transcription:

Lecture 10 Polynomial interpolation Weinan E 1,2 and Tiejun Li 2 1 Department of Mathematics, Princeton University, weinan@princeton.edu 2 School of Mathematical Sciences, Peking University, tieli@pku.edu.cn No.1 Science Building, 1575

Outline Examples Polynomial interpolation Piecewise polynomial interpolation

Basic motivations Plotting a smooth curve through discrete data points Suppose we have a sequence of data points Coordinates x 1 x 2 x n Function y 1 y 2 y n Try to plot a smooth curve (a continuous differentiable function) connecting these discrete points.

Basic motivations Representing a complicate function by a simple one Suppose we have a complicate function y = f(x), we want to compute function values, derivatives, integrations,... very quickly and easily. One strategy 1. Compute some discrete points from the complicate form; 2. Interpolate the discrete points by a polynomial function or piecewise polynomial function; 3. Compute the function values, derivatives or integrations via the simple form.

Polynomial interpolation Polynomial interpolation is one the most fundamental problems in numerical methods.

Outline Examples Polynomial interpolation Piecewise polynomial interpolation

Method of undetermined coefficients Suppose we have n + 1 discrete points (x 0, y 0), (x 1, y 1),..., (x n, y n) We need a polynomial of degree n to do interpolation (n + 1 equations and n + 1 undetermined coefficients a 0, a 1,..., a n p n(x) = a nx n + a n 1x n 1 + + a 0 Equations p n(x 0) = y 0 p n(x 1) = y 1 p n(x n) = y n

Method of undetermined coefficients The coefficient matrix V n = x n 0 x n 1 0 x 0 x n 1 x n 1 1 x 1 x n n x n 1 n x n is a Vandermonde determinant, nonsingular if x i x j (i j). Though this method can give the interpolation polynomial theoretically, the condition number of the Vandermonde matrix is very bad! For example, if x 0 = 0, x 1 = 1 n, x2 = 2 n,, xn = 1 then V n 1 n n!

Lagrange interpolating polynomial Consider the interpolation problem for 2 points (linear interpolation), one type is the point-slope form Another type is as p(x) = y1 y0 y0x1 y1x0 x + x 1 x 0 x 1 x 0 p(x) = y 0l 0(x) + y 1l 1(x) where satisfies l 0(x) = x x1 x 0 x 1, l 1(x) = x x0 x 1 x 0 l 0(x 0) = 1, l 0(x 1) = 0; l 1(x 0) = 0, l 1(x 1) = 1 l 0(x), l 1(x) are called basis functions. They are another base for space spanned by functions 1, x.

Lagrange interpolating polynomial Define the basis function l i(x) = then we have (x x0)(x x1) (x xi 1)(x xi+1) (x xn) (x i x 0)(x i x 1) (x i x i 1)(x i x i+1) (x i x n) l i(x j) = δ ij = { 1 i = j 0 i j The functions l i(x) (i = 0, 1,..., n) form a new basis in P n instead of 1, x, x 2,..., x n.

Lagrange interpolating polynomial General form of the Lagrange polynomial interpolation L n(x) = y 0l 0(x) + y 1l 1(x) + + y nl n(x) then L n(x) satisfies the interpolation condition. The shortcoming of Lagrange interpolation polynomial: If we add a new interpolation point into the sequence, all the basis functions will be useless!

Newton interpolation Define the 0-th order divided difference f[x i] = f(x i) Define the 1-th order divided difference f[x i, x j] = f[xi] f[xj] x i x j Define the k-th order divided difference by k 1-th order divided difference recursively f[x i0, x i1,..., x ik ] = f[xi 0, x i1,..., x ik 1 ] f[x i1, x i2,..., x ik ] x i0 x ik

Newton interpolation Recursively we have the following divided difference table Coordinates 0-th order 1-th order 2-th order x 0 f[x 0] x 1 f[x 1] f[x 0, x 1] x 2 f[x 2] f[x 1, x 2] f[x 0, x 1, x 2] x 3 f[x 3] f[x 2, x 3] f[x 1, x 2, x 3]....

Newton interpolation Divided difference table: an example Discrete data points x 0.00 0.20 0.30 0.50 f(x) 0.00000 0.20134 0.30452 0.52110 Divided difference table i x i f[x i ] f[x i 1, x i ] f[x i 2, x i 1, x i ] f[x 0, x 1, x 2, x 3 ] 0 0.00 0.00000 1 0.20 0.20134 1.0067 2 0.30 0.30452 1.0318 0.08367 3 0.50 0.52110 1.0829 0.17033 0.17332

Newton interpolation The properties of divided difference 1. f[x 0, x 1,..., x k ] is the linear combination of f(x 0), f(x 1),..., f(x n). 2. The value of f[x 0, x 1,..., x k ] does NOT depend on the order the coordinates x 0, x 1,..., x k. 3. If f[x, x 0,..., x k ] is a polynomial of degree m, then f[x, x 0,..., x k, x k+1 ] is of degree m 1. 4. If f(x) is a polynomial of degree n, then f[x, x 0,..., x n] = 0

Newton interpolation From the definition of divided difference, we have for any function f(x) f(x) = f[x 0] + f[x 0, x 1](x x 0) + f[x 0, x 1, x 2](x x 0)(x x 1) + + f[x 0, x 1,..., x n](x x 0)(x x 1) (x x n 1) +f[x, x 0, x 1,..., x n](x x 0)(x x 1) (x x n) Take f(x) as the Lagrange interpolation polynomial L n(x), because L n[x, x 0, x 1,..., x n] = 0 we have L n(x) = f[x 0] + f[x 0, x 1](x x 0) + f[x 0, x 1, x 2](x x 0)(x x 1)+ + + f[x 0, x 1,..., x n](x x 0)(x x 1) (x x n 1) This formula is called Newton interpolation formula.

Hermite interpolation Hermite interpolation is the interpolation specified derivatives. Formulation: find a polynomial p(x) such that p(x 0) = f(x 0), p (x 0) = f (x 0), p(x 1) = f(x 1), p (x 1) = f (x 1) Sketch of Hermite interpolation Hermite interpolation

Hermite interpolation We need a cubic polynomial to fit the four degrees of freedom, one choice is p(x) = a + b(x x 0) + c(x x 0) 2 + d(x x 0) 2 (x x 1) We have p (x) = b + 2c(x x 0) + 2d(x x 0)(x x 1) + d(x x 0) 2 then we have f(x 0) = a, f (x 0) = b f(x 1) = a + bh + ch 2, f (x 1) = b + 2ch + dh 2 (h = x 1 x 0) a, b, c, d could be solved.

Error estimates Theorem Suppose a = x 0 < x 1 < < x n = b, f(x) C n+1 [a, b], L n(x) is the Lagrange interpolation polynomial, then where E(f; x) = f(x) L n(x) ωn(x) (n + 1)! Mn+1 ω n(x) = (x x 0)(x x 1) (x x n), M n+1 = max x [a,b] f (n+1) (x). Remark: This theorem doesn t imply the uniform convergence when n.

Runge phenomenon Suppose take the equi-partitioned nodes f(x) = Lagrange interpolation (n = 10) 1 1 + 25x 2 x i = 1 + 2i, i = 0, 1,..., n n 2 1.5 1 0.5 0 0.5 5 4 3 2 1 0 1 2 3 4 5

Remark on polynomial interpolation Runge phenomenon tells us Lagrange interpolation could NOT guarantee the uniform convergence when n. Another note: high order polynomial interpolation is unstable! This drives us to investigate the piecewise interpolation.

Outline Examples Polynomial interpolation Piecewise polynomial interpolation

Piecewise linear interpolation Suppose we have n + 1 discrete points (x 0, y 0), (x 1, y 1),..., (x n, y n) Piecewise linear interpolation is to connect the discrete data points as

Tent basis functions Define the piecewise linear basis functions as x x 1, x [x 0, x 1], l n,0(x) = x 0 x 1 0, x [x 1, x n], x x i 1, x [x i 1, x i], x i x i 1 x x l n,i(x) = i+1, x [x i, x i+1], i = 1, 2,..., n 1, x i x i+1 0, x / [x i 1, x i+1], x x n 1, x [x n 1, x n], l n,n(x) = x n x n 1 0, x [x 0, x n 1].

Tent basis functions The sketch of tent basis function l i (x) 1 l 0 (x) l i (x)(0 <i<n) l n (x) x 0 x 1 x i 1 x i x i+1 x n 1 x n x Ξ 2.2: #}P s@aλ: l i (x) VΞ_

Piecewise linear interpolation function With the above tent basis function l n,i(x), we have l n,i(x j) = δ ij = { 1 i = j 0 i j The functions l n,i(x) form a basis in piecewise linear function space with nodes x i (i = 0, 1,..., n). Piecewise linear interpolation function p(x) = y 0l n,0(x) + y 1l n,1(x) + + y nl n,n(x) then p(x) satisfies the interpolation condition.

Cubic spline In order to make the interpolation curve more smooth, cubic spline is introduced. Formulation: Given discrete points (x 0, y 0), (x 1, y 1),..., (x n, y n), find function S h (x) such that (1) S h (x) is a cubic polynomial in each interval [x i, x i+1]; (2) S h (x i) = y i, i = 0, 1,..., n; (3) S h (x) C 2 [a, b].

Cubic spline Suppose we have n cubic polynomials in each interval, we have 4n unknowns totally. The interpolation condition gives 2n equations, S h (x) C 1 gives n 1 equations, S h (x) C 2 gives n 1 equations, so we have 4n 2 equations totally, we need some boundary conditions. Supplementary boundary conditions: (1) Fixed boundary: S h(x 0) = f (x 0),S h(x n) = f (x n); (2) Natural boundary: S h(x 0) = 0,S h(x n) = 0; (3) Periodic boundary: S h (x 0) = S h (x n), S h(x 0) = S h(x n), S h(x 0) = S h(x n). Each type of boundary condition gives 2 equations, thus we have 4n equations and 4n unknowns. The system could be solved theoretically. Problem: Why are piecewise cubic polynomials needed?)

Homework assignment Take interpolation points x k = 1 + 2k, k = 0, 1,..., n n for Runge function, plot the Lagrange polynomial of degree n (n = 1, 2,..., 15). Take interpolation points x k = cos kπ, k = 0, 1,..., n n for Runge function, plot the Lagrange polynomial of degree n (n = 1, 2,..., 15).