# M k 1 h k 1 6 y k 2 h k 1 m k 2 h k 1 6 x k 1 x x k 2

• Notes
• 61
• 100% (1) 1 out of 1 people found this document helpful

This preview shows page 35 - 39 out of 61 pages.

- m k +1 h k +1 6 ) + ( y k +2 h k +1 - m k +2 h k +1 6 ) , x k +1 x x k +2 . (1.85) Taking the limit from the left at x k +1 leads to S 0 k ( x k +1 ) = m k +1 h k 3 + m k h k 6 + d k . (1.86) Taking the limit from the right at x k +1 yields S 0 k +1 ( x k +1 ) = - m k +1 h k +1 3 - m k +2 h k +1 6 + d k +1 35
where d k = y k +1 - y k h k , k = 0 , 1 , · · · , n - 1 Using (1.83) we obtain the following system having n + 1 unknowns and n - 1 equations. ( m k h k + 2 m k +1 ( h k + h k +1 ) + m k +2 h k +1 = 6( d k +1 - d k ) , k = 0 , 1 , 2 , · · · , n - 2 . (1.87) Now we need to close the system by adding two more equations. The most popular techniques to close the system are ( i ) natural, ( ii ) not-a-knot and ( iii ) clamped splines. Natural Spline is defined by the following two boundary conditions S 00 ( x 0 ) = 0 , S 00 ( x n ) = 0 , (1.88) which lead to m 0 = 0 , m n = 0 . (1.89) This is called the natural spline. The system (1.87) combined with (1.89) leads to (2 h 0 + 2 h 1 ) m 1 + h 1 m 2 = u 0 m k h k + 2 m k +1 ( h k + h k +1 ) + m k +1 h k +1 = u k , 1 k n - 3 h n - 2 m n - 2 + 2( h n - 2 + h n - 1 ) m n - 1 = u n - 2 . (1.90) The matrix formulation of this system can be written as 2( h 0 + h 1 ) h 1 0 · · · 0 h 1 2( h 1 + h 2 ) h 2 . . . 0 0 h 2 2( h 2 + h 3 ) · · · 0 . . . . . . . . . . . . h n - 2 0 · · · 0 h n - 2 2( h n - 2 + h n - 1 ) m 1 m 2 m 3 . . . m n - 1 = u 0 u 1 u 2 . . . u n - 2 . (1.91) The resulting matrix is symmetric positive definite and strictly diagonally dominant. Thus, the system admits a unique solution. We will discuss other splines such as not-a-knot and clamped splines. Not-a-Knot Spline is defined by adding the following two conditions to close the system S 000 0 ( x 1 ) = S 000 1 ( x 1 ) S 000 n - 2 ( x n - 1 ) = S 000 n - 1 ( x n - 1 ) , (1.92) 36
which lead to m 1 - m 0 h 0 = m 2 - m 1 h 1 (1.93) and m n - m n - 1 h n - 1 = m n - 1 - m n - 2 h n - 2 . (1.94) Solving (1.93) and (1.94) for m 0 and m n yields m 0 = (1 + h 0 /h 1 ) m 1 - ( h 0 /h 1 ) m 2 (1.95) m n = - h n - 1 /h n - 2 m n - 2 + (1 + h n - 1 /h n - 2 ) m n - 1 . (1.96) Substituting (1.93) and (1.96) in (1.87) we obtain (3 h 0 + 2 h 1 + h 2 0 /h 1 ) m 1 + ( h 1 - h 2 0 /h 1 ) m 2 = u 0 m k h k + 2 m k +1 ( h k + h k +1 ) + m k +1 h k +1 = u k , k = 1 , · · · , n - 3 ( h n - 2 - h 2 n - 1 /h n - 2 ) m n - 2 + (2 h n - 2 + 3 h n - 1 + h 2 n - 1 /h n - 2 ) m n - 1 = u n - 2 (1.97) The main steps of our algorithm are 1. Compute u k = 6( d k +1 - d k ) , k = 0 , 1 , · · · , n - 2 2. Solve the system (1.97) for m 1 , m 2 , · · · m n - 1 3. Compute m 0 and m n from (1.95) and (1.96) 4. Use (1.81) to compute p k and q k , k = 0 , 1 , · · · n - 1 5. Apply the formula (1.82) for finding S k ( x ). The matrix formulation for the not-a-knot spline can be written as AM = U (1.98a) where A = 3 h 0 + 2 h 1 + h 2 0 h 1 h 1 - h 2 0 h 1 0 · · · 0 h 1 2( h 1 + h 2 ) h 2 . . . 0 0 h 2 2( h 2 + h 3 ) · · · 0 . . . . . . . . . . . . h n - 2 0 · · · 0 h n - 2 - h 2 n - 1 h n - 2 2 h n - 2 + 3 h n - 1 + h 2 n - 1 h n - 2 (1.98b) 37
M = m 1 m 2 m 3 . . . m n - 1 , B = u 0 u 1 u 2 .
• • • 