0% found this document useful (0 votes)
78 views7 pages

Cubic Sp-Lines:: X, F, X, F,, X, F X), Then S (X) S

The document describes the construction of cubic spline interpolation. Cubic splines are piecewise cubic polynomials that satisfy certain continuity conditions at interior knots. The construction involves: 1) Representing the second derivative of each cubic segment as a linear function through interior knots. 2) Integrating twice to obtain the cubic segment as a function of its second derivative. 3) Applying boundary and continuity conditions to determine values at interior knots. The example shows using cubic spline interpolation to estimate an unknown function value.

Uploaded by

Tahera Parvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views7 pages

Cubic Sp-Lines:: X, F, X, F,, X, F X), Then S (X) S

The document describes the construction of cubic spline interpolation. Cubic splines are piecewise cubic polynomials that satisfy certain continuity conditions at interior knots. The construction involves: 1) Representing the second derivative of each cubic segment as a linear function through interior knots. 2) Integrating twice to obtain the cubic segment as a function of its second derivative. 3) Applying boundary and continuity conditions to determine values at interior knots. The example shows using cubic spline interpolation to estimate an unknown function value.

Uploaded by

Tahera Parvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Cubic Sp-Lines:

The concept of splines originated from the mechanical drafting tool called “spline” used
by designers for drawing smooth curves. It is a slender flexible bar made of wood or some other
elastic material.

These curves resemble cubic curves and hence the name “cubic splines”, has been given to the
piecewise cubic interpolating polynomials. Cubic splines are popular because of their ability to
the interpolate data with smooth curves. It is believed that a cubic polynomial spline always
appear smooth to the eyes.

Fig: piecewise polynomial interpolation

Fig: 2nd degree polynomials

We consider here the construction of a cubic spline function which would interpolate the points
( x 0 , f 0 ) , ( x 1 , f 1) , … … … … … , ( x n , f n ). The cubic spline s( x ) consist of (n−1) cubic corresponding
to (n−1) subintervals. If we denote such cubic by si ( x ) , then

s ( x )=s i ( x ) , i=1,2 ,… … . , n

These cubic must satisfy the following conditions:

1. s( x ) must interpolate f at all the points x 0 , x 1 ,… … … … , x n


i.e. for each i, s ( x i )=f i……………………(1)
2. The function value must be equal at all the interior knots,

si ( x i) =si+1 ( x i )………………………(2)

3. The first derivatives at the interior knots must equal,


s'i ( x i) =s'i+1 ( x i )………………………..(3)
4. The second derivatives at the interior knots must equal,
s'i ' ( x i )=s ''i+1 ( x i )………………………..(4)
5. The second derivatives at the end points are zero
s'i ' ( x 0 )=s ''i ( x n )=0…………………(5)

Step:1

Let us first consider the second derivatives. Since si ( x ) is a cubic function, its second derivatives
s'i ' ( x ) is a straight line. This straight line can be represented by a first order Lagrange
interpolating polynomial. Since the line passes through the points ¿and ¿ we have,

x−x i
s}i left (x right ) = {s} rsub {i} rsup { ( x i−1 ) + s} left ({x} rsub {i} right ) {x- {x} rsub {i-1}} over {{x} rsub {i} - {x} rsub {i-1} ¿………
x i−1−xi i
…………..(6)

The unknown s}i left ({x} rsub {i-1} right ¿ and s}i left ({x} rsub {i} right ¿ are to be determined. For the sake of
simplicity, let us denote

s}i left ({x} rsub {i-1} right ) = {a} rsub {i-1} ¿and s}i left ({x} rsub {i} right ) = {a} rsub {i ¿

x−x i=ui and x−x i−1=ui−1

∴ xi −xi−1=u i−1−ui=h i

Then equation (6) becomes

s}i left (x right ) = {a} rsub {i-1} {{u} rsub {i}} over {{-h} rsub {i}} + {a} rsub {i} {{u} rsub {i-1}} over {{h} rsub {i}} = {{a} rsub {i} { u} rsub {i-1} - {a} rsub {i-1} {u} rsub {i}} ove
………………(7)

Step:2

Now we can obtain si (x )by integrating equation(7)twice thus

ai u3i −1 −ai−1 u 3i
si ( x ) = +c 1 x +c 2……………………..(8)
6 hi
d ui
Wherec 1andc 2are constants of integration [observe that =1and therefore differentiation
dx
w.r.to x and w.r.to ui will be equivalent]

The linear part c 1 x +c 2can be expressed as

b 1( x −xi−1 )+ b2 (x−x i)

With suitable choice of b 1 and b 2

Therefore,

c 1 x +c 2=b1 ( x−x i−1)+b 2( x −xi )

¿ b1 ui−1 +b2 ui

Then equation (8)becomes

ai u3i −1 −ai−1 u 3i
si ( x ) = +b 1 ui−1 +b2 ui…………………(9)
6 hi

Step:3
Now we must determine the coefficients b 1 and b 2.

We know that, by condition (1)

s ( x i )=f iand s ( x i−1) =f i−1

At x=x i,

ui=0 ,u i−1 =hi

ai h2i
f i= +b 1 h i
6

Similarly, at x=x i−1

ui−1=0 ,ui =−hi

And, therefore

ai−1 h 2i
f i−1= −b2 h i
6
Thus we get,

f ah
b 1= i − i i ………………….(9(a))
hi 6

−f i−1 ai −1 hi
b 2= + ……………(9(b))
hi 6

Substituting for b 1 and b 2in equation (9)and after rearrangement of terms we get

ai−1 2 a 1
si ( x ) = ( hi ui−u 3i ) + i ( u3i −1−h2i u i−1 ) + ( f i ui−1−f i−1 u i)……………(10)
6 hi 6 hi hi
Note that equation (10) has only two unknowns a i−1 and a i

Step: 4

The final step is to evaluate these constants. This can be done by invoking the condition

s'i ( x i) =s'i+1 ( x i )

Differentiating (10) we get

ai−1 2 ai
'
si ( x ) =
6 hi
( 2
hi −3u i ) +
6 hi
(3 u2i−1−h2i )+ h1 ( f i−f i−1)
i

Setting x=x i,

ai−1 hi ai hi f i−f i−1


s'i ( x i) = + +
6 3 hi

Similarly,

' −a i hi +1 a i+1 hi+1 f i+1−f i


si+ 1 ( x i )= − + , [ui +1=hi +1]
3 6 hi+1

Since,

s'i ( x i) =s'i+1 ( x i )
We have,

f i +1−f i f i−f i−1


hi ai−1 +2 ( hi +hi +1 ) ai +hi+1 ai +1=6 − ………….(11)
h i+1 hi

Equation (11) when written for all integer knots (i=1,2,3 , … … … . , n−1)we get (n−1)
simultaneous equation containing (n+1)unknowns(a 0 , a 1 , … … … … .. , an). Now applying the
condition that the second derivatives at the end points are zero, we get,

a 0=a1 =0

Thus, we have (n−1) equations with (n−1) unknowns which can be easily solved.

Problem: Given the data points

i 0 1 2
X 4 9 16
fi 2 3 4

Estimate the function value f at x=7 using cubic sp-lines.

Solution:

We know that,

hi =xi −xi−1

∴ h1=x 1−x 0=9−4=5 h 2=x 2−x 1=16−9=7

f 0=2 , f 1=3 , f 2=4

We also know that,

f i +1−f i f i−f i−1


hi ai−1 +2 ( hi +hi +1 ) ai +hi+1 ai +1=6
[ hi+1

hi ]
With ,

a 0=a2 =0 , thus for i=1

f 2−f 1 f 1−f 0
h1 a0 +2 ( h1 +h 2) a 1+ h2 a2=6
[ h2

h1 ]
4−3 3−2
⇒ 2 ( 5+7 ) a1 =6 [ 7

5 ]
1 1
⇒ 24 a1=6 [ ]

7 5

−1 −1
⇒ 2 a1 = ⇒ a1= =−0.0143
35 70

Since, n=3, these are two cubic splines, namely

s1 ( x ) , x 0 ≤ x ≤ x1

s2 ( x ) , x1 ≤ x ≤ x 2

The tangent point x=7 is in the domain of S1 (x) and therefore, we need to use only s1 (x) for
estimation, we have,

ai−1 2 a 1
si ( x ) = ( hi ui−ui3 ) + i ( ui−13−h i2 ui−1 ) + ( f i u i−1−f i −1 ui )
6 hi 6 hi hi

a0 a 1
s1 ( x ) = ( h12 u1−u13 ) + 1 ( u03−h 12 u0 ) + ( f 1 u 0−f 0 u 1)
6 h1 6 h1 h1

[ u0 =x−x 0=7−4=3 ]
[ u1=x− x1=7−9=−2 ] ; at [ x=7 ]

s1 (7 )= ( 3 −5 ×3 ) + 1 ( 3× 3−2 ×(−2) )
−0.0143 3 2
6 ×5 5

0.0143 1
¿− ( 27−75 )+ ( 9+4 )
30 5

0.0143 13 1 1
¿ × 48+ = ( 0.1144+ 13 )= ×13.1144 =2.62288
30 5 5 5

(Ans.)

You might also like