spline - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


spline

compute a natural spline

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

spline(X, Y, z, d)

Parameters

X, Y

-

two vectors or two lists

z

-

name

d

-

(optional) positive integer or name

Description

• 

Important: The spline function has been deprecated. Use the superseding function CurveFitting[Spline] instead.  A call to spline automatically generates a call to CurveFitting[Spline].

• 

The spline function computes a piecewise polynomial approximation to the X Y data values of degree d (default 3) in the variable z. The X values must be distinct and in ascending order. There are no conditions on the Y values. The result is returned in the form

P1z<X2P2z<X3PN...

  

which is equivalent to

if z<X2 then P1 elif z<X3 then P2 ... else PN end if

  

where the N=nopsX1 segment polynomials Pi are of degree d.

• 

The segment polynomials P1,P2,...,PN are uniquely given by the following d+1N conditions

1. 

2N interpolating conditionsPi|z=Xi=Yi andPi|z=Xi+1=Yi+1, i=1..N

2. 

d1N1 continuity conditions&DifferentialD;k&DifferentialD;xkPi|z=Xi+1=&DifferentialD;k&DifferentialD;xkPi|z=Xi+1, i=1..N1,k=1..d1

3. 

d1 additional conditions&DifferentialD;k&DifferentialD;xkP1|z=X1=0, k=diquod&comma;2,...,d1, and&DifferentialD;k&DifferentialD;xkPN|z=XN+1=0, k=diquod1&comma;2,...,d1.

  

The last two conditions give rise to what are called the ``natural splines''. For example, for cubic splines, with k=2, we obtain the two conditions

&DifferentialD;2&DifferentialD;x2P1|z=X1=0an&DifferentialD;&DifferentialD;2&DifferentialD;x2PN|z=XN+1=0

• 

The fourth optional argument must be a positive integer (default 3) or one of the keywords linear, quadratic, cubic, or quartic. It specifies the degree of the segment polynomials.

Examples

Important: The spline function has been deprecated. Use the superseding function CurveFitting[Spline] instead.  A call to spline automatically generates a call to CurveFitting[Spline].

spline0&comma;1&comma;2&comma;3&comma;0&comma;1&comma;4&comma;3&comma;x&comma;linear

xx<12+3xx<26xotherwise

(1)

spline0&comma;1&comma;2&comma;3&comma;0&comma;1&comma;4&comma;3&comma;x&comma;cubic

45x3+15xx<12x3+425x2415x+145x<265x3545x2+1515x1145otherwise

(2)

See Also

CurveFitting

CurveFitting[Spline]

piecewise