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

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=nops⁡X−1 segment polynomials Pi are of degree ≤d.

• 

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

1. 

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

2. 

d−1⁢N−1 continuity conditions&DifferentialD;k&DifferentialD;xkPi|z=Xi+1=&DifferentialD;k&DifferentialD;xkPi|z=Xi+1, i=1..N−1,k=1..d−1

3. 

d−1 additional conditions&DifferentialD;k&DifferentialD;xkP1|z=X1=0, k=d−iquo⁡d&comma;2,...,d−1, and&DifferentialD;k&DifferentialD;xkPN|z=XN+1=0, k=d−iquo⁡d−1&comma;2,...,d−1.

  

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=0⁢an&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].

> 

spline⁡0&comma;1&comma;2&comma;3&comma;0&comma;1&comma;4&comma;3&comma;x&comma;linear

xx<1−2+3⁢xx<26−xotherwise

(1)
> 

spline⁡0&comma;1&comma;2&comma;3&comma;0&comma;1&comma;4&comma;3&comma;x&comma;cubic

45⁢x3+15⁢xx<1−2⁢x3+425⁢x2−415⁢x+145x<265⁢x3−545⁢x2+1515⁢x−1145otherwise

(2)

See Also

CurveFitting

CurveFitting[Spline]

piecewise