Sunteți pe pagina 1din 9

05.04.

1





Chapter 05.04
Lagrangian Interpolation More Examples
Civil 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, ( ) m z
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



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 m 8 = z and
m 7 = z . Determine the value of the temperature at m 5 . 7 = z using a first order
Lagrange polynomial.

Solution
For first order Lagrange polynomial interpolation (also called linear interpolation), the
temperature is given by

=
=
1
0
) ( ) ( ) (
i
i i
z T z L z T
) ( ) ( ) ( ) (
1 1 0 0
z T z L z T z L + =

Lagrange Method of Interpolation-More Examples: Civil Engineering 05.04.3

Figure 2 Linear interpolation.

Since we want to find the temperature at m 5 . 7 = z , we need to choose the two data points
that are closest to m 5 . 7 = z that also bracket m 5 . 7 = z to evaluate it. The two points are
8
0
= z and 7
1
= z .
Then
( ) 7 . 11 , 8
0 0
= = z T z
( ) 6 . 17 , 7
1 1
= = z T z
gives

[
=
=

=
1
0
0 0
0
) (
j
j j
j
z z
z z
z L

1 0
1
z z
z z

=

[
=
=

=
1
1
0 1
1
) (
j
j j
j
z z
z z
z L

0 1
0
z z
z z

=
Hence
) ( ) ( ) (
1
0 1
0
0
1 0
1
z T
z z
z z
z T
z z
z z
z T

=
7 8 ), 6 . 17 (
8 7
8
) 7 . 11 (
7 8
7
s s
+
+
+
+
+
= z
z z

) 6 . 17 (
8 7
8 5 . 7
) 7 . 11 (
7 8
7 5 . 7
) 5 . 7 (
+
+
+
+
+
= T
(x
0
, y
0
)
(x
1
, y
1
)
f
1
(x)
x
y
05.04.4 Chapter 05.0

) 6 . 17 ( 5 . 0 ) 7 . 11 ( 5 . 0 + =
C 65 . 14 =
You can see that 5 . 0 ) (
0
= z L and 5 . 0 ) (
1
= z L are like weightages given to the temperatures
at m 8 = z and m 7 = z to calculate the temperature at m 5 . 7 = z .

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, ( ) m z
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 m 8 = z and
m 7 = z . Determine the value of the temperature at m 5 . 7 = z 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
i i
z T z L z T
) ( ) ( ) ( ) ( ) ( ) (
2 2 1 1 0 0
z T z L z T z L z T z L + + =

Lagrange Method of Interpolation-More Examples: Civil Engineering 05.04.5


Figure 3 Quadratic interpolation.

Since we want to find the temperature at , 5 . 7 = z we need to choose the three data points
that are closest to 5 . 7 = z that also bracket 5 . 7 = z to evaluate it. These three points are
, 9
0
= z 8
1
= z and 7
2
= z . (Choosing the three points as 8
0
= z , 7
1
= z and 6
2
= z
is equally valid.)
Then
( ) 9 . 9 , 9
0 0
= = z T z
( ) 7 . 11 , 8
1 1
= = z T z
( ) 6 . 17 , 7
2 2
= = z T z
gives
[
=
=

=
2
0
0 0
0
) (
j
j j
j
z z
z z
z L

|
|
.
|

\
|

|
|
.
|

\
|

=
2 0
2
1 0
1
z z
z z
z z
z z

[
=
=

=
2
1
0 1
1
) (
j
j j
j
z z
z z
z L

|
|
.
|

\
|

|
|
.
|

\
|

=
2 1
2
0 1
0
z z
z z
z z
z z

[
=
=

=
2
2
0 2
2
) (
j
j j
j
z z
z z
z L

(x
0
, y
0
)
(x
1
, y
1
) (x
2
, y
2
)
f
2
(x)
x
y
05.04.6 Chapter 05.0


|
|
.
|

\
|

|
|
.
|

\
|

=
1 2
1
0 2
0
z z
z z
z z
z z

Hence
2 0
2
1 2
1
0 2
0
1
2 1
2
0 1
0
0
2 0
2
1 0
1
), ( ) ( ) ( ) (
z z z
z T
z z
z z
z z
z z
z T
z z
z z
z z
z z
z T
z z
z z
z z
z z
z T
s s
|
|
.
|

\
|

|
|
.
|

\
|

+
|
|
.
|

\
|

|
|
.
|

\
|

+
|
|
.
|

\
|

|
|
.
|

\
|

=


) 6 . 17 (
) 8 7 )( 9 7 (
) 8 5 . 7 )( 9 5 . 7 (
) 7 . 11 (
) 7 8 )( 9 8 (
) 7 5 . 7 )( 9 5 . 7 (
) 9 . 9 (
) 7 9 )( 8 9 (
) 7 5 . 7 )( 8 5 . 7 (
) 5 . 7 (
+ +
+ +
+
+ +
+ +
+
+ +
+ +
= T

) 6 . 17 )( 375 . 0 ( ) 7 . 11 )( 75 . 0 ( ) 9 . 9 )( 125 . 0 ( + + =
C 138 . 14 =
The absolute relative approximate error
a
e obtained between the results from the first and
second order polynomial is
100
138 . 14
65 . 14 138 . 14

= e
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. We
are given the temperature vs. depth data for a lake in Table 3.

Table 3 Temperature vs. depth for a lake.
Temperature, ( ) C T Depth, ( ) m z
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 m 8 = z and
m 7 = z .
Lagrange Method of Interpolation-More Examples: Civil Engineering 05.04.7

a) Determine the value of the temperature at m 5 . 7 = z using a third order Lagrange
polynomial. Find the absolute relative approximate error for the third order
polynomial approximation.
b) The position where the thermocline exists is given where 0
2
2
=
dz
T d
. Using the
expression from part (a), what is the value of the depth at which the thermocline
exists?

Solution
a) For third order Lagrange polynomial interpolation (also called cubic interpolation), we
choose the temperature given by

=
=
3
0
) ( ) ( ) (
i
i i
z T z L z T
) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (
3 3 2 2 1 1 0 0
z T z L z T z L z T z L z T z L + + + =
Figure 4 Cubic interpolation.

Since we want to find the temperature at , 5 . 7 = z we need to choose the four data points
that are closest to 5 . 7 = z that also bracket 5 . 7 = z to evaluate it. The four data points are
, 9
0
= z , 8
1
= z 7
2
= z and 6
3
= z .
Then
( ) 9 . 9 , 9
0 0
= = z T z
( ) 7 . 11 , 8
1 1
= = z T z
( ) 6 . 17 , 7
2 2
= = z T z
( ) 2 . 18 , 6
3 3
= = z T z
y
x
f
3
(x)
(x
0
, y
0
)
(x
1
, y
1
)
(x
2
, y
2
)
(x
3
, y
3
)
05.04.8 Chapter 05.0

gives
[
=
=

=
3
0
0 0
0
) (
j
j j
j
z z
z z
z L


|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|

=
3 0
3
2 0
2
1 0
1
z z
z z
z z
z z
z z
z z

[
=
=

=
3
1
0 1
1
) (
j
j j
j
z z
z z
z L

|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|

=
3 1
3
2 1
2
0 1
0
z z
z z
z z
z z
z z
z z

[
=
=

=
3
2
0 2
2
) (
j
j j
j
z z
z z
z L

|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|

=
3 2
3
1 2
1
0 2
0
z z
z z
z z
z z
z z
z z

[
=
=

=
3
3
0 3
3
) (
j
j j
j
z z
z z
z L

|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|

=
2 3
2
1 3
1
0 3
0
z z
z z
z z
z z
z z
z z

Hence

) ( ) (
) ( ) ( ) (
3
2 3
2
1 3
1
0 3
0
2
3 2
3
1 2
1
0 2
0
1
3 1
3
2 1
2
0 1
0
0
3 0
3
2 0
2
1 0
1
z T
z z
z z
z z
z z
z z
z z
z T
z z
z z
z z
z z
z z
z z
z T
z z
z z
z z
z z
z z
z z
z T
z z
z z
z z
z z
z z
z z
z T
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|

+
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|

+
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|

+
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|

=


3 0
z z z s s
) 2 . 18 (
) 7 6 )( 8 6 )( 9 6 (
) 7 5 . 7 )( 8 5 . 7 )( 9 5 . 7 (
) 6 . 17 (
) 6 7 )( 8 7 )( 9 7 (
) 6 5 . 7 )( 8 5 . 7 )( 9 5 . 7 (
) 7 . 11 (
) 6 8 )( 7 8 )( 9 8 (
) 6 5 . 7 )( 7 5 . 7 )( 9 5 . 7 (
) 9 . 9 (
) 6 9 )( 7 9 )( 8 9 (
) 6 5 . 7 )( 7 5 . 7 )( 8 5 . 7 (
) 5 . 7 (
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
= T
) 2 . 18 )( 0625 . 0 ( ) 6 . 17 )( 5625 . 0 ( ) 7 . 11 )( 5625 . 0 ( ) 9 . 9 )( 0625 . 0 ( + + + =
C 725 . 14 =
The absolute relative approximate error
a
e obtained between the results from the second
and third order polynomial is
100
725 . 14
138 . 14 725 . 14

= e
a

% 9898 . 3 =

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 . 0
2
2
=
dz
T d

) 2 . 18 (
) 7 6 )( 8 6 )( 9 6 (
) 7 )( 8 )( 9 (
) 6 . 17 (
) 6 7 )( 8 7 )( 9 7 (
) 6 )( 8 )( 9 (
) 7 . 11 (
) 6 8 )( 7 8 )( 9 8 (
) 6 )( 7 )( 9 (
) 9 . 9 (
) 6 9 )( 7 9 )( 8 9 (
) 6 )( 7 )( 8 (
) (
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
=
z z z z z z
z z z z z z
z T


6 9 s s z


6 9 , 5667 . 1 55 . 35 58 . 262 9 . 615
3 2
s s = z z z z

6 9 , 7 . 4 1 . 71 58 . 262
2
s s = z z z
dz
dT

6 9 , 4 . 9 1 . 71
2
2
s s = z z
dz
T d

Simply setting this expression equal to zero, we get
6 9 , 4 . 9 1 . 71 0 s s = z z
m 5638 . 7 = z
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.

S-ar putea să vă placă și