Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,

Similar presentations


Presentation on theme: "Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,"— Presentation transcript:

1 Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b, called nodes, a cubic spline interpolant S, for f is a function that satisfies the following condition:

2 Jump to first page (3.1). S is a cubic polynomial, denoted S j, on the subinterval [ x j, x j + 1 ] for each j = 0, 1,..., n-1. (3.2). S(x j ) = f(x j ) for each j = 0, 1, …, n. (The spline passes through each data point.)

3 Jump to first page (3.3). S j + 1 (x j + 1 ) = S j (x j + 1 ) for each j = 0, 1, …, n-2. ( The spline forms a continuous function.) (3.4). S j + 1 (x j + 1 ) = S j (x j + 1 ) for each j = 0, 1, …, n-2. ( The spline forms a smooth function.) (3.5). S  j + 1 (x j + 1 ) = S  j (x j + 1 ) for each j = 0, 1, …, n-2. ( The second derivative is continuous.)

4 Jump to first page (3.6). One of the following set of boundary conditions is satisfied: (4.6.1) S  (x 0 ) = S  x n ) = 0 ( free or natural boundary) (4.6.2) S(x 0 ) = f  (x 0 ) and S(x n ) = f  (x n ) ( Clamped boundary) Although cubic splines are defined with other boundary conditions, the conditions given above are sufficient for our purposes. When the free boundary conditions occur, the spline is called a natural cubic spline.

5 Jump to first page and its graph approximates the shape, which a long flexible rod would assume if forced to go through each of the data points {( x 0, f(x 0 )), ( x 1, f(x 1 )), …, ( x n, f(x n ))}. Similarly, when the clamped boundary conditions occur, the spline is called a clamped cubic spline. In general, clamped boundary conditions lead to more accurate approximations since they include more information about the function.

6 Jump to first page However, for this type of boundary conditions to hold, it is necessary to have either the value of the derivative at the endpoints or acceptable approximations to those values. Hence we concentrate here only on natural cubic interpolants. To construct the cubic spline interpolant for a given function f, the conditions in the definition (3.1) are applied to the cubic polynomials.

7 Jump to first page S j (x) = a j + b j (x – x j ) + c j (x – x j ) 2 + d j (x – x j ) 3 ; for each j = 0, 1, …, n-1. Clearly, S j (x j ) = a j = f(x j ), and if conditions (3.3) are applied, a j + 1 = S j + 1 (x j + 1 ) = S j (x j + 1 ) = a j + b j (x j +1 – x j ) + c j (x j + 1 – x j ) 2 + d j (x j + 1 – x j ) 3 for each j = 0, 1, …, n-2.

8 Jump to first page Since the term (x j+1 – x j ) will be used repeatedly in this development, it is convenient to introduce the notation h j = x j+1 – x j ; for each j = 0, 1, …, n-1. If we also define a n = f(x n ), then the equation a j + 1 = a j + b j h j + c j h j 2 + d j h j 3 ; holds for each j = 0, 1, …, n-1. (3.9) In a similar manner, define b n = S(x n ) and observe that S j (x) = b j + 2c j ( x – x j ) + 3d j (x- x j ) 2 Implies S j (x j ) = b j for each j = 0, 1, …, n-1.

9 Jump to first page Appling condition (3.4), we get b j + 1 = b j + 2c j h j + 3d j h j 2 ; for each j = 0, 1, …, n-1. (3.10) Another relationship between the coefficients of S j is obtained by defining c n = S  x n ) /2 and applying condition (3.5)  In this case, c j + 1 = c j + 3d j h j ; for each j = 0, 1, …, n-1. (3.11) Solving for d j in Eq. (3.11) and substituting this value into Eqs. (3.9) and (3.10) gives the new equations

10 Jump to first page a j + 1 = a j + b j h j + (h j 2 / 3) (2c j + c j + 1 ) ; for each j = 0, 1, …, n-1. (3.12) and b j + 1 = b j + h j (c j + c j + 1 ) ; for each j = 0, 1, …, n-1. (3.13) The final relationship involving the coefficients is obtained by solving the appropriate equation in the form of equation (3.12), first for b j, b j = (1/h j ) (a j +1 – a j ) – (h j / 3) (2c j + c j +1 ) (3.14) and then, with a reduction of the index, for b j – 1, b j –1 = (1 / h j – 1 ) (a j – a j –1 ) – (h j –1 / 3)(2c j –1 + c j ).

11 Jump to first page Substituting these values into the equation derived from Eq. (3.13), when the index is reduced by 1, gives the linear system of equations h j –1 c j – 1 + 2(h j – 1 + h j )c j +h j c j +1 = (3/h j )(a j +1 – a j ) – (3/ h j – 1 )(a j – a j –1 ); for each j = 0, 1, …, n-1. (3.15) This system involves, only c j s as unknowns, since the value of h j s and a j s are given by the spacing of the nodes x j s and the value of f at the nodes.

12 Jump to first page Note that once the value of c j s are known, it is a simpler matter to find the remainder of the constants b j s from Eq. (3.14) and d j s from Eq. (3.11) and to construct the cubic polynomials S j s. The natural boundary conditions in this case imply that c n = S  (x n ) / 2 = 0 that 0 =S  (x 0 ) = 2c 0 +6d 0 (x 0 – x 0 ) So, c 0 = 0.

13 Jump to first page The two equations c 0 = 0 and c n = 0 together with the equations in (3.15) produce a linear system described by the vector equation Ax = b, where A is ( n+1 )*( n +1) matrix given below. A =

14 Jump to first page With x = and b =

15 Jump to first page Note : Solution of this system is usually obtained using Crouts Algorithm. End of Chapter 3 Go to Chapter 4


Download ppt "Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,"

Similar presentations


Ads by Google