interpolare lagrange

Upload: dragosbogdan1974

Post on 14-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 interpolare lagrange

    1/9

    05.04.1

    Chapter 05.04Lagrangian Interpolation More ExamplesCivil Engineering

    Example 1

    To maximize a catch of bass in a lake, it is suggested to throw the line to the depth of the

    thermocline. The characteristic feature of this area is the sudden change in temperature. We

    are given the temperature vs. depth data for a lake in Table 1.

    Table 1 Temperature vs. depth for a lake.

    Temperature, C T Depth, mz

    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

  • 7/29/2019 interpolare lagrange

    2/9

    05.04.2 Chapter 05.0

    Figure 1 Temperature vs. depth of a lake.

    Using the given data, we see the largest change in temperature is between m8z and

    m7z . Determine the value of the temperature at m5.7z using a first order

    Lagrange polynomial.

    SolutionFor first order Lagrange polynomial interpolation (also called linear interpolation), the

    temperature is given by

    1

    0

    )()()(i

    ii zTzLzT

    )()()()( 1100 zTzLzTzL

  • 7/29/2019 interpolare lagrange

    3/9

    Lagrange Method of Interpolation-More Examples: Civil Engineering 05.04.3

    Figure 2 Linear interpolation.

    Since we want to find the temperature at m5.7z , we need to choose the two data points

    that are closest to m5.7z that also bracket m5.7z to evaluate it. The two points are

    80 z and 71 z .

    Then

    7.11,8 00 zTz 6.17,7 11 zTz

    gives

    1

    00 0

    0 )(

    jj j

    j

    zzzzzL

    10

    1

    zz

    zz

    1

    10 1

    1 )(

    jj j

    j

    zz

    zzzL

    01

    0

    zz

    zz

    Hence

    )()()( 101

    0

    0

    10

    1 zTzz

    zzzT

    zz

    zzzT

    78),6.17(87

    8)7.11(

    78

    7

    z

    zz

    )6.17(87

    85.7)7.11(

    78

    75.7)5.7(

    T

    (x0,y0)

    (x1,y1)

    1(x)

  • 7/29/2019 interpolare lagrange

    4/9

    05.04.4 Chapter 05.0

    )6.17(5.0)7.11(5.0

    C65.14

    You can see that 5.0)(0 zL and 5.0)(1 zL are like weightages given to the temperatures

    at m8z and m7z to calculate the temperature at m5.7z .

    Example 2

    To maximize a catch of bass in a lake, it is suggested to throw the line to the depth of the

    thermocline. The characteristic feature of this area is the sudden change in temperature. We

    are given the temperature vs. depth data for a lake in Table 2.

    Table 2 Temperature vs. depth for a lake.

    Temperature, C T Depth, mz

    19.1 0

    19.1 1

    19 218.8 3

    18.7 4

    18.3 5

    18.2 6

    17.6 7

    11.7 8

    9.9 9

    9.1 10

    Using the given data, we see the largest change in temperature is between m8z and

    m7z . Determine the value of the temperature at m5.7z using a second order

    Lagrange polynomial. Find the absolute relative approximate error for the second order

    polynomial approximation.

    Solution

    For second order Lagrange polynomial interpolation (also called quadratic interpolation), the

    temperature is given by

    2

    0

    )()()(i

    ii zTzLzT

    )()()()()()( 221100 zTzLzTzLzTzL

  • 7/29/2019 interpolare lagrange

    5/9

    Lagrange Method of Interpolation-More Examples: Civil Engineering 05.04.5

    Figure 3 Quadratic interpolation.

    Since we want to find the temperature at ,5.7z we need to choose the three data points

    that are closest to 5.7z that also bracket 5.7z to evaluate it. These three points are,90 z 81 z and 72 z . (Choosing the three points as 80 z , 71 z and 62 z

    is equally valid.)

    Then

    9.9,9 00 zTz 7.11,8 11 zTz

    6.17,7 22

    zTz gives

    2

    00 0

    0 )(

    jj j

    j

    zz

    zzzL

    20

    2

    10

    1

    zz

    zz

    zz

    zz

    2

    10 1

    1 )(

    jj j

    j

    zz

    zzzL

    21

    2

    01

    0

    zzzz

    zzzz

    2

    20 2

    2 )(

    jj j

    j

    zz

    zzzL

    (x0,y0)

    (x1,y1) (x2,y2)

    2(x)

  • 7/29/2019 interpolare lagrange

    6/9

    05.04.6 Chapter 05.0

    12

    1

    02

    0

    zz

    zz

    zz

    zz

    Hence

    20

    2

    12

    1

    02

    01

    21

    2

    01

    00

    20

    2

    10

    1 ),()()()(

    zzz

    zT

    zz

    zz

    zz

    zzzT

    zz

    zz

    zz

    zzzT

    zz

    zz

    zz

    zzzT

    )6.17()87)(97(

    )85.7)(95.7(

    )7.11()78)(98(

    )75.7)(95.7()9.9(

    )79)(89(

    )75.7)(85.7()5.7(

    T

    )6.17)(375.0()7.11)(75.0()9.9)(125.0(

    C138.14

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

    second order polynomial is

    100138.14

    65.14138.14

    a

    %6251.3

    Example 3

    To maximize a catch of bass in a lake, it is suggested to throw the line to the depth of the

    thermocline. The characteristic feature of this area is the sudden change in temperature. Weare given the temperature vs. depth data for a lake in Table 3.

    Table 3 Temperature vs. depth for a lake.

    Temperature, C T Depth, mz

    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

    Using the given data, we see the largest change in temperature is between m8z and

    m7z .

  • 7/29/2019 interpolare lagrange

    7/9

    Lagrange Method of Interpolation-More Examples: Civil Engineering 05.04.7

    a) Determine the value of the temperature at m5.7z using a third order Lagrangepolynomial. Find the absolute relative approximate error for the third order

    polynomial approximation.

    b) The position where the thermocline exists is given where 02

    2

    dz

    Td. Using the

    expression from part (a), what is the value of the depth at which the thermoclineexists?

    Solution

    a) For third order Lagrange polynomial interpolation (also called cubic interpolation), we

    choose the temperature given by

    3

    0

    )()()(i

    ii zTzLzT

    )()()()()()()()( 33221100 zTzLzTzLzTzLzTzL

    Figure 4 Cubic interpolation.

    Since we want to find the temperature at ,5.7z we need to choose the four data points

    that are closest to 5.7z that also bracket 5.7z to evaluate it. The four data points are

    ,90 z ,81 z 72 z and 63 z .Then

    9.9,9 00 zTz 7.11,8 11 zTz 6.17,7 22 zTz 2.18,6 33 zTz

    y

    x

    3(x)

    (x0,y0)

    (x1,y1)

    (x2,y2)

    (x3,y3)

  • 7/29/2019 interpolare lagrange

    8/9

    05.04.8 Chapter 05.0

    gives

    3

    00 0

    0 )(

    jj j

    j

    zz

    zzzL

    30

    3

    20

    2

    10

    1

    zz

    zz

    zz

    zz

    zz

    zz

    3

    10 1

    1 )(

    jj j

    j

    zz

    zzzL

    31

    3

    21

    2

    01

    0

    zz

    zz

    zz

    zz

    zz

    zz

    3

    20 2

    2 )(

    jj j

    j

    zz

    zzzL

    32

    3

    12

    1

    02

    0

    zzzz

    zzzz

    zzzz

    3

    30 3

    3 )(

    jj j

    j

    zz

    zzzL

    23

    2

    13

    1

    03

    0

    zz

    zz

    zz

    zz

    zz

    zz

    Hence

    )()(

    )()()(

    3

    23

    2

    13

    1

    03

    0

    2

    32

    3

    12

    1

    02

    0

    1

    31

    3

    21

    2

    01

    0

    0

    30

    3

    20

    2

    10

    1

    zTzz

    zz

    zz

    zz

    zz

    zzzT

    zz

    zz

    zz

    zz

    zz

    zz

    zT

    zz

    zz

    zz

    zz

    zz

    zzzT

    zz

    zz

    zz

    zz

    zz

    zzzT

    30 zzz

    )2.18()76)(86)(96(

    )75.7)(85.7)(95.7()6.17(

    )67)(87)(97(

    )65.7)(85.7)(95.7(

    )7.11()68)(78)(98(

    )65.7)(75.7)(95.7()9.9(

    )69)(79)(89(

    )65.7)(75.7)(85.7()5.7(

    T

    )2.18)(0625.0()6.17)(5625.0()7.11)(5625.0()9.9)(0625.0(

    C725.14 The absolute relative approximate error a obtained between the results from the second

    and third order polynomial is

    100725.14

    138.14725.14

    a

    %9898.3

  • 7/29/2019 interpolare lagrange

    9/9

    Lagrange Method of Interpolation-More Examples: Civil Engineering 05.04.9

    b) To find the position of the thermocline, we must find the points of inflection of the third

    order polynomial, given by .02

    2

    dz

    Td

    )2.18()76)(86)(96(

    )7)(8)(9()6.17(

    )67)(87)(97(

    )6)(8)(9(

    )7.11()68)(78)(98(

    )6)(7)(9()9.9(

    )69)(79)(89(

    )6)(7)(8()(

    zzzzzz

    zzzzzzzT

    69 z 69,5667.155.3558.2629.615 32 zzzz

    69,7.41.7158.262 2 zzzdz

    dT

    69,4.91.712

    2

    zzdz

    Td

    Simply setting this expression equal to zero, we get

    69,4.91.710 zz m5638.7z

    This answer can be verified due to the fact that it falls within the specified range of the third

    order polynomial and it also falls within the region of the greatest temperature change in the

    collected data from the lake.