Spline Continuity and End Conditions - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


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

Odd Degree

  

The resulting function created by CurveFitting[Spline] is of the form piecewisev<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+1n conditions:

2n Interpolating Conditions

• 

Force continuity at the knots.

pixi1=yi1,andpixi=yi,fori=1,2,...,n

(d-1)(n-1) Continuity Conditions

• 

Force continuity of the derivatives of order 1,2,...,d1 at the knots.

pikxi=pi+1kxi,fori=1,2,...,n1,andk=1,2,...,d1

d-1 End Conditions

• 

Natural splines specified by endpoints='natural'.

  

Equate the derivates of order d+12,...,d1 at the end nodes to zero.

pikx0=0,andpnkxn=0,fork=d2+12,...,d1

• 

Not-a-knot splines specified by endpoints='notaknot'.

  

Force the continuity of the dth derivative at the knots xi, for i=1,2,...,d12 and i=nd12,...,n1.

pikxi=pi+1dxi,andpnidxni=pni+1dxni,fori=1,2,...,d212

• 

Periodic splines specified by endpoints='periodic'.

  

Match the derivatives of order 1,2,...,d1 at the end nodes.

p1kx0=pnkxn,fork=1,2,...,d1

• 

Clamped splines specified by endpoints=V.

  

Equate the derivates of order 1,2,...,d12 at the end nodes to the specified values given in V, where V is either a list, Vector, or an Array, of dimension d1 containing the specified clamped conditions. Specifically,

V=p11x0&comma;...&comma;p1d212x0&comma;pn1xn&comma;...&comma;pnd212xn,with

p1kx0=Vk,andpnkxn=Vk+d2+12,fork=1,2,...,d212

• 

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, xn1, 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 4d, with

x=p11x0&comma;p21x1&comma;...&comma;p1d1x0&comma;p2d1x1&comma;p1d&comma;p2d&comma;pn11xn1&comma;pn1xn&comma;...&comma;pn1d1xn1&comma;pnd1xn&comma;pn1d&comma;pnd

  

A is the corresponding coefficient matrix of dimension d1 by 4d and b, a vector of dimension d1, 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 &lsqb;A&verbar;b&rsqb;, having dimensions d1 by 4d+1.

Even Degree

  

Without the knots='data' option, the resulting function created by CurveFitting[Spline] is of the form piecewisev<z1,p1,...,v<zn,pn,pn+1, where zi=xi12+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+1n+1 conditions.

n+1 Interpolating Conditions at the Nodes

• 

Force continuity at the nodes.

pixi1=yi1,fori=1,2,...,n+1

n Interpolating Conditions at the Knots

• 

Force continuity at the knots.

pizi=pi+1zi,fori=1,2,...,n

(d-1)n Continuity Conditions

• 

Force continuity of the derivatives of order 1,2,...,d1 at the knots.

pikzi=pi+1kzi,fori=1,2,...,nandk=1,2,...,d1

d End Conditions

• 

Natural splines specified by endpoints='natural'.

  

Equate the derivates of order d2,...,d1 at the end nodes to zero.

p1kx0=0,andpn+1kxn=0,fork=d2,...,d1

• 

Not-a-knot splines specified by endpoints='notaknot'.

  

Force the continuity of the dth derivative at the knots zi, for i=1,2,...,d2 and i=n+1d2,...,n1.

pidzi=pi+1dzi,andpni+1dzni+1=pn+2idzni+1,fori=1,2,...,d2

• 

Periodic splines specified by endpoints='periodic'.

  

Match the derivatives of order 1,2,...,d at the end nodes.

p1kx0=pn+1kxn,fork=1,2,...,d

• 

Clamped splines specified by endpoints=V.

  

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=p11x0&comma;...&comma;p1d2x0&comma;pn+11xn&comma;...&comma;pn+1d2xn,with

p1kx0=Vk,andpn+1kxn=Vk+d2,fork=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 2d, with

x=p11x0&comma;...&comma;p1d1x0&comma;p1d&comma;pn+11xn&comma;...&comma;pn+1d1xn&comma;pn+1d

  

A is the corresponding coefficient matrix of dimension d by 2d 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 &lsqb;A&verbar;b&rsqb;, having dimensions d by 2d+1.

Even degree with knots='data'

  

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 piecewisev<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+1n conditions:

2n Interpolating Conditions

• 

Force continuity at the knots.

pixi1=yi1,andpixi=yi,fori=1,2,...,n

(d-1)(n-1) Continuity Conditions

• 

Force continuity of the derivatives of order 1,2,...,d1 at the knots.

pikxi=pi+1kxi,fori=1,2,...,n1,andk=1,2,...,d1

d-1 End Conditions

• 

Natural splines specified by endpoints='natural'.

  

Equate the derivates of order d2,...,d1 at the left end node and the derivatives of order d2,...,d2 at the right end node to zero.

p1kx0=0,fork=d2,...,d1,and

pn+1kxn=0,fork=d2,...,d2

• 

Not-a-knot splines specified by endpoints='notaknot'.

  

Force the continuity of the dth derivative at the knots zi, for i=1,2,...,d2 and i=n+1d2,...,n1.

pidzi=pi+1dzi,fori=1,2,...,d2,and

pnidzni=pni+1dzni,fori=1,2,...,d21

Examples

withCurveFitting&colon;

data0&comma;0&comma;1&comma;5&comma;2&comma;1&comma;3&comma;0

data0&comma;0&comma;1&comma;5&comma;2&comma;−1&comma;3&comma;0

(1)

A quintic spline using the 'natural' end condition.

Splinedata&comma;v&comma;degree=5&comma;endpoints=natural

311v510111v2+15311vv<1611v5+4511v49011v3v2+10811v+911v<2311v54511v4+27011v373111v2+82811v27911otherwise

(2)

A cubic spline using the 'periodic' end condition.

Splinedata&comma;v&comma;degree=3&comma;endpoints=periodic

5v3+4v2+6vv<16v329v2+39v11v<2v3+13v245v+45otherwise

(3)

A quadratic spline using the 'notaknot' end condition.

Splinedata&comma;v&comma;degree=2&comma;endpoints=notaknot

7v2+12vv<325v224v+27otherwise

(4)

A clamped cubic spline with slope A and B at the two end nodes.

Splinedata&comma;v&comma;endpoints=A&comma;B

11A15495+B15v3+74526A15B15v2+Avv<1A5+425B5v3+1995+16A15+11B15v2+9A5+27354B5v+14A15915+4B15v<2295+A15+11B15v3+22758A1573B15v2+5795+7A5+52B5v+47756A536B5otherwise

(5)

A cubic spline using the generalized end conditions with second derivative equal to 5 at the end nodes.

GMatrix2&comma;13&comma;1&comma;3=1&comma;1&comma;13=5&comma;2&comma;10=1&comma;2&comma;13=5&colon;

Splinedata&comma;v&comma;endpoints=G

225v3+52v2+6910vv<16v328710v2+38110v525v<285v3+16910v253110v+2525otherwise

(6)

See Also

CurveFitting

CurveFitting[Spline]