spline - Maple Help

spline

compute a natural spline

 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

$\left\{\begin{array}{cc}{P}_{1}& z<{X}_{2}\\ {P}_{2}& z<{X}_{3}\\ {P}_{N}& ...\end{array}\right\$

 which is equivalent to

 if $z<{X}_{2}$ then ${P}_{1}$ elif $z<{X}_{3}$ then ${P}_{2}$ ... else ${P}_{N}$ end if

 where the $N=\mathrm{nops}\left(X\right)-1$ segment polynomials ${P}_{i}$ are of degree $\le d$.
 • The segment polynomials ${P}_{1},{P}_{2},\mathrm{...},{P}_{N}$ are uniquely given by the following $\left(d+1\right)N$ conditions
 1 $2N$ interpolating conditions${P}_{i}|z={X}_{i}={Y}_{i}$ and${P}_{i}|z={X}_{i+1}={Y}_{i+1}$, $i=1..N$
 2 $\left(d-1\right)\left(N-1\right)$ continuity conditions$\frac{{ⅆ}^{k}}{ⅆ{x}^{k}}{P}_{i}|z={X}_{i+1}=\frac{{ⅆ}^{k}}{ⅆ{x}^{k}}{P}_{i}|z={X}_{i+1}$, $i=1..N-1,k=1..d-1$
 3 $d-1$ additional conditions$\frac{{ⅆ}^{k}}{ⅆ{x}^{k}}{P}_{1}|z={X}_{1}=0$, $k=d-\mathrm{iquo}\left(d,2\right),\mathrm{...},d-1$, and$\frac{{ⅆ}^{k}}{ⅆ{x}^{k}}{P}_{N}|z={X}_{N+1}=0$, $k=d-\mathrm{iquo}\left(d-1,2\right),\mathrm{...},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

$\frac{{ⅆ}^{2}}{ⅆ{x}^{2}}{P}_{1}|z={X}_{1}=0anⅆ\frac{{ⅆ}^{2}}{ⅆ{x}^{2}}{P}_{N}|z={X}_{N+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].

 > $\mathrm{spline}\left(\left[0,1,2,3\right],\left[0,1,4,3\right],x,\mathrm{linear}\right)$
 $\left\{\begin{array}{cc}{x}& {x}{<}{1}\\ {-}{2}{+}{3}{}{x}& {x}{<}{2}\\ {6}{-}{x}& {\mathrm{otherwise}}\end{array}\right\$ (1)
 > $\mathrm{spline}\left(\left[0,1,2,3\right],\left[0,1,4,3\right],x,\mathrm{cubic}\right)$
 $\left\{\begin{array}{cc}\frac{{4}}{{5}}{}{{x}}^{{3}}{+}\frac{{1}}{{5}}{}{x}& {x}{<}{1}\\ {-}{2}{}{{x}}^{{3}}{+}\frac{{42}}{{5}}{}{{x}}^{{2}}{-}\frac{{41}}{{5}}{}{x}{+}\frac{{14}}{{5}}& {x}{<}{2}\\ \frac{{6}}{{5}}{}{{x}}^{{3}}{-}\frac{{54}}{{5}}{}{{x}}^{{2}}{+}\frac{{151}}{{5}}{}{x}{-}\frac{{114}}{{5}}& {\mathrm{otherwise}}\end{array}\right\$ (2)