Spline Continuity and End Conditions
This help page describes the interpolating, continuity, and end conditions used in CurveFitting[Spline].
The form of the resulting piecewise function returned depends on whether the degree d is odd or even, and whether or not the knots='data' option is specified in the even case.
Odd Degree
Even Degree
Even degree with knots='data'
Examples
The resulting function created by CurveFitting[Spline] is of the form piecewise⁡v<x1,p1,...,pn, where the n spline sections {p1,p2,...,pn} are polynomials of degree at most d. These polynomials are given by the following d+1⁢n conditions:
2n Interpolating Conditions
Force continuity at the knots.
pi⁡xi−1=yi−1,and⁢pi⁡xi=yi,for⁢i=1,2,...,n
(d-1)(n-1) Continuity Conditions
Force continuity of the derivatives of order 1,2,...,d−1 at the knots.
pik⁢xi=pi+1k⁢xi,for⁢i=1,2,...,n−1,and⁢k=1,2,...,d−1
d-1 End Conditions
Natural splines specified by endpoints='natural'.
Equate the derivates of order d+12,...,d−1 at the end nodes to zero.
pik⁢x0=0,and⁢pnk⁢xn=0,for⁢k=d2+12,...,d−1
Not-a-knot splines specified by endpoints='notaknot'.
Force the continuity of the dth derivative at the knots xi, for i=1,2,...,d−12 and i=n−d−12,...,n−1.
pik⁢xi=pi+1d⁢xi,and⁢pn−id⁢xn−i=pn−i+1d⁢xn−i,for⁢i=1,2,...,d2−12
Periodic splines specified by endpoints='periodic'.
Match the derivatives of order 1,2,...,d−1 at the end nodes.
p1k⁢x0=pnk⁢xn,for⁢k=1,2,...,d−1
Clamped splines specified by endpoints=V.
Equate the derivates of order 1,2,...,d−12 at the end nodes to the specified values given in V, where V is either a list, Vector, or an Array, of dimension d−1 containing the specified clamped conditions. Specifically,
V=p11⁢x0,...,p1d2−12⁢x0,pn1⁢xn,...,pnd2−12⁢xn,with
p1k⁢x0=Vk,and⁢pnk⁢xn=Vk+d2+12,for⁢k=1,2,...,d2−12
Generalized splines given by endpoints=G.
Generalized end conditions can be specified involving any arbitrary linear combination of the values of the derivatives (of any order 1,2,...,d at the nodes x0, x1, xn−1, and xn, where 1<n). Such end conditions can be represented by a linear system of the form Ax=b, where x is a vector of dimension 4⁢d, with
x=p11⁢x0,p21⁢x1,...,p1d−1⁢x0,p2d−1⁢x1,p1d,p2d,pn−11⁢xn−1,pn1⁢xn,...,pn−1d−1⁢xn−1,pnd−1⁢xn,pn−1d,pnd
A is the corresponding coefficient matrix of dimension d−1 by 4⁢d and b, a vector of dimension d−1, represents the right-hand side of the linear system.
Generalized end conditions are specified with the optional parameter endpoints=G, where G is a Matrix or an Array. Here, G represents the augmented linear system [A⁢|⁢b], having dimensions d−1 by 4⁢d+1.
Without the knots='data' option, the resulting function created by CurveFitting[Spline] is of the form piecewise⁡v<z1,p1,...,v<zn,pn,pn+1, where zi=xi−12+xi2, for i=1,2,...,n (that is, the spline knots are defined at the midpoints of the nodes) and the n+1 spline sections {p1,p2,...,pn+1} are polynomials of degree at most d. These polynomials are specified by the following d+1⁢n+1 conditions.
n+1 Interpolating Conditions at the Nodes
Force continuity at the nodes.
pi⁡xi−1=yi−1,for⁢i=1,2,...,n+1
n Interpolating Conditions at the Knots
pi⁡zi=pi+1⁡zi,for⁢i=1,2,...,n
(d-1)n Continuity Conditions
pik⁢zi=pi+1k⁢zi,for⁢i=1,2,...,n⁢and⁢k=1,2,...,d−1
d End Conditions
Equate the derivates of order d2,...,d−1 at the end nodes to zero.
p1k⁢x0=0,and⁢pn+1k⁢xn=0,for⁢k=d2,...,d−1
Force the continuity of the dth derivative at the knots zi, for i=1,2,...,d2 and i=n+1−d2,...,n−1.
pid⁢zi=pi+1d⁢zi,and⁢pn−i+1d⁢zn−i+1=pn+2−id⁢zn−i+1,for⁢i=1,2,...,d2
Match the derivatives of order 1,2,...,d at the end nodes.
p1k⁢x0=pn+1k⁢xn,for⁢k=1,2,...,d
Equate the derivates of order 1,2,...,d2 at the end nodes to the specified values given in V, where V is either a list, Vector, or an Array, of dimension d containing the specified clamped conditions. Specifically,
V=p11⁢x0,...,p1d2⁢x0,pn+11⁢xn,...,pn+1d2⁢xn,with
p1k⁢x0=Vk,and⁢pn+1k⁢xn=Vk+d2,for⁢k=1,2,...,d2
Generalized splines specified by endpoints=G.
Generalized end conditions can be specified involving any arbitrary linear combination of the values of the derivatives (of any order 1,2,...,d at the nodes x0 and xn). Such end conditions can be represented by a linear system of the form Ax=b, where x is a vector of dimension 2⁢d, with
x=p11⁢x0,...,p1d−1⁢x0,p1d,pn+11⁢xn,...,pn+1d−1⁢xn,pn+1d
A is the corresponding coefficient matrix of dimension d by 2⁢d and b, a vector of dimension d, represents the right-hand side of the linear system.
Generalized end conditions are specified with the optional parameter endpoints=G, where G is a Matrix or an Array. Here, G represents the augmented linear system [A⁢|⁢b], having dimensions d by 2⁢d+1.
With the knots='data' option included, CurveFitting[Spline] will avoid creating knots at the midpoints of the nodes, and instead use the nodes for the knots in the even case. The resulting function is of the form piecewise⁡v<x1,p1,...,pn, where the n spline sections {p1,p2,...,pn} are polynomials of degree at most d. These polynomials are given by the following d+1⁢n conditions:
Equate the derivates of order d2,...,d−1 at the left end node and the derivatives of order d2,...,d−2 at the right end node to zero.
p1k⁢x0=0,for⁢k=d2,...,d−1,and
pn+1k⁢xn=0,for⁢k=d2,...,d−2
pid⁢zi=pi+1d⁢zi,for⁢i=1,2,...,d2,and
pn−id⁢zn−i=pn−i+1d⁢zn−i,for⁢i=1,2,...,d2−1
with⁡CurveFitting:
data≔0,0,1,5,2,−1,3,0
A quintic spline using the 'natural' end condition.
Spline⁡data,v,degree=5,endpoints=natural
311⁢v5−10111⁢v2+15311⁢vv<1−611⁢v5+4511⁢v4−9011⁢v3−v2+10811⁢v+911v<2311⁢v5−4511⁢v4+27011⁢v3−73111⁢v2+82811⁢v−27911otherwise
A cubic spline using the 'periodic' end condition.
Spline⁡data,v,degree=3,endpoints=periodic
−5⁢v3+4⁢v2+6⁢vv<16⁢v3−29⁢v2+39⁢v−11v<2−v3+13⁢v2−45⁢v+45otherwise
A quadratic spline using the 'notaknot' end condition.
Spline⁡data,v,degree=2,endpoints=notaknot
−7⁢v2+12⁢vv<325⁢v2−24⁢v+27otherwise
A clamped cubic spline with slope A and B at the two end nodes.
Spline⁡data,v,endpoints=A,B
11⁢A15−495+B15⁢v3+745−26⁢A15−B15⁢v2+A⁢vv<1−A5+425−B5⁢v3+−1995+16⁢A15+11⁢B15⁢v2+−9⁢A5+2735−4⁢B5⁢v+14⁢A15−915+4⁢B15v<2−295+A15+11⁢B15⁢v3+2275−8⁢A15−73⁢B15⁢v2+−5795+7⁢A5+52⁢B5⁢v+4775−6⁢A5−36⁢B5otherwise
A cubic spline using the generalized end conditions with second derivative equal to 5 at the end nodes.
G≔Matrix⁡2,13,1,3=1,1,13=5,2,10=1,2,13=5:
Spline⁡data,v,endpoints=G
−225⁢v3+52⁢v2+6910⁢vv<16⁢v3−28710⁢v2+38110⁢v−525v<2−85⁢v3+16910⁢v2−53110⁢v+2525otherwise
See Also
CurveFitting
CurveFitting[Spline]
Download Help Document