Interpolation and Polynomial Approximation

Interpolation and Polynomial Approximation

<p>Chapter 3 </p><p>Interpolation and Polynomial Approximation</p><p>3.1 Interpolation and the Lagrange Polynomial</p><p>3.1.1 Lagrangian Form</p><p>Consider a polynomial of degree (n  1):</p><p> n-1 n-2 P(x) = a1x + a2x +... + an-1x + an where the ai are constants. The polynomial can be written in Lagrangian form:</p><p>P(x) = c1(x  2) (x  3)... (x  n) + c2(x  1) (x  3)... (x  n) + ...</p><p> ci(x  1) (x  2) ... (x  i-1) (x  i+1) ... (x  n) + ...</p><p> cn(x  1) (x  2)... (x  n-1)</p><p> where i, i = 1, 2, ..., n are arbitrary scalars, while the constants ci are related to the constants ai.</p><p>Example 3.1-1 ______</p><p>Write the polynomial P(x) = x 2  4x + 3 in the Lagrangian form.</p><p>Solution</p><p>The Lagrangian form for P(x) = x 2  4x + 3 is </p><p>P(x) = c1(x  2) (x  3) + c2(x  1) (x  3) + c3(x  1) (x  2) </p><p> where i, i = 1, 2, 3 are arbitrary scalars. Let 1 = 1, 2 = 2, 3 = 3, then </p><p>P(x) = c1(x  2) (x  3) + c2(x  1) (x  3) + c3(x  1) (x  2)</p><p>The constants c1 can be evaluated from the above relation by substituting x = 1 = 1</p><p>P(x = 1) = 1  4 + 3 = c1(1  2) (1  3)  c1 = 0</p><p>For x = 2 = 2</p><p>P(x = 2) = 4  8 + 3 = c2(2  1) (2  3)  c2 = 1</p><p>For x = 3 = 3</p><p>P(x = 3) = 9  12 + 3 = c3(3  1) (3  2)  c3 = 0</p><p>1 The Lagrangian form for the polynomial is</p><p>P(x) = (x  1)(x  3)</p><p>Let 1 =  2, 2 =  1, 3 = 2, then </p><p>P(x) = c1(x + 1) (x  2) + c2(x + 2) (x  2) + c3(x + 2) (x + 1)</p><p>The constants ci can be evaluated to obtain: c1 = 3.7500, c2 = -2.6667, and c3 = -0.0833. The Lagrangian form for the polynomial is</p><p>P(x) = 3.7500 (x + 1) (x  2)  2.6667 (x + 2) (x  2)  0.0833 (x + 2) (x + 1)</p><p>A short form notation for P(x) is</p><p> n n (x ) P(x) = ci   k i1 k1,#i</p><p> n where  (x  k ) denotes product of all terms (x  k), for k varying from 1 to n except i. k1,#i</p><p>Let x = i then</p><p>P(i) = ci(i  1) (i  2) ... (i  i-1) (i  i+1) ... (i  n)</p><p>The constant ci can be expressed as </p><p>P(i ) n ci =  (i   k ) k1,#i</p><p>3.1.2 Polynomial Approximation</p><p>Consider a function f(x) that passes through the two distinct points (x0, f(x0)) and (x1, f(x1)) as shown in Figure 3.1-1. The first order polynomial that approximates the function between these two points can be expressed as</p><p>P(x) = a + bx where a and b are constants. P(x) can also be written in Lagrangian form as</p><p>P(x) = c0(x  x1) + c1(x  x0) </p><p>2 f(x1 ) f(x2 ) f(x) f(x) f(x1 )</p><p> f(x0 ) f(x0 )</p><p> x0 x1 x x0 x1 x2 x Figure 3.1-1 First and second order polynomial approximation. where </p><p>P(xi ) n ci =  (xi  xk ) k0,#i or</p><p>P(x0 ) f (x0 ) P(x1 ) f (x1 ) c0 = = , and c1 = = (x0  x1 ) (x0  x1 ) (x1  x0 ) (x1  x0 )</p><p>The approximating polynomial is finally</p><p>(x  x1 ) (x  x0 ) P(x) = f(x0) + f(x1) (x0  x1 ) (x1  x0 )</p><p>The first order polynomial basis function L0(x) is defined as</p><p>(x  x1 ) 1 at x  x0 L0(x) = =  (x0  x1 ) 0 at x  x1</p><p>Similarly, the first order polynomial basis function L1(x) is defined as</p><p>(x  x0 ) 1 at x  x1 L1(x) = =  (x1  x0 ) 0 at x  x0</p><p>In terms of the basis function, P(x) can be written as </p><p>P(x) = L0(x) f(x0) + L1(x) f(x1)</p><p>If a second order polynomial is used to approximate the function using three points (x0, f(x0)), (x1, f(x1)), and (x2, f(x2)) then</p><p>3 (x  x1 )(x  x2 ) (x  x0 )(x  x2 ) (x  x0 )(x  x1 ) P(x) = f(x0) + f(x1) + f(x2) (x0  x1 )(x0  x2 ) (x1  x0 )(x1  x2 ) (x2  x0 )(x2  x1 )</p><p>P(x) can also be written in terms of the second order polynomial basis function L2,k(x)</p><p>P(x) = L2,0(x) f(x0) + L2,1(x)f(x1) + L2,2(x)f(x2)</p><p>(x  x1 )(x  x2 )  1 at x  x0 where L2,0(x) = =  (x0  x1 )(x0  x2 ) 0 at x  x1 and at x  x2</p><p>In general: L2,k(xk) = 1 at node k, L2,k(xi) = 0 at other nodes. </p><p>We now seek a polynomial P(x) of degree n that interpolates a given function f(x) between the node xi of the grid for which there are n+1 nodes x0, x1, , xn and </p><p>P(xk) = f(xk) for each k = 1, 2, , n</p><p>The polynomial is given by</p><p> n P(x) = Ln,0(x) f(x0) + Ln,1(x) f(x1) +  + Ln,n(x)f(xn) =  Ln,k (x) f(xk) k0</p><p> n (x  xi ) where Ln,k(x) =  ; Ln,k(xi) = 0 and Ln,k(xk) = 1 i0,k (xk  xi )</p><p>Polynomial approximation constitutes the foundation upon which we shall build the various numerical methods. The approximation P(x) to f(x) is known as a Lagrange interpolation polynomial, and the function Ln,k(x) is called a Lagrange basis polynomial.</p><p>Example 3.1-2 ______</p><p>Find the Lagrange interpolation polynomial that takes the values prescribed below</p><p> xk 0 1 2 4 f(xk) 1 1 2 5</p><p>Solution 3 P(x) =  L3,k (x) f(xk) k0</p><p>(x 1)(x  2)(x  4) (x  0)(x  2)(x  4) P(x) = (1) + (1) (0 1)(0  2)(0  4) (1 0)(1 2)(1 4)</p><p>(x  0)(x 1)(x  4) (x  0)(x 1)(x  2) + (2) + (5) (2  0)(2 1)(2  4) (4  0)(4 1)(4  2)</p><p>4 When working with grids having large numbers of intervals one typically assigns a set of low degree (n = 1, 2, or 3) basis functions to each adjacent set of n+1 = 2, 3, or 4 nodes. </p><p>Example 3.1-3 ______</p><p>Use global interpolation by one polynomial and piecewise polynomial interpolation with quadratic for the following nodes.</p><p> xk 0 1 2 4 5 f(xk) 0 16 48 88 0</p><p>Solution</p><p>4 Global interpolation by one polynomial: P(x) =  L4,k (x) f(xk) k0</p><p>(x 1)(x  2)(x  4)(x  5) (x  0)(x  2)(x  4)(x  5) P(x) = (0) + (16) (0 1)(0  2)(0  4)(0  5) (1 0)(1 2)(1 4)(1 5)</p><p>(x  0)(x 1)(x  4)(x  5) (x  0)(x 1)(x  2)(x  5) + (48) + (88) + 0 (2  0)(2 1)(2  4)(2  5) (4  0)(4 1)(4  3)(4  5)</p><p>Piecewise polynomial interpolation with quadratic</p><p>(x 1)(x  2) (x  0)(x  2) (x  0)(x 1) P(x) = (0) + (16) + (48); 0  x  2 (0 1)(0  2) (1  0)(1  2) (2  0)(2 1)</p><p>(x  4)(x  5) (x  2)(x  5) (x  2)(x  4) P(x) = (48) + (88) + (0); 2  x  5 (2  4)(2  5) (4  2)(4  5) (5  2)(5  4)</p><p>The error En(x) associated with the interpolation of f(x) by Pn(x) over the interval [x0, xn] can be estimated as</p><p> n1 Wn (x) d f En(x) = f(x)  Pn(x) = () (n  1)! dx n1</p><p> where  is some number lying in the open interval (x0, xn) and </p><p>Wn(x) = (x  x0)(x  x1)  (x  xn)</p><p>When the spacial increments are uniform</p><p> xk+1  xk = h, k = 0, 1, 2, , n-1</p><p>Let x = x0 + h, since 5 x1 = x0 + h  x  x1 = (  1)h</p><p> xn = x0 + nh  x  xn = (  n)h</p><p>Wn(x) = (x  x0)(x  x1)  (x  xn) = (h)[(  1)h] [(  n)h]</p><p>The error associated with interpolation is then</p><p> n1 n1 Wn (x) d f 1 d f En(x) = () = (h)[(  1)h] [(  n)h] () (n  1)! dx n1 (n  1)! dx n1</p><p>The only variable in the above expression is h the spacing of the nodes, therefore</p><p> n+1 En(x) = Ch , x0 <  < xn where C is a coefficient independent of h.</p><p> n+1 n+1 We can therefore write En(x) = O(h ) meaning that the ratio En(x)/ h is bounded by a constant as h  0. As the increment h decreases, so also will the interpolation error En.</p><p>Example 3.1-4 ______</p><p>For the function f(x) = ln(x + 1), construct interpolation polynomials of degree one and two to approximate f(0.45) from the given nodes. Find the error bound and the actual error.</p><p> xk 0 0.6 0.9 ln(x + 1) 1 0.47000 0.64185</p><p>Solution</p><p>First degree polynomial</p><p> x  0.6 x  0 P (x) = (0) + (0.47) = 0.78334x 1 0  0.6 0.6  0</p><p>P1(0.45) = 0.3525</p><p>1 d n1 f Error bound: En(x) = (x  x0)(x  x1)  (x  xn) () (n  1)! dx n1</p><p> f "( ) E (x) = | (x  x )(x  x )| 1 2! 0 1</p><p>1 1 1 f(x) = ln(x + 1)  f’(x) =  f”(x) =  f””(x) = x  1 (x  1)2 (x 1)3</p><p>6 1 1 E (x) = | (0.45  0)(0.45  0.6)| = 3.37510-2 1 (0 1)2 2</p><p>-2 Actual error = |ln(1 + 0.45)  P1(0.45)| = 1.90610</p><p>Second degree polynomial</p><p>(x  0.6)(x  0.9) (x  0)(x  0.9) P (x) = (0) + (0.47) 2 (0  0.6)(0  0.9) (0.6  0)(0.6  0.9) (x  0)(x  0.6) + (0.64185) (0.9  0.6)(0.9  0.6)</p><p>P2(0.45) = 0.36829</p><p> f "'( ) Error bound: E (x) = | (x  x )(x  x )(x  x )| 2 3! 0 1 2</p><p>1 1 E (x) = | (0.45  0)(0.45  0.6)(0.45  0.9)| = 1.012510-2 2 (0 1)2 6</p><p>-3 Actual error = |ln(1 + 0.45)  P2(0.45)| = 3.272910</p><p>7</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us