Question: find the quadratic spline S(x) that interpolates the following data (0,0),(1,3),(2,3)
The data points are: (0,0),(1,3),(2,3)
The quadrtic spline is:
S(x) = |a1x^2 + b1x + c1, 0 ≤ x ≤ 1
|a2x^2 + b2x + c2, 1 ≤ x ≤ 2
We have 6 unknowns, so we need 6 equations.
Set up the eqns
1st apline: a1(0)^2 + b1(0) + c1 = 0
a1(1)^2 + b1(1) + c1 = 3
2nd spline: a2(1)^2 + b2(1) + c2 = 3
a2(2)^2 + b2(2) + c2 = 3
Common slope (derivative) at (1,3)
2a1(1) + b1 = 2a2(1) + b2
The 3nth eqn
Let a1 = 0
Our system of linear equns then is,
c1 = 0
b1 + c1 = 3 -> b1 = 3
a2 + b2 + c2 = 3
4a2 + 2b2 + c2 = 3
The last two eqns, along with the common slope eqn give us,
a2 = -3, b2 = 9, c2 = -3
The 6 unknowns are: a1 = 0, b1 = 3, c1 = 0, a2 = -3, b2 = 9, c2 = -3
Giving the quadratic spline as:
S(x) = |3x , 0 ≤ x ≤ 1
|-3x^2 + 9x - 3 , 1 ≤ x ≤ 2