FEM SUM NO

Embed Size (px)

Citation preview

  • 7/30/2019 FEM SUM NO

    1/22

    Hermite InterpolationPolynomial

    Zeki Onur Urhan

    MCS 492 Final Project Report

    ADVISOR: Ins.OZLEM DEFTERLI

    DEPARTMENT OF MATHEMATICS AND COMPUTER

    SCIENCE

    CANKAYA UNIVERSITY

    SPRING 2009

  • 7/30/2019 FEM SUM NO

    2/22

    Contents

    1 Introduction 3

    2 Preliminaries 5

    3 Hermite Interpolation 9

    4 Applications 17

    5 Conclusion 20

    1

  • 7/30/2019 FEM SUM NO

    3/22

    I appreciate to Ozlem Defterli for her help and patience.

    2

  • 7/30/2019 FEM SUM NO

    4/22

    Chapter 1

    Introduction

    Charles Hermite (December 24, 1822 January 14, 1901) was a French mathe-matician who did research on number theory, quadratic forms, invariant theory,orthogonal polynomials, elliptic functions, and algebra.

    Hermite polynomials, Hermite normal form, Hermitian operators, and cubicHermite splines are named in his honor. One of his students was Henri Poincar.

    He was the first to prove that e(mathematical constant), the base of natu-ral logarithms, is a transcendental number. His methods were later used by

    Ferdinand von Lindemann to prove that is transcendental.

    In a letter to Thomas Stieltjes in 1893, Hermite famously remarked: I turnwith terror and horror from this lamentable scourge of continuous functionswith no derivatives.

    Because bounding the error in Hermite interpolation in terms of the deriva-tive which kills the interpolating space is of interest in numerical analysis andin the analysis of ordinary differential equations, there is an extensive litera-ture on the subject. In view of the recent work involving splines a large part ofthis is now superseded. It is expected that within the next few years a much

    better understanding of the problem and its history will be obtained.In this work my aim is to study the basic notions of Hermite Interpolation

    3

  • 7/30/2019 FEM SUM NO

    5/22

    and its error analysis. Then I presented its advantages and disadvantages viaLagrange Interpolation and its error analysis. Next I apply these interpolations

    to concrete examples.

    In first chapter I try to explain Lagrange Interpolation. In second chapterI will explain Hermit Interpolation and the differences between Lagrange In-terpolation. In chapter three I apply Hermite and Lagrange Interpolation tosome concrete examples.

    4

  • 7/30/2019 FEM SUM NO

    6/22

    Chapter 2

    Preliminaries

    Lagrange Interpolation:Given data discrete points x1; . . . ; xQ in 1-D and given a function f that isdefined at these points, the Lagrange interpolating polynomial is the uniquepolynomial L of degree Q-1 which interpolates the function f at these points.By this we mean

    L(xi) = f(xi), i = 1, . . . , Q . (2.1)

    The standard form for L is

    L(x) =

    Qj=1

    cjxj1. (2.2)

    The coefficients of L can be determined by substituting 3.2 into 3.1 andsolving the resulting QQ linear system for the cj . Alternatively, L one can

    5

  • 7/30/2019 FEM SUM NO

    7/22

    compute the Lagrange representation

    L(x) =Qi=1

    f(xi)i(x)|; + E(x). (2.3)

    where the Lagrange basis functions are defined by

    i(x) =

    1kQ; k=1(x xk)1kQ; k=1(xi xk)

    =(x x1) . . . (x xi1)(x xi+1) . . . (x xQ)

    (xi x1) . . . (xi xi1)(xi xi+1) . . . (xi xQ)

    (2.4)

    Note that for each i, j = 1, . . . , Q

    i(xj) = i,j

    where i, j denotes the Kronacker delta, whose value is 1 of i = j and 0 ifi = j.

    Error Analysis for Lagrange

    If L(x) is the polynomial of degree Q - 1 which interpolates f(x) at {xi}Q

    (i=1)and if f CQ[a, b], then it can be shown that the pointwise approximationerror is given by

    E(x) = f(x) L(x) =1

    Q!

    dQf

    dxQ(x)(x), f or some x (a, b), (2.5)

    where

    (x)

    Q(k=1)

    (x xk) = (x x1)(x x2) . . . (x xQ) (2.6)

    6

  • 7/30/2019 FEM SUM NO

    8/22

    Example 1: Assume f(x) = log(x). And f(2) = 0, 3010; f(3) = 0, 4771;f(4) = 0, 6021. Evaluate the Lagrange interpolation of f(2.4)?

    Solution: Lagrange interpolation from 3.3 gives

    L(2.4) =(0.6)(1.6)

    (1)(2)f(2) +

    (0.4)(1.6)

    (1)(1)f(3) +

    (0.4)(0.6)

    (2)(1)f(4)

    = 0.48 0.3010 + 0.64 0.4771 0.12 0.6021

    = 0.3776

    (2.7)

    whereas the true value is log(2.4) = 0.3802. With an actual error 0.0026.From 3.5

    E(x) (0.4)(0.6)(1.6)

    6

    1

    4ln10= 0.0070 (2.8)

    which is a valid bound.

    Example 2:Find an interpolation formula for f(x) = tan(x) given this setof known values:x0 = 1.5 f(x0) = 14.1014x1 = 0.75 f(x1) = 0.931596x2 = 0 f(x2) = 0x3 = 0.75 f(x3) = 0.931596x4 = 1.5 f(x4) = 14.1014Solution:The basis polynomials are:

    0(x) =x x1

    x0 x1

    x x2x0 x2

    x x3

    x0 x3

    x x4x0 x4

    =1

    243x(2x 3)(4x + 3)(4x 3)

    (2.9)

    7

  • 7/30/2019 FEM SUM NO

    9/22

    1(x) =

    x x0x1 x0

    x x2x1 x2

    x x3x1 x3

    x x4x1 x4 =

    8

    243 x(2x3)(2x +3)(4x3)(2.10)

    2(x) =x x0

    x2 x0

    x x1x2 x3

    x x3

    x2 x3

    x x4x2 x4

    =3

    243(4x+3)(2x3)(2x+3)(4x3)

    (2.11)

    3(x) =x x0

    x3 x0

    x x1x3 x1

    x x2

    x3 x2

    x x4x3 x4

    = 8

    243x(2x3)(2x +3)(4x + 3)

    (2.12)

    4(x) =x x0

    x4 x0

    x x1x4 x1

    x x2

    x4 x2

    x x3x4 x3

    =1

    243x(4x 3)(2x + 3)(4x + 3)

    (2.13)

    Thus the interpolating polynomial then is

    L(x) =1

    243

    f(x0)x(2x 3)(4x + 3)(4x 3)

    8f(x1)x(2x 3)(2x + 3)(4x 3)

    +3f(x2)(4x + 3)(2x 3)(2x + 3)(4x 3)

    8f(x3)x(2x 3)(2x + 3)(4x + 3)

    +f(x4)x(4x 3)(2x + 3)(4x + 3)

    = 4.834848x3 1.477474x

    (2.14)

    8

  • 7/30/2019 FEM SUM NO

    10/22

    Chapter 3

    Hermite Interpolation

    Hermite interpolation is a method closely related to the Newton divided differ-ence method of interpolation in numerical analysis, that allows us to considergiven derivatives at data points, as well as the data points themselves. Theinterpolation will give a polynomial that has a degree less than or equal to thenumber of both data points and their derivatives, 1.

    Hermite Interpolation can be formulated by

    y(x) =

    mk=1

    hk(x)f(xk) +

    mk=1

    hk(x)f(xk) + E(x) (3.1)

    is now sought, with hk(x) and hk(x) being polynomials of degree 2m 1 toyield sufficient degrees of freedom to satisfy the fitting of f and f. The fourconditions needed to be satisfied by hk and hk are

    y(xj) = f(xj)

    which leads to

    9

  • 7/30/2019 FEM SUM NO

    11/22

    hi(xj) = ijhi(xj) = 0 (3.2)

    and

    y(xj) = f(xj)

    to give

    hi(xj) = 0hi(xj) = ij (3.3)

    where ij has the usual value of 0 if i = j and the value of 1 if i = j.It is clear that [(li(x))

    2] is a polynomial of degree 2m 2 which comes close tosatisfying some of the conditions in 3.2 and 3.3. By trying

    hi(

    x) =

    ri(

    x)(

    li(

    x))

    2

    (3.4)

    and

    hi(x) = si(x)(li(x))2 (3.5)

    with ri and si being linear functions of x, the required degree of polynomialis attained and four degrees of freedom remained to complete the satisfactionof 3.2 and 3.3. Indeed this conditions result in the relations

    ri(xi) = 1 ri(xi) + 2l

    i(xi) = 0 (3.6)

    10

  • 7/30/2019 FEM SUM NO

    12/22

    si(xi) = 0 si(xi) = 1 (3.7)

    The linear forms which satisfy these conditions are

    ri(x) = 1 2li(xi)(x xi) (3.8)

    si(x) = x xi (3.9)

    which gives Hermites interpolation formula as

    y(x) =

    mk=1

    hk(x)f(xk) +

    mk=1

    hk(x)f(xk) + E(x) (3.10)

    with

    hi(x) = [1 2li(xi)(x xi)][li(x)]

    2 (3.11)

    and

    hi(x) = (x xi)[li(x)]2 (3.12)

    and as in the formula Lagrange the problem of determining E(x) remains.A similar approach to the Lagrange case yields a suitable error form. Nowit is recognized that both E(x) and

    2(x) vanish together with their firstderivatives at each of the m-points x1, x2, . . . , xm. Hence consider the function

    F(x) = f(x) y(x) K[

    (x)]2 (3.13)

    Then F(x) vanishes with its first derivatives at the same m-points. But2

    (x)only vanishes at these m-points; which implies that K can be chosen the force

    11

  • 7/30/2019 FEM SUM NO

    13/22

    F(x) to vanish at the further point, say x. If I is the smallest closed intervalcontaining all the points x1, . . . , xm, x then F(x) vanishes at m+1-points in I.

    Likewise F

    (x) vanishes at m different point in I, each intermediate with theoriginal m +1-points. But F(x) also vanishes at the m-points x1, . . . , xm andhence in total F(x) vanishes 2m times in I. By the Rolle theorem argumentF(x) vanishes 2m 1 times in I, and continuing, F(2m)(x) vanishes once inI, say at x = . Hence there is no sufficient information to fix K in terms ofthe indeterminate value to give

    0 = F(2m)() = f(2m)() K(2m)! (3.14)

    remembering that y(x) is a polynomial of degree 2m 1 which differentiates

    2m times to gives zero. Hence the Hermites interpolation Error formula is

    E(x) =f(2m)()

    (2m)![

    (x)]2 (3.15)

    Theorem

    There exists a unique polynomial p in

    m fulfilling the Hermite Interpola-tions conditions in p(j)(xi) = 0 (0 j ki 1, 0 i n) .

    Proof

    The polynomial p is sought in the space

    m and it therefore has m + 1coefficients.The number of interpolatory conditions that are imposed on p by

    p(j)(xi) = 0 (0 j ki 1, 0 i n) is also m + 1.Thus we have asquare system ofm+1 equations in m+1 unknowns to solve, and we wish to beassured that the coefficient matrix is nonsingular.To prove that a square matrixA is not singular, it suffices to prove that homogeneous equations Au = 0 hasonly zero solutions (u = 0).n the interpolation problem under discussion, thehomogeneous problem is to find p

    m such that

    12

  • 7/30/2019 FEM SUM NO

    14/22

    p(j)(xi) = 0 (0 j ki 1, 0 i n)

    such a polynomial has a zero of multiplicity ki at xi (0 i n) and musttherefore be a multiple of the polynomial q given by

    q(x) =n

    i=0

    (x xi)ki

    observe,however,that q is of degree

    m + 1 =ni=0

    ki

    whereas p is to be of degree at most m.We therefore conclude that p = q = 0.Example 1: Find the polynomial p that assumes these values: P(0) = 0,

    P(1) = 1, p(1

    2) = 2.

    Solution: Since there are 3 conditions we try a quadratic:

    p(x) = a + bx + cx2

    The condition p(0) = 0 leads to a = 0

    1 = p(1) = b + c

    13

  • 7/30/2019 FEM SUM NO

    15/22

    2 = p(1

    2 ) = b + c

    Thus there is no quadratic solution. Now assume

    p(x) = a + bx + cx2 + dx3

    we discover that there exists a solution but it is not unique.We notice thata=0 as before.The remaining conditions are

    1 = b + c + d

    2 = b + c +3

    4d

    The solution of this system is d = 4 and b + c = 5.

    Example 2: Assume f(x) = log(x). And f(2) = 0, 3010 f(2) = 0.217147;f(3) = 0, 4771 f(3) = 0.144765; f(4) = 0, 6021 f(4) = 0.108574. Evaluatethe Lagrange interpolation of f(2.4)?

    Solution: By using (2.4)

    i(x) =

    1kQ; k=1(x xk)1kQ; k=1(xi xk)

    =(x x1) . . . (x xi1)(x xi+1) . . . (x xQ)

    (xi x1) . . . (xi xi1)(xi xi+1) . . . (xi xQ)

    (3.16)

    gives

    1(2) =

    3

    2

    14

  • 7/30/2019 FEM SUM NO

    16/22

    2(3) = 0

    3(4) =3

    2

    and then using formula 3.11 and 3.12 give

    h1(x) = (3x 5)21(x)

    h2(x) = 22(x)

    h3(x) = (13 3x)23(x)

    h1(x) = (x 2)21(x)

    h2(x) = (x 3)22(x)

    h3(x) = (x 4)23(x)

    Hence the interpolated value at x = 2.4 is given by

    y(2.4) = 0.50688 0.301030 + 0.4096 0.477121

    +0.08352 0.602060 + 0.09216 0.217147

    0.24576 0.144765 0.02304 0.108574

    = 0.380232

    (3.17)

    15

  • 7/30/2019 FEM SUM NO

    17/22

    and the associated actual error is 0.0000209. On the other hand 3.15

    E(x) = (x x1)2(x x2)2(x x3)2f(6)()

    6!

    = (0.4)2(0.6)2(1.6)20.814

    6!

    = 0.0001667

    (3.18)

    which yields a sensible upper bound.

    Hermite Interpolation is more accurate interpolator than Lagrange Interpo-

    lation.But Hermite Interpolation needs more data that the derivative of thespecific points which are given in the problem.In error analysis Hermite In-terpolation is ore sensible according to Lagrange Interpolation via error upperbound.Lagrange Interpolation can be applied to the Hermite Interpolationproblems but Hermite Interpolation can not be applied to Lagrange Interpo-lation problem because in the derivative values of specific points are not givenin the Lagrange Interpolation problem.

    16

  • 7/30/2019 FEM SUM NO

    18/22

    Chapter 4

    Applications

    I will solve a problem by using Hermite and Lagrange Interpolation methods,toshow that which is closed to exact value or sensible at error analysis.

    Example : Assume f(x) = log(x). And f(2) = 0, 3010 f(2) = 0.217147;f(3) = 0, 4771 f(3) = 0.144765; f(4) = 0, 6021 f(4) = 0.108574. Evaluatethe interpolations of f(2.4)?

    by using Lagrange Interpolations: Lagrange interpolation

    L(2.4) =(0.6)(1.6)

    (1)(2)f(2) +

    (0.4)(1.6)

    (1)(1)f(3) +

    (0.4)(0.6)

    (2)(1)f(4)

    = 0.48 0.3010 + 0.64 0.4771 0.12 0.6021

    = 0.3776

    (4.1)

    With an actual error

    E(x) = f(x) L(x) = f(2.4) L(2.4) = 0.0026

    17

  • 7/30/2019 FEM SUM NO

    19/22

    . But Lagrange Interpolations Error formula gives us:

    E(x) (0.4)(0.6)(1.6)

    6

    1

    4ln10= 0.0070 (4.2)

    by using Hermite Interpolations:

    i(x) =

    1kQ; k=1(x xk)1kQ; k=1(xi xk)

    =

    (x x1) . . . (x xi1)(x xi+1) . . . (x xQ)

    (xi x1) . . . (xi xi1)(xi xi+1) . . . (xi xQ)

    (4.3)

    gives

    1(2) = 3

    2

    2(3) = 0

    3(4) =3

    2

    h1(x) = (3x 5)21(x)

    h2(x) = 22(x)

    h3(x) = (13 3x)23(x)

    h1(x) = (x 2)21(x)

    h2(x) = (x 3)22(x)

    18

  • 7/30/2019 FEM SUM NO

    20/22

    h3(x) = (x 4)23(x)

    Hence the interpolated value at x = 2.4 is given by

    y(2.4) = 0.50688 0.301030 + 0.4096 0.477121

    +0.08352 0.602060 + 0.09216 0.217147

    0.24576 0.144765 0.02304 0.108574

    = 0.380232

    (4.4)

    and the associated actual error is

    E(x) = f(x) Y(x) = f(2.4) Y(2.4) = 0.0000209

    . On the other hand, Hermite Interpolations Error formula gives us:

    E(x) = (x x1)2(x x2)

    2(x x3)2 f

    (6)()

    6!

    = (0.4)2(0.6)2(1.6)20.814

    6!

    = 0.0001667

    (4.5)

    As I said Hermite Interpolation is more better than Lagrange Interpolationto give more sensible result.Because it is more sensible in Error Analysis.

    19

  • 7/30/2019 FEM SUM NO

    21/22

    Chapter 5

    Conclusion

    In this project,I presented basic notions of Hermite Interpolations,LagrangeInterpolations and their error analysis with their approximation. Then, I tryto apply these Interpolations on some concrete examples.I also applied bothInterpolations on same examples to show that error sensibility.

    20

  • 7/30/2019 FEM SUM NO

    22/22

    Bibliography

    [1] http://209.85.129.132/search?q=cache:Bo293tM51bkJ:efe.ege.edu.tr/ balli/uygulama/17.pdf+hermite+interpolation+polynomial&cd=10&hl

    =tr&ct=clnk&gl=tr

    [2] http://en.wikipedia.org/wiki/Hermite interpolation

    [3] http://mathworld.wolfram.com/HermitesInterpolatingPolynomial.html

    [4] Szeg, G. Orthogonal Polynomials, 4th ed. Providence, RI: Amer. Math.Soc., pp. 330-332, 1975.

    [5] Hildebrand, F. B. Introduction to Numerical Analysis. New York:McGraw-Hill, pp. 314-319, 1956.

    [6] Burden, Richard L., and J. Douglas Faires. Numerical Analysis. Belmont:Brooks/Cole, 2004.

    [7] Evans Gwynne, Practical Numerical Analysis, Wiley , 1995

    [8] Stoer , Introduction to Numerical Analysis, Springer, 2002

    21