Copyleft  2005 by MediaLab 1 1-1 Chapter 8 Interpolation (1)

Slides:



Advertisements
Similar presentations
Splines and Piecewise Interpolation
Advertisements

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.
ES 240: Scientific and Engineering Computation. Chapter 17: Numerical IntegrationIntegration  Definition –Total area within a region –In mathematical.
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.
High Accuracy Differentiation Formulas
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
MATH 685/ CSI 700/ OR 682 Lecture Notes
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.
Computational Methods in Physics PHYS 3437
Splines II – Interpolating Curves
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
Curve-Fitting Interpolation
14 Aug 2007 KKKQ 3013 PENGIRAAN BERANGKA Week 6 – Interpolation & Curve Fitting 14 August am – 9.00 am.
Curve-Fitting Polynomial Interpolation
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 181 Interpolation Chapter 18 Estimation of intermediate.
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.
CSE Interpolation Roger Crawfis.
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.
ON MULTIVARIATE POLYNOMIAL INTERPOLATION
Chapter 6 Numerical Interpolation
Numerical Solutions of Differential Equations Taylor Methods.
Numerical Integration Formulas
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Computational Methods in Physics PHYS 3437 Dr Rob Thacker Dept of Astronomy & Physics (MM-301C)
Integrals 5.
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.
Chapter 9 Function Approximation
Scientific Computing Linear and Quadratic Splines.
Simpson Rule For Integration.
Numerical Methods Part: Simpson Rule For Integration.
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.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Chapter 8 Curve Fitting.
Chapter 14 Curve Fitting : Polynomial Interpolation Gab Byung Chae.
Numerical Methods For Slides Thanks to Lecture 6 Interpolation
Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Scientific Computing Interpolation – Divided Differences Efficiency and Error Analysis.
Newton’s Interpolation. Newton Interpolation Newton’s Interpolating polynomial for a set of data {( x 1, y 1 ),( x 2, y 2 ),( x 3, y 3 ),…,( x m,y m )}
Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values at intermediate.
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #15 Spline Interpolation.
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,
1 INTERPOLASI. Direct Method of Interpolation 3 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a value.
Principles of Extrapolation
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.
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Real Zeros of Polynomial Functions
Interpolation - Introduction
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.
Numerical Analysis Lecture 25.
FST Chapter 7 Review Questions.
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.
Chapter 18.
Chapter 9 Function Approximation
Warm-up: Find the equation of a quadratic function in standard form that has a root of 2 + 3i and passes through the point (2, -27). Answer: f(x) = -3x2.
3. LAGRANGE INTERPOLATION METHOD
Splines and Piecewise Interpolation
SKTN 2393 Numerical Methods for Nuclear Engineers
3. LAGRANGE INTERPOLATION METHOD
Numerical Analysis Lecture 24.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

Copyleft  2005 by MediaLab Chapter 8 Interpolation (1)

Copyleft  2005 by MediaLab Table of Contents  8.1 Polynomial Interpolation  Lagrange Interpolation  Newton Interpolation  Difficulties with Polynomial Interpolation  8.2 Hermite Interpolation  8.3 Rational-Function Interpolation

Copyleft  2005 by MediaLab Lagrange Interpolation Polynomials  Basic concept  The Lagrange interpolating polynomial is the polynomial of degree n-1 that passes through the n points.  Using given several point, we can find Lagrange interpolation polynomial.

Copyleft  2005 by MediaLab General Form of Lagrange  The general form of the polynomial is p(x) = L 1 y 1 + L 2 y 2 + … + L n y n where the given points are (x 1,y 1 ), ….., (x n,y n ).  The equation of the line passing through two points (x 1,y 1 ) and (x 2,y 2 ) is   The equation of the parabola passing through three points (x 1,y 1 ), (x 2,y 2 ), and (x 3,y 3 ) is  

Copyleft  2005 by MediaLab Example of Lagrange Interpolation  Example  Given points (x 1,y 1 )=(-2,4), (x 2,y 2 )=(0,2), (x 3,y 3 )=(2,8) 

Copyleft  2005 by MediaLab MATLAB Function for Lagrange Interpolation  We can represent the Lagrange polynomial with coefficient c k.  p(x)=c 1 N 1 +c 2 N 2 + … +c n N n 

Copyleft  2005 by MediaLab Higher Order Interpolation Polynomials  Higher order interpolation polynomials x = [ ], y = [ ]

Copyleft  2005 by MediaLab Review and Discussion  In Lagrange interpolation polynomial, it always go through given points. Think with equation below  The Lagrange form of polynomial is convenient when the same abscissas may occur in different applications.  It is less convenient than the Newton form when additional data points may be added to the problem.

Copyleft  2005 by MediaLab  Newton form of the equation of a straight line passing through two points (x 1, y 1 ) and (x 2, y 2 ) is  Newton form of the equation of a parabola passing through three points (x 1, y 1 ), (x 2, y 2 ), and (x 3, y 3 ) is  the general form of the polynomial passing through n points (x 1, y 1 ), …,(x n, y n ) is Newton Interpolation Polynomials

Copyleft  2005 by MediaLab  Substituting (x 1, y 1 ) into  Substituting (x 2, y 2 ) into  Substituting (x 3, y 3 ) into Newton Interpolation Polynomials (cont’d)

Copyleft  2005 by MediaLab Newton Interpolation Parabola  Passing through the points (x 1, y 1 )=(-2, 4), (x 2, y 2 )=(0, 2), and (x 3, y 3 )=(2, 8).  The equations is  Where the coefficients are  thus

Copyleft  2005 by MediaLab Newton Interpolation Parabola (cont’d)  Passing through the points (x 1, y 1 )=(-2, 4), (x 2, y 2 )=(0, 2), and (x 3, y 3 )=(2, 8).

Copyleft  2005 by MediaLab Additional Data Points  We extend the previous example, adding the points (x 4, y 4 ) = (-1, -1) and (x 5, y 5 ) = (1, 1)  Divided-difference table becomes (with new entries shown in bold)  Newton interpolation polynomial is

Copyleft  2005 by MediaLab  Consider again the data from Example 8.4 with Lagrange form. x = [ ], y = [ ] Higher Order Interpolation Polynomials  Do it again with Newton form. That the polynomial is cubic is clear.

Copyleft  2005 by MediaLab Higher Order Interpolation Polynomials (cont’d)  If the y values are modified slightly, the divided-difference table shows the small contribution from the higher degree terms:

Copyleft  2005 by MediaLab MATLAB functions – Finding the coefficients function a = Newton_Coef(x, y) n = length(x); %Calculate coeffiecients of Newton interpolating polynomial a(1) = y(1); for k=1 : n-1 d(k,1) = (y(k+1) - y(k))/(x(k+1) - x(k)); %1st divided diff end for j=2 : n-1 for k=1 : n-j d(k,j) = (d(k+1,j-1) - d(k,j-1))/(x(k+j) - x(k)); %jth divided diff end d for j=2:n a(j) = d(1, j-1); end >> x = [ ]; >> y = [ ]; >> Newton_Coef(x,y); d = >>

Copyleft  2005 by MediaLab MATLAB functions – Evaluate the polynomials function p = Newton_Eval(t,x,a) % t : input value of the polynomial (x) % x : x values of interpolating points % a : answer of previous MATLAB function, i.e, the coefficients of Newton polynomial. n = length(x); hold on; for i =1 : length(t) ddd(1) = 1; %Compute first term c(1) = a(1); for j=2 : n ddd(j) = (t(i) - x(j-1)).*ddd(j-1); % Compute jth term c(j) = a(j).*ddd(j); end; p(i) = sum(c); %plot(t(i),p(i)); grid on; end t p >> a = [ ]; >> x = [ ]; >> t = [0 1 2]; >> Newton_Eval(t, x, a); t = p =

Copyleft  2005 by MediaLab  The data  x = [ – ]  y = [ ] illustrate the difficulty with using higher order polynomials to interpolate a moderately large number of points. Humped and Flat Data

Copyleft  2005 by MediaLab  The data  x = [ ]  y = [ ]  Not well suited with noisy straight line. Noisy Straight Line

Copyleft  2005 by MediaLab Runge Function  The function is a famous example of the fact that polynomial interpolation does not produce a good approximation for some functions and that using more function values (at evenly spaced x values) does not necessarily improve the situation.  Example 1.  x = [ ]  y = [ ]

Copyleft  2005 by MediaLab  Example 2.  x = [ ]  y = [ ]  The interpolation polynomial overshoots the true polynomial much more severely than the polynomial formed by using only five points. Runge Function (cont’d)

Copyleft  2005 by MediaLab Hermite Interpolation

Copyleft  2005 by MediaLab Hermite Interpolation  Hermite interpolation allows us to find a ploynomial that matched both function value and some of the derivative values

Copyleft  2005 by MediaLab More data for Product concentration

Copyleft  2005 by MediaLab MATLAB Code for Hermite interpolation

Copyleft  2005 by MediaLab Difficult Data  As with lower order polynomial interpolation, trying to interpolate in humped and flat regions cause overshoots.

Copyleft  2005 by MediaLab Rational-Function Interpolation

Copyleft  2005 by MediaLab Rational-Function Interpolation  Why use rational-function interpolation?  Some functions are not well approximated by polynomials.(runge-function)  but are well approximated by rational functions, that is quotients of polynomials.

Copyleft  2005 by MediaLab Bulirsch-Stoer algorithm  Bulirsch-Stoer algorithm  The approach is recursive, based on tabulated data(in a manner similar to that for the Newton form of polynomial interpolation).  Given a set of m+1 data points (x 1,y 1 ), …, (x m+1, y m+1 ), we seek an interpolation function of the form The proof is in J.Stoer and R.Bulirsch, 'Introduction to Numerical Analysis'

Copyleft  2005 by MediaLab Bulirsch-Stoer algorithm(cont’d) Bulirsch-Stoer method for three data points

Copyleft  2005 by MediaLab Bulirsch-Stoer algorithm(cont’d) Bulirsch-Stoer method for five data points Third stage R 5 =y 5 x 5 y 5 R 4 =y 4 x 4 y 4 R 3 =y 3 x 3 y 3 R 2 = y 2 x 2 y 2 R 1 = y 1 x 1 y 1 Second stage First stagedata

Copyleft  2005 by MediaLab Bulirsch-Stoer algorithm(cont’d) Fifth stage Forth stage

Copyleft  2005 by MediaLab Bulirsch-Stoer Rational-Function(cont’d)

Copyleft  2005 by MediaLab Example 8.13 rational-function interpolation data points: x = [ ] y = [ ]

Copyleft  2005 by MediaLab Example 8.13 rational-function interpolation(cont’d)