Interpolation Lec

Embed Size (px)

Citation preview

  • 8/13/2019 Interpolation Lec

    1/24

  • 8/13/2019 Interpolation Lec

    2/24

    In the mathematical field of numerical

    analysis, interpolationis a method of

    constructing new data points within therange of a discrete set of known data

    points.

  • 8/13/2019 Interpolation Lec

    3/24

    Many a times, a function y = f(x) is given only at discretepoints such as (xo, yo),(x1, y1),,(xn-1,yn-1), (xn,yn).How does one find the value of y at any other value of x ?A continuous function f(x) may be used to represent the

    n+1 data values with f(x) passing through the n+1 points.Then one can find the value of y at any other value of x .This is called interpolation. Of course, if x falls outsidethe range of x for which the data is given, it is no longer

    interpolation but instead is called extrapolation.

  • 8/13/2019 Interpolation Lec

    4/24

    Y

    X(xo,yo)

    (x1,y1) (x2,y2)

    (x3,y3)fx

  • 8/13/2019 Interpolation Lec

    5/24

    Sir Edmund Whittaker, a professor of NumericalMathematics at the University of Edinburghfrom 1913 to 1923, observed the most common

    form of interpolation occurs when we seek datafrom a table which does not have the exactvalues we want.

    Throughout history, interpolation has beenused in one form or another for just about everypurpose under the sun.

  • 8/13/2019 Interpolation Lec

    6/24

    Speaking of the sun, some of the first surviving evidenceof the use of interpolation came from ancient Babylonand Greece.Around 300 BC, they were using not only linear, but also

    more complex forms of interpolation to predict thepositions of the sun, moon, and the planets they knew of.Farmers, timing the planting of their crops, were theprimary users of these predictions.

    Also in Greece sometime around 150 BC, Hipparchus ofRhodes used linear interpolation to construct a chordfunction, which is similar to a sinusoidal function, tocompute positions of celestial bodies.

  • 8/13/2019 Interpolation Lec

    7/24

    Farther east, Chinese evidence of interpolationdates back to around 600 AD.Liu Zhuo used the equivalent of second order

    Gregory-Newton interpolation to construct anImperial Standard Calendar.In 625 AD, Indian astronomer and

    mathematician Brahmagupta introduced amethod for second order interpolation of thesine function and, later on, a method for

    interpolation of unequal-interval data.

  • 8/13/2019 Interpolation Lec

    8/24

    Direct Method of

    Interpolation

  • 8/13/2019 Interpolation Lec

    9/24

    To maximize a catch of bass in a lake, it issuggested to throw the line to the depth of thethermocline. The characteristic feature of this

    area is the sudden change in temperature. Weare given the temperature vs. depth data for alake in Table 1.

  • 8/13/2019 Interpolation Lec

    10/24

    Temperature, T (C) Depth, Z (m)

    19.1 0

    19.1 -1

    19 -2

    18.8 -3

    18.7 -4

    18.3 -5

    18.2 -6

    17.6 -7

    11.7 -8

    9.9 -9

    9.1 -10

  • 8/13/2019 Interpolation Lec

    11/24

    Using the given data, we see the largest

    change in temperature is between z = -8 m

    and z = -7 m. Determine the value of thetemperature atz = -7.5 m using the direct

    method of interpolation and a first order

    polynomial.

  • 8/13/2019 Interpolation Lec

    12/24

    For first order polynomial interpolation (alsocalled linear interpolation), we choose thetemperature given by

    T(z) = ao+ a1zzo= -8 , T(zo) = 11.7

    z1= -7, T(z1) = 17.6

    givesT(-8) = ao+ a1(-8) = 11.7T(-7) = ao+ a1(-7) = 17.6

  • 8/13/2019 Interpolation Lec

    13/24

    Writing the equations in matrix form, we have

    1 - 8 ao 11.7

    1 -7 a1 17.6

    Solving the above two equations givesao = 58.9 and a1 = 5.9

    =

  • 8/13/2019 Interpolation Lec

    14/24

    Hence,

    T(z) = ao+ a1zT(z) = 58.9 + 5.9 zT(-7.5) = 58.9 + 5.9(-7.5)T(-7.5) = 14.65C

  • 8/13/2019 Interpolation Lec

    15/24

    For second order polynomial interpolation

    (also called quadratic interpolation), we

    choose the temperature given by

    T(z) = ao+ a1z + a2z

  • 8/13/2019 Interpolation Lec

    16/24

    zo= -9 , T(zo) = 9.9z1= -8, T(z1) = 11.7

    z2= -7, T(z2) = 17.6givesT(-9) = ao+ a1(-9) + a2(-9)= 9.9T(-8) = ao+ a1(-8) + a2(-8)= 11.7T(-7) = ao+ a1(-7) + a2(-7)= 17.6

  • 8/13/2019 Interpolation Lec

    17/24

    Writing the equations in matrix form, we have1 -9 81 ao 9.91 - 8 64 a1 11.71 -7 49 a2 17.6

    Solving the above three equations gives

    ao = 173.7, a1= 36.65, and a2= 2.05.

    =

  • 8/13/2019 Interpolation Lec

    18/24

    Hence,

    T(z) = ao+ a1z + a2z

    T(z) = 173.7 + 36.65 z + 2.05 z

    at z = -7.5

    T(-7.5) = 173.7 + 36.65(-7.5) + 2.05(-7.5)= 14.138C

  • 8/13/2019 Interpolation Lec

    19/24

    The absolute relative approximate error | a |obtained between the results from the first

    and second order polynomial is

    | a | = 14.138 14.65 x 100%14.138

    = 3.6251%

  • 8/13/2019 Interpolation Lec

    20/24

    For third order polynomial interpolation

    (also called cubic interpolation), we

    choose the temperature given by

    T(z) = ao+ a1z + a2z + a3z

  • 8/13/2019 Interpolation Lec

    21/24

    zo= -9 , T(zo) = 9.9z1= -8, T(z1) = 11.7z2= -7, T(z2) = 17.6

    z3= -6, T(z3) = 18.2givesT(-9) = ao+ a1(-9) + a2(-9) + a3(-9)= 9.9

    T(-8) = ao+ a1(-8) + a2(-8) + a3(-8) = 11.7T(-7) = ao+ a1(-7) + a2(-7) + a3(-7)= 17.6T(-6) = ao+ a1(-6) + a2(-6) + a3(-6)= 18.2

  • 8/13/2019 Interpolation Lec

    22/24

    Writing the equations in matrix form, we have1 -9 81 ao 9.91 - 8 64 a1 11.7

    1 -7 49 a2 17.61 -6 36 a3 18.2

    Solving the above three equations givesao = -615.9, a1= -262.58, a2= -35.55 anda3= -1.5667

    =

  • 8/13/2019 Interpolation Lec

    23/24

    Hence,

    T(z) = ao+ a1z + a2z + a3z

    T(z) = -615.9

    262.58 z

    35.55 z -1.5667 z

    at z = -7.5

    T(-7.5) = -615.9 -262.58(-7.5)

    35.55(-7.5)-1.5667(-7.5)

    = 14.725C

  • 8/13/2019 Interpolation Lec

    24/24

    The absolute relative approximate error | a |obtained between the results from the 2ndand 3rd order polynomial is

    | a | = 14.725 14.138 x 100%14.725

    = 3.9898%