chapter 8 interpolation 1 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 8 Interpolation (1) PowerPoint Presentation
Download Presentation
Chapter 8 Interpolation (1)

Loading in 2 Seconds...

play fullscreen
1 / 35

Chapter 8 Interpolation (1) - PowerPoint PPT Presentation


  • 543 Views
  • Uploaded on

Chapter 8 Interpolation (1). Table of Contents. 8.1 Polynomial Interpolation 8.1.1 Lagrange Interpolation 8.1.2 Newton Interpolation 8.1.3 Difficulties with Polynomial Interpolation 8.2 Hermite Interpolation 8.3 Rational-Function Interpolation. Lagrange Interpolation Polynomials.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 8 Interpolation (1)' - bernad


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
chapter 8 interpolation 1
Chapter 8Interpolation (1)

Copyleft  2005 by MediaLab

table of contents
Table of Contents
  • 8.1 Polynomial Interpolation
    • 8.1.1 Lagrange Interpolation
    • 8.1.2 Newton Interpolation
    • 8.1.3 Difficulties with Polynomial Interpolation
  • 8.2 Hermite Interpolation
  • 8.3 Rational-Function Interpolation

Copyleft  2005 by MediaLab

lagrange interpolation polynomials
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
General Form of Lagrange
  • The general form of the polynomial is

p(x) = L1y1 + L2y2 + … + Lnyn

where the given points are (x1,y1), ….. , (xn,yn).

  • The equation of the line passing through two points (x1,y1) and (x2,y2) is
  • The equation of the parabola passing through three points (x1,y1), (x2,y2), and (x3,y3) is
  • http://math.fullerton.edu/mathews/n2003/lagrangepoly/LagrangePolyProof.pdf

Copyleft  2005 by MediaLab

example of lagrange interpolation
Example of Lagrange Interpolation
  • Example
    • Given points (x1,y1)=(-2,4), (x2,y2)=(0,2), (x3,y3)=(2,8)

Copyleft  2005 by MediaLab

matlab function for lagrange interpolation
MATLAB Function for Lagrange Interpolation
  • We can represent the Lagrange polynomial with coefficient ck.
    • p(x)=c1N1+c2N2+ … +cnNn

Copyleft  2005 by MediaLab

higher order interpolation polynomials
Higher Order Interpolation Polynomials
  • Higher order interpolation polynomials

x = [ -2 -1 0 1 2 3 4],

y = [ -15 0 3 0 -3 0 15]

Copyleft  2005 by MediaLab

review and discussion
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 interpolation polynomials
Newton Interpolation Polynomials
  • Newton form of the equation of a straight line passing through two points (x1, y1) and (x2, y2) is
  • Newton form of the equation of a parabola passing through three points (x1, y1), (x2, y2), and (x3, y3) is
  • the general form of the polynomial passing through n points (x1, y1), …,(xn, yn) is

Copyleft  2005 by MediaLab

newton interpolation polynomials cont d
Newton Interpolation Polynomials (cont’d)
  • Substituting (x1, y1) into
  • Substituting (x2, y2) into
  • Substituting (x3, y3) into

Copyleft  2005 by MediaLab

newton interpolation parabola
Newton Interpolation Parabola
  • Passing through the points (x1, y1)=(-2, 4), (x2, y2)=(0, 2), and (x3, y3)=(2, 8).
  • The equations is
  • Where the coefficients are
  • thus

Copyleft  2005 by MediaLab

newton interpolation parabola cont d
Newton Interpolation Parabola (cont’d)
  • Passing through the points (x1, y1)=(-2, 4), (x2, y2)=(0, 2), and (x3, y3)=(2, 8).

Copyleft  2005 by MediaLab

additional data points
Additional Data Points
  • We extend the previous example, adding the points (x4, y4) = (-1, -1) and (x5, y5) = (1, 1)
  • Divided-difference

table becomes

(with new entries

shown in bold)

  • Newton interpolation

polynomial is

Copyleft  2005 by MediaLab

higher order interpolation polynomials14
Higher Order Interpolation Polynomials
  • Consider again the data from

Example 8.4 with Lagrange form.

x = [ -2 -1 0 1 2 3 4 ],

y = [ -15 0 3 0 -3 0 15]

  • Do it again with Newton form.

That the polynomial is cubic is clear.

Copyleft  2005 by MediaLab

