CSE 541 Numerical Methods - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

CSE 541 Numerical Methods

Description:

... interpolation catches some of the curvature. Linear plus higher order ... The Divided ... high a degree causes 'wiggles' Particularly for sharp edges ... – PowerPoint PPT presentation

Number of Views:97
Avg rating:3.0/5.0
Slides: 28
Provided by: rogerc2
Category:

less

Transcript and Presenter's Notes

Title: CSE 541 Numerical Methods


1
CSE 541Numerical Methods
  • Divided Differences, Uniqueness in Polynomial
    Interpolation, and Chebyshev Nodes

2
Example ln(2)
  • Given ln(1), ln(4), and ln(6)
  • (x0, f0), (x1, f1), (x2, f2) Þ (1, 0), (4,
    1.3863), (6, 1.79176)

Note the divergence for values outside ofthe
data range
3
Linear Interpolation
  • p1(x) b0 b1(x x0)
  • 0 (1.3863-0)/(4-1)(x-1)
  • 0.4621(x - 1)
  • p1(2) 0.4621

4
Quadratic Interpolation
  • p2(x) b0 b1(x x0) b2(x x0)(x x1)
  • 0 0.4621(x-1)(((1.7918 1.3863)/(6-4)-
  • (1.3863-0)/(4-1))/(6-1))(x-1)(x-4)
  • 0.4621(x-1) - 0.051874(x-1)(x-4)
  • p2(2) 0.5658

Same approximation as Lagrange Well that was a
quadratic also! Oh yes, uniqueness!
5
Example ln(x)
  • Observation
  • Quadratic interpolation catches some of the
    curvature
  • Linear plus higher order correction
  • Improves the result somewhat
  • Does that mean that the higher the degree the
    better our results?
  • Not necessarily tune in later

6
Calculating The Divided-Differences
  • Incrementally construct a divided-difference
    table
  • Consider eight samples and the function ln(x)
  • Compute bi starting from b0

7
Calculating The Divided-Differences
Calculate b1
Calculate needed values for the next step
8
Calculating The Divided-Differences
Calculate b2
9
Calculating The Divided-Differences
Calculate b3
10
Calculating The Divided-Differences
Calculate b4
11
Calculating The Divided-Differences
Calculate b5
12
Calculating The Divided-Differences
Calculate b6
13
Calculating The Divided-Differences
  • Finally, we can calculate the last coefficient

Calculate b7
14
Calculating The Divided-Differences
  • Remember, all of the coefficients for the
    resulting polynomial are in bold
  • Can use Excel to construct this table very easily!

b0
b4
b7
15
Polynomial Form
  • Insert the divided-differences into the final
    polynomial

Divided Differences diagonal values of the table
16
Many polynomials
  • The order of the numbers (xi, yi)s only matters
    when writing the polynomial down
  • The first column in the table represents pairs of
    adjacent points connected linearly
  • i.e. linear splines
  • The second column gives us quadratics thru three
    adjacent points
  • Etc.

17
Adding an Additional Data Point
  • Easy to add another row to the table
  • Hence, only n additional divided-differences need
    to be calculated for the n 1st data points

b8
18
Uniqueness
  • Let pn(x) and qn(x) be two different polynomials
    of degree n (or less) that both interpolate n 1
    data points
  • Let rn(x) be the subtraction of these two
    polynomials
  • Þ Polynomial rn(x) has at most degree n

19
Uniqueness
  • The n 1 data points are roots of rn(x)
  • Since both pn(x) and qn(x) interpolate the n 1
    data points
  • A polynomial of degree n can only have at most n
    roots
  • But, we established that rn(x) can have degree at
    most n
  • A Contradiction!!!!!!
  • Therefore, rn(x) ? 0

20
Error
  • Define the error term
  • If f (x) is an nth order polynomial pn(x) is of
    course exact
  • Otherwise, this function has at least n 1 roots
    at the interpolation points
  • Since there is a perfect match at x0, x1,,xn

21
Interpolation Errors
  • We already have a feel for what these divided
    differences represent
  • Corollary 1 in book If f (x) is a polynomial of
    degree m lt n, then all (m 1)th divided
    differences and higher are zero

22
Interpolation Errors
  • Intuitively, the first n 1 terms of the Taylor
    Series is also an nth degree polynomial
  • Proof is in the book.

23
Interpolation Errors
  • Use the point x to expand the polynomial
  • Point is, we can take an arbitrary point x, and
    create an (n 1)th polynomial that goes thru the
    point x

24
Choosing Data Points
  • Given an interval a, b of interest, how do we
    choose data points?
  • Divide into equal sized subintervals
  • First two are the endpoints, the next point is
    the mid-point, followed by successive mid-points
    of the half-intervals
  • How many data points?
  • More means higher order approximation
  • Does this translate to better?

25
Problems with Polynomial Interpolation
  • Is it always a good idea to use higher and higher
    order polynomials?
  • No Usually 3-4 points is good and 5-6 points ok
  • Too high a degree causes wiggles
  • Particularly for sharp edges

26
Sample Point DistributionChebyshev Nodes
  • Equally distributed points is the easy way
  • This may not be the optimal solution
  • If you could select the xis unevenly, what would
    they be?
  • Want to minimize the term
  • Chebyshev nodes
  • For x -1 to 1, define

27
Chebyshev nodes
  • Lets look at these for n 4
  • Spreads the points out inthe center
Write a Comment
User Comments (0)
About PowerShow.com