CurveFitting - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Numerical Computations : Interpolation and Curve Fitting : CurveFitting Package : CurveFitting/Spline

CurveFitting

  

Spline

  

compute a spline with specified end conditions

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Spline(xydata, v, dgr, endpts)

Spline(xdata, ydata, v, dgr, endpts)

Parameters

xydata

-

list, Array, or Matrix of the form [[x0,y0], [x1,y1], ..., [xn,yn]]; data points

v

-

name or numeric value

dgr

-

(optional) equation of the form degree=d where d is a positive integer

endpts

-

(optional) equation of the form endpoints=e where e is one of 'natural', 'notaknot', or 'periodic' or is a list, Array, Matrix, or Vector

xdata

-

list, Array, or Vector of the form [x0, x1, ..., xn]; independent values

ydata

-

list, Array, or Vector or the form [y0, y1, ..., yn]; dependent values

Description

• 

The Spline routine computes a degree d piecewise polynomial in variable v that approximates the points {x0,y0,x1,y1,...,xn,yn}.

  

If v is a numerical value, the value of the polynomial at this point returns.  The default value of d is 3; this can be changed by using the degree=d option.

• 

The intended purpose of the Spline function is to compute and return the piecewise formula of a spline interpolant.  To perform fast spline interpolation on numeric data, the CurveFitting[ArrayInterpolation] command should be used instead.

• 

By default, natural end conditions are used.  This can be changed by using the endpoints=e option.  For more details on the other types of end conditions available, see Spline Continuity and End Conditions.

• 

You can call the Spline routine in two ways.

  

The first, Spline(xydata, v, dgr, endpts), accepts a list, Array, or Matrix, [[x0,y0],[x1,y1],...,[xn,yn]], of data points.

  

The second, Spline(xdata, ydata, v, dgr, endpts), accepts two lists, two Arrays, or two Vectors. In this form, the first set of data contains the independent values, [x0,x1,...,xn], and the second set contains the dependent values, [y0,y1,...,yn].  Each element must be of type algebraic. All the independent values must be distinct.

• 

The result returned by the Spline routine is determined by the degree d.

  

If d is odd, the Spline routine returns a result in the form piecewisev<x1,p1,...,pn, where the n spline sections {p1,p2,...,pn} are polynomials of degree at most d.

  

If d is even, the routine defines the spline knots at the midpoints of the nodes, unless the knots=data option is specified. In the default case, the Spline routine returns a result in the form piecewisev<z1,p1,...,v<zn,pn,pn+1, where zi&equals;12xi1&plus;12xi, for i=1,2,...,n, and the n&plus;1 spline sections {p1,p2,...,pn+1} are polynomials of degree at most d. In the knots=data case, the result will have n spline sections and be of the form piecewisev<x1,p1,...,pn.

  

For more details on the formation of the piecewise polynomials and additional examples involving different end conditions, see the Spline Continuity and End Conditions help page.

• 

If a unique solution cannot be determined from the input data, a parametrized solution that uses parameters of the form a[i, j], where a is an automatically generated name, and i and j are integers, is returned.

• 

For greater efficiency in large problems, it is recommended that xdata and ydata be stored as Vectors using a float datatype.  For the degree 2 and degree 3 cases involving floating-point data only, the Spline command uses a more efficient algorithm that takes advantage of the external Numerical Algorithms Group (NAG) library for solving the resulting matrix equations.

Examples

withCurveFitting&colon;

Spline0&comma;0&comma;1&comma;1&comma;2&comma;4&comma;3&comma;3&comma;v

&lcub;45v3&plus;15vv<12v3&plus;425v2415v&plus;145v<265v3545v2&plus;1515v1145otherwise

(1)

Spline0&comma;0&comma;1&comma;5&comma;2&comma;1&comma;3&comma;0&comma;v&comma;degree&equals;2&comma;endpoints&equals;&apos;periodic&apos;

&lcub;165v2&plus;245vv<12445v2&plus;845v3v<32285v21325v&plus;1475v<52165v2725v&plus;725otherwise

(2)

Spline0&comma;1&comma;2&comma;3&comma;0&comma;1&comma;4&comma;3&comma;v&comma;degree&equals;1

&lcub;vv<12&plus;3vv<26votherwise

(3)

See Also

CurveFitting

CurveFitting[ArrayInterpolation]

diff

piecewise

Spline Continuity and End Conditions

type/algebraic

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam