



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




















Why Splines?
2 1 25
1 ( )
x
f x
=
Table : Six equidistantly spaced points in [-1, 1]
Figure : 5
th order polynomial vs. exact function
x (^) 2 1 25
1
x
y
=
0.2 0.
0.6 0.
1.0 0.
Why Splines?
-0.
-0.
0
-1 -0.5 0 0.5 1
x
y
19th Order Polynomial f (x) 5th Order Polynomial
( ),
( ) ( ) ( ) ( ) 0 1 0
1 0 0 x x x x
f x f x f x f x ā ā
ā = + x (^) 0 ⤠x ⤠x 1
( ),
( ) ( ) ( ) 1 2 1
2 1 1 x x x x
f x f x f x ā ā
ā = + x 1 (^) ⤠x ⤠x 2
.
.
.
( ),
( ) ( ) ( ) 1 1
1 1 ā ā
ā ā ā ā
ā = + n n n
n n n x x x x
f x f x f x x (^) n ā 1 ⤠x ⤠xn
1
( ) ( 1 )
ā
ā ā
ā
i i
i i x x
f x f x
The upward velocity of a rocket is given as a function
of time in Table 1. Find the velocity at t=16 seconds
using linear splines.
Table Velocity as a
function of time
t v ( t )
Given ( x (^) 0 , y 0 ) (, x 1 , y 1 ),......, ( xn ā 1 , yn ā 1 ) (, xn , yn ), fit quadratic splines through the data. The splines
are given by
( ) 1 1 ,
2 f x = a 1 x + bx + c x (^) 0 ⤠x ⤠x 1
2 2 ,
2 = a (^) 2 x + b x + c x 1 (^) ⤠x ⤠x 2
.
.
.
,
2 = a (^) n x + bnx + c n x (^) n ā 1 ⤠x ⤠xn
Each quadratic spline goes through two consecutive data points
1 0 1 (^0 )
2 a 1 (^) x 0 + bx + c = f x
1 1 1 (^1 )
2 a 1 (^) x 1 + bx + c = f x.
.
.
1 (^1 )
2 ai xi ā 1 + bixi ā + ci = f xi ā
( )
2 a (^) i xi + bixi + ci = f x i.
.
.
1 (^1 )
2 an xn ā 1 + bnxn ā + cn = f xn ā
( )
2 a (^) n xn + bnxn + cn = f x n
This condition gives 2n equations
Similarly at the other interior points,
2 a 2 x 2 + b 2 ā 2 a 3 x 2 ā b 3 = 0
.
.
.
2 ai xi + bi ā 2 ai + 1 xi ā bi + 1 = 0
.
.
.
2 an ā 1 xn ā 1 + bn ā 1 ā 2 anxn ā 1 ā bn = 0
We have (n-1) such equations. The total number of equations is ( 2 n ) + ( n ā 1 )=( 3 n ā 1 ).
We can assume that the first spline is linear, that is a 1 = 0
( ) 1 1 ,
2 f x = a 1 x + b x + c x 0 (^) ⤠x ⤠x 1
2 2 ,
2 = a (^) 2 x + b x + c x 1 (^) ⤠x ⤠x 2
.
.
.
,
2 = a (^) n x + bnx + c n x (^) n ā 1 ⤠x ⤠xn
1 1
2
1
, 2 2
2
2
= a t + b t + c 10 ⤠t ⤠15
, 3 3
2
3
= a t + b t + c 15 ⤠t ⤠20
, 4 4
2
4
= a t + b t + c 20 ⤠t ⤠22. 5
, 5 5
2
5
= a t + b t + c 22. 5 ⤠t ⤠30
Let us set up the equations
Each Spline Goes Through Two
Consecutive Data Points
( ) , 1 1
2
1
v t = a t + b t + c 0 ⤠t ⤠10
( 0 ) ( 0 ) 0 1 1
2
1
a + b + c =
( 10 ) ( 10 ) 227. 04 1 1
2
1
a + b + c =
2 2
2
2
2 ( 10 ) 2 ( 10 ) 0 1 1 2 2
a + b ā a ā b =
2 ( 15 ) 2 ( 15 ) 0 2 2 3 3
a + b ā a ā b =
2 ( 20 ) 2 ( 20 ) 0 3 3 4 4
a + b ā a ā b =
2 ( 22. 5 ) 2 ( 22. 5 ) 0 4 4 5 5
a + b ā a ā b =
At t=
At t=
At t=
At t=22.