Spline Interpolation
Given: (n + 1) observations or data pairs [(x0, f0), (x1, f1), (x2, f2) … (xn, fn)]
This gives a mesh of nodes 𝑥 ,𝑥 ,𝑥 ,⋯𝑥 on the independent variable and the corresponding function values as 𝑓 ,𝑓 ,𝑓 ,⋯𝑓 Goal: fit an independent polynomial in each interval (between two points) with certain continuity requirements at the nodes. Linear spline: continuity in function values, C0 continuity Quadratic spline: continuity in function values and 1st derivatives, C1 continuity Cubic spline: continuity in function values, 1st and 2nd derivatives, C2 continuity
Denote for node i or at xi: functional value fi, first derivative ui, second derivative vi Spline Interpolation: Cubic
xi+2, fi+2
xi, fi qi(x) qi+1(x)
qi-1(x) xi+1, fi+1 𝑞 𝑥 𝑓 xi-1, fi-1 𝑞 𝑥 𝑞 𝑥 𝑞 𝑥 𝑢 𝑞 𝑥 𝑞 𝑥 𝑣 𝑞 𝑥
A cubic polynomial in each interval: (n+1) points, n cubic polynomials, 4n unknowns Available conditions: (n + 1) function values, (n - 1) function continuity, (n -1) 1st derivative continuity conditions and (n -1) 2nd derivative continuity conditions, total 4n - 2 conditions. 2 free conditions to be chosen by the user! Spline Interpolation: Cubic
Cubic Spline in the interval 𝑥 ,𝑥 : 𝑞 𝑥 𝑞 𝑥 is a set of linear splines. Let us denote the 2nd derivative (v) of the function at the ith node as 𝑓 𝑥 𝑣 𝑥 𝑣 Therefore: 𝑞 𝑥 𝑣 𝑥 𝑣 and 𝑞 𝑥 𝑣 𝑥 𝑣 We may write: 𝑣 𝑣 𝑞 𝑥 𝑥 𝑥 𝑥 𝑥 ℎ ℎ 𝑣 𝑣 𝑞 𝑥 𝑥 𝑥 𝑥 𝑥 𝑐 𝑥 𝑐 6ℎ 6ℎ 𝑣 ℎ 𝑞 𝑥 𝑓 𝑐 𝑥 𝑐 6 𝑣 ℎ 𝑞 𝑥 𝑓 𝑐 𝑥 𝑐 6 Spline Interpolation: Cubic
𝑣 𝑣 𝑞 𝑥 𝑥 𝑥 𝑥 𝑥 𝑐 𝑥 𝑐 6ℎ 6ℎ 𝑣 ℎ 𝑣 ℎ 𝑞 𝑥 𝑓 𝑐 𝑥 𝑐 ; 𝑞 𝑥 𝑓 𝑐 𝑥 𝑐 6 6 ℎ 𝑓 𝑓 ℎ ℎ 𝑐 𝑓𝑥 ,𝑥 𝑣 𝑣 𝑣 𝑣 6 ℎ ℎ 6 6 𝑓 𝑓 ℎ ℎ 𝑐 𝑥 𝑥 𝑣 𝑥 𝑣 𝑥 ℎ ℎ 6 6 𝑞 𝑥 𝑣 𝑥 𝑥 𝑣 𝑥 𝑥 ℎ 𝑥 𝑥 ℎ 𝑥 𝑥 6 ℎ 6 ℎ 𝑓 𝑓 𝑥 𝑥 𝑥 𝑥 ℎ ℎ
We need to estimate (n + 1) unknown vi. We have (n – 1) conditions from the continuity of the first derivative. Spline Interpolation: Cubic