Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Numerical Methods
Numerical Analysis
Spline Method
Problem Statement: A given data for the movement of robotic arm gives a long path after using a 5th
degree polynomial interpolation. The given data is:
x (in.)
y (in.)
Find a solution that fits this data with a smooth function to avoid damage to
2.00
7.2
arm?
Solution:
4.25
7.1
5.25
6.0
7.81
5.0
9.20
3.5
10.60
5.0
y ( x ) a1 x 2 b1 x c1 ,
2.00 x 4.25
a 2 x 2 b2 x c 2 ,
4.25 x 5.25
a 3 x 2 b3 x c3 ,
5.25 x 7.81
a 4 x 2 b4 x c 4 ,
7.81 x 9.20
a 5 x 2 b5 x c5 ,
9.20 x 10.60
Here, we have represented a degree two polynomial to interpolate consecutive data points. As each
polynomial is defined on two values of given data i.e, a x b , we can evaluate polynomial at a and
b two get 2n equations for n quadratic functions. But these are not enough to evaluate all unknowns.
As the first derivatives are continuous at interior points, this gives us
UET, Pakistan
1|Page
Numerical Analysis
Spline Method
The first derivatives of two quadratic splines are continuous at the interior points.
For example, the derivative of the first spline
a1 x 2 b1 x c1 is
2 a1 x b1
2 a2 x b2
2.
3.
4.
5.
6.
7.
8.
9.
10.
Using derivatives:
At x=4.25
2a 2 (5.25) b2 2a 3 (5.25) b3 0
At x 7.81
2a 3 (7.81) b3 2a 4 (7.81) b4 0
At x 9.20
2a 4 (9.20) b4 2a 5 (9.20) b5 0
2|Page
UET, Pakistan
Numerical Analysis
Spline Method
%a=zeros(1,15);
1.0556
0.68943
1.7651
3.2886
0.044444
7.2889
8.9278
11.777
9.3945
36.319
28.945
113.40
64.042
314.34
>> b(15,:)=a;
>> c=[7.2 7.1 7.1 6.0 6.0 5.0 5.0 3.5 3.5 5.0 0 0 0 0 0];
>> x=b\(transpose(c));
y ( x) 0.044444 x 7.2889,
2.00 x 4.25
4.25 x 5.25
5.25 x 7.81
7.81 x 9.20
9.20 x 10.60
UET, Pakistan
3|Page