# Spline Method of Interpolation-More Examples Civil Engineering by axj70834

VIEWS: 29 PAGES: 7

• pg 1
```									Chapter 05.05
Spline Method of 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, 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

05.05.1
05.05.2                                                                        Chapter 05.05

Figure 1 Temperature vs. depth of a lake.

Using the given data, we see the largest change in temperature is between z  8 m and
z  7 m . Determine the value of the temperature at z  7.5 m using linear splines.

Solution
Since we want to find the temperature at z  7.5 and we are using linear splines, we need to
choose the two data points that are closest to z  7.5 that also bracket z  7.5 to evaluate
it. The two points are z 0  8 and z1  7 .
Then
z 0  8, T ( z 0 )  11 .7
z1  7, T ( z1 )  17 .6
gives
T ( z1 )  T ( z 0 )
T ( z)  T ( z0 )                       ( z  z0 )
z1  z 0
17.6  11.7
 11.7                   ( z  8)
78
Hence
T ( z)  11.7  5.9( z  8),  8  z  7

At z  7.5,
T (7.5)  11.7  5.9(7.5  8)
 14.65 C
Spline Method of Interpolation-More Examples: Civil Engineering                          05.05.3

Linear spline interpolation is no different from linear polynomial interpolation. Linear splines
still use data only from the two consecutive data points. Also at the interior points of the data,
the slope changes abruptly. This means that the first derivative is not continuous at these
points. So how do we improve on this? We can do so by using quadratic splines.

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, 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

Using the given data, we see the largest change in temperature is between z  8 m and
z  7 m . Determine the value of the temperature at z  7.5 m using quadratic splines.
Find the absolute relative approximate error for the second order approximation.
Solution
Since there are eleven data points, ten quadratic splines pass through them.
T ( z )  a1 z 2  b1 z  c1 ,  10  z  9
 a 2 z  b2 z  c2 ,
2
 9  z  8
 a3 z  b3 z  c3 ,
2
 8  z  7
 a 4 z 2  b4 z  c4 ,             7  z  6
 a5 z  b5 z  c5 ,
2
 6  z  5
 a6 z 2  b6 z  c6 ,              5  z  4
 a 7 z  b7 z  c7 ,
2
 4  z  3
 a8 z  b8 z  c8 ,
2
 3  z  2
 a9 z  b9 z  c9 ,
2
 2  z  1
 a10 z 2  b10 z  c10 ,          1  z  0
05.05.4                                                                Chapter 05.05

The equations are found as follows.
1. Each quadratic spline passes through two consecutive data points.
a1 z 2  b1 z  c1 passes through z  10 and z  9 .
a1 (10 ) 2  b1 (10 )  c1  9.1                                    (1)
a1 (9) 2  b1 (9)  c1  9.9                                        (2)

a 2 z 2  b2 z  c 2 passes through z  9 and z  8 .
a 2 (9) 2  b2 (9)  c 2  9.9                                      (3)
a 2 (8)  b2 (8)  c 2  11 .7
2
(4)

a3 z 2  b3 z  c3 passes through z  8 and z  7 .
a3 (8) 2  b3 (8)  c3  11 .7                                      (5)
a3 (7) 2  b3 (7)  c3  17 .6                                      (6)

a 4 z 2  b4 z  c 4 passes through z  7 and z  6 .
a 4 (7) 2  b4 (7)  c 4  17 .6                                    (7)
a 4 (6)  b4 (6)  c 4  18 .2
2
(8)

a5 z 2  b5 z  c5 passes through z  6 and z  5 .
a5 (6) 2  b5 (6)  c5  18 .2                                      (9)
a5 (5)  b5 (5)  c5  18 .3
2
(10)

a6 z 2  b6 z  c6 passes through z  5 and z  4 .
a 6 (5) 2  b6 (5)  c6  18 .3                                     (11)
a 6 (4)  b6 (4)  c6  18 .7
2
(12)

a7 z 2  b7 z  c7 passes through z  4 and z  3 .
a 7 (4) 2  b7 (4)  c7  18 .7                                     (13)
a 7 (3) 2  b7 (3)  c 7  18 .8                                    (14)

a8 z 2  b8 z  c8 passes through z  3 and z  2 .
a8 (3) 2  b8 (3)  c8  18 .8                                      (15)
a8 (2)  b8 (2)  c8  19
2
(16)

a9 z 2  b9 z  c9 passes through z  2 and z  1 .
a9 (2) 2  b9 (2)  c9  19                                         (17)
a 9 (1)  b9 ( 1)  c9  19 .1
2
(18)
Spline Method of Interpolation-More Examples: Civil Engineering                 05.05.5

a10 z 2  b10 z  c10 passes through z  1 and z  0 .
a10 (1) 2  b10 (1)  c10  19 .1                                        (19)
a10 (0)  b10 (0)  c10  19 .1
2
(20)

2. Quadratic splines have continuous derivatives at the interior data points.
At z  9
2a1 (9)  b1  2a 2 (9)  b2  0                                          (21)
At z  8
2a 2 (8)  b2  2a3 (8)  b3  0                                          (22)
At z  7
2a3 (7)  b3  2a 4 (7)  b4  0                                          (23)
At z  6
2a 4 (6)  b4  2a5 (6)  b5  0                                          (24)
At z  5
2a5 (5)  b5  2a6 (5)  b6  0                                           (25)
At z  4
2a6 (4)  b6  2a7 (4)  b7  0                                           (26)
At z  3
2a7 (3)  b7  2a8 (3)  b8  0                                           (27)
At z  2
2a8 (2)  b8  2a9 (2)  b9  0                                           (28)
At z  1
2a9 (1)  b9  2a10 (1)  b10  0                                         (29)

3. Assuming the first spline a1 z 2  b1 z  c1 is linear,
a1  0                                                                      (30)
05.05.6                                                                                                                     Chapter 05.05

 100 10   1   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0 0     0 0  a1   9.1 
                                                                                                                                             
 81  9    1   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0 0     0 0  b1   9.9 
 0    0    0   81   9   1   0     0   0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0    c1   9.9 
                                                                                                                                             
 0    0    0   64   8   1   0     0   0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  a2  11.7 
 0    0    0   0    0    0   64   8   1   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0 2  b  11.7 
                                                                                                                                             
 0    0    0   0    0    0   49   7   1   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  c2  17.6
                                                                                                                                             
  0   0    0   0    0    0   0    0    0   49   7   1   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  a3  17.6
 0    0    0   0    0    0   0    0    0   36   6   1   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0    b3  18.2
                                                                                                                                             
 0    0    0   0    0    0   0    0    0   0    0    0   36   6   1   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  c3  18.2
 0    0    0   0    0    0   0    0    0   0    0    0   25   5   1   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0    a  18.3
                                                                                                                                   4         
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0 25  5 1      0    0    0   0   0    0   0   0    0   0 0 0  b4  18.3
                                                                                                                                             
  0   0    0   0    0    0   0    0    0   0    0    0   0    0    0 16  4 1      0    0    0   0   0    0   0   0    0   0 0 0  c4  18.7 
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   16   4   1   0   0    0   0   0    0   0 0 0  a5  18.7 
                                                                                                                                             
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0    9   3   1   0   0    0   0   0    0   0 0 0  b5  18.8
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0    0   0    0   9   3   1   0   0    0   0 0 0 5  c  18.8
                                                                                                                                            
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0    0   0    0   4   2   1   0   0    0   0 0 0  a6   19 
                                                                                                                                             
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   4   2   1   0 0 0  b6   19 
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   1   1   1   0 0 0  c6  19.1
                                                                                                                                             
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   1  1 1  a7  19.1
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 1  b7  19.1
                                                                                                                                             
 18 1     0 18  1      0  0   0      0  0   0      0    0   0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  c7   0 
                                                                                                                                             
 0    0    0  16 1      0 16  1      0  0   0      0    0   0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  a8   0 
 0    0    0  0   0      0  14 1      0 14  1      0    0   0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  b8   0 
                                                                                                                                             
 0    0    0  0   0      0  0   0      0  12 1      0   12   1   0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  c8   0 
 0    0    0   0    0    0   0    0    0   0    0    0  10   1    0 10    1 0    0    0 0      0   0    0   0   0    0   0 0 0  a9   0 
                                                                                                                                             
 0    0    0   0    0    0   0    0    0   0    0    0  0     0    0 8    1 0     8    1 0     0   0    0   0   0    0   0 0 0  b9   0 
                                                                                                                                             
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0 6     1    0   6   1 0     0   0    0   0 0 0  c9   0 
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0 4    1    0 4     1 0     0 0 0 a10   0 
                                                                                                                                             
 0    0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0 0     0    0 2    1 0      2  1 0  b10   0 
 1                                                                                                                                 c   0 
      0    0   0    0    0   0    0    0   0    0    0   0    0    0   0   0   0   0    0    0   0   0    0   0   0    0   0 0 0  10         

Solving the above 30 equations gives the 30 unknowns as
i        ai         bi      ci
1        0         0.8     17.1
2        1        18.8     98.1
3       3.1       52.4    232.5
4      –8.4     –108.6    –331
5       7.9        87     255.8
6      –7.6       –68    –131.7
7       7.3       51.2    106.7
8      –7.2      –35.8    –23.8
9       7.1       21.4     33.4
10      –7.2       –7.2     19.1

Therefore, the splines are given by
T ( z )  0.8z  17.1,                                                     10  z  9
 z 2  18 .8 z  98 .1,                                            9  z  8
 3.1z 2  52 .4 z  232 .5,                                        8  z  7
 8.4 z 2  108 .6 z  331,                                        7  z  6
 7.9 z 2  87 z  255 .8,                                          6  z  5
Spline Method of Interpolation-More Examples: Civil Engineering                     05.05.7

 7.6 z 2  68 z  131 .7,             5  z  4
 7.3z  51 .2 z  106 .7,
2
 4  z  3
 7.2 z 2  35 .8 z  23 .8,           3  z  2
 7.1z 2  21 .4 z  33 .4,             2  z  1
 7.2 z  7.2 z  19 .1,
2
1  z  0

At z  7.5
T (7.5)  3.1(7.5) 2  52 .4(7.5)  232 .5
 13.875C
The absolute relative approximate error a obtained between the results from the linear and