higher order interpolation polynomials cont d
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
MATLAB functions – Finding the coefficients

>> x = [-2 -1 0 1 2 3 4];

>> y = [-15 0 3 0 -3 0 15];

>> Newton_Coef(x,y);

d =

15 -6 1 0 0 0

3 -3 1 0 0 0

-3 0 1 0 0 0

-3 3 1 0 0 0

3 6 0 0 0 0

15 0 0 0 0 0

>>

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

end

d

for j=2:n

a(j) = d(1, j-1);

end

Copyleft  2005 by MediaLab

matlab functions evaluate the polynomials
MATLAB functions – Evaluate the polynomials

>> a = [-15 15 -6 1 0 0 0];

>> x = [-2 -1 0 1 2 3 4];

>> t = [0 1 2];

>> Newton_Eval(t, x, a);

t =

0 1 2

p =

3 0 -3

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

Copyleft  2005 by MediaLab

humped and flat data
Humped and Flat Data
  • The data
    • x = [ -2 -1.5 -1 -0.5 0 – 0.5 1 1.5 2]
    • y = [ 0 0 0 0.87 1 0.87 0 0 0]

illustrate the difficulty with using higher order polynomials to interpolate a moderately large number of points.

Copyleft  2005 by MediaLab

noisy straight line
Noisy Straight Line
  • The data
    • x = [ 0.00 0.20 0.80 1.00 1.20 1.90 2.00 2.10 2.95 3.00]
    • y = [ 0.01 0.22 0.76 1.03 1.18 1.94 2.01 2.08 2.90 2.95]
  • Not well suited with noisy straight line.

Copyleft  2005 by MediaLab

runge function
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 = [ -1 -0.5 0.0 0.5 1.0 ]
    • y = [0.0385 0.1379 1.0000 0.1379 0.0385]

Copyleft  2005 by MediaLab

runge function cont d
Runge Function (cont’d)
  • Example 2.
    • x = [-1.000 -0.750 -0.500 -0.250 0.000 0.250 0.500 0.750 1.000 ]
    • y = [0.0385 0.0664 0.138 0.3902 1.000 0.3902 0.138 0.0664 0.0385]
  • The interpolation polynomial overshoots the true polynomial muchmore severely than the polynomial formed by using only five points.

Copyleft  2005 by MediaLab

8 2 hermite interpolation
8.2Hermite Interpolation

Copyleft  2005 by MediaLab

hermite interpolation
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
More data for Product concentration

Copyleft  2005 by MediaLab

matlab code for hermite interpolation
MATLAB Code for Hermite interpolation

Copyleft  2005 by MediaLab

difficult data
Difficult Data
  • As with lower order polynomial interpolation, trying to interpolate in humped and flat regions cause overshoots.

Copyleft  2005 by MediaLab

8 3 rational function interpolation
8.3Rational-Function Interpolation

Copyleft  2005 by MediaLab

rational function interpolation
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
  • 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 (x1,y1), … , (xm+1, ym+1), we seek an interpolation function of the form

<Bulirsch-Stoer algorithm general pattern>

The proof is in J.Stoer and R.Bulirsch, 'Introduction to Numerical Analysis'

Copyleft  2005 by MediaLab

bulirsch stoer algorithm cont d
Bulirsch-Stoer algorithm(cont’d)
  • Bulirsch-Stoer method for three data points

Copyleft  2005 by MediaLab

bulirsch stoer algorithm cont d31

Third stage

Second stage

data

First stage

x1 y1

R1= y1

x2 y2

R2= y2

x3 y3

R3=y3

x4 y4

R4=y4

x5 y5

R5=y5

Bulirsch-Stoer algorithm(cont’d)
  • Bulirsch-Stoer method for five data points

Copyleft  2005 by MediaLab

bulirsch stoer algorithm cont d32

Fifth stage

Forth stage

Bulirsch-Stoer algorithm(cont’d)

Copyleft  2005 by MediaLab

bulirsch stoer rational function cont d
Bulirsch-Stoer Rational-Function(cont’d)

Copyleft  2005 by MediaLab

example 8 13 rational function interpolation
Example 8.13 rational-function interpolation

data points:

x = [-1 -0.5 0.0 0.5 1.0]

y = [0.0385 0.1379 1.0000 0.1379 0.0385]

Copyleft  2005 by MediaLab