Student[NumericalAnalysis]
PolynomialInterpolation
perform polynomial interpolation on a set of data
Calling Sequence
Parameters
Options
Description
Notes
Examples
PolynomialInterpolation(xy, opts)
xy
-
list(numeric), list(list(numeric, numeric)), list(list(numeric, numeric, numeric)); the data points to be interpolated
opts
equation(s) of the form keyword=value where keyword is one of digits, errorboundvar, extrapolate, function, independentvar, method; the options for interpolating the data xy
digits = posint
A positive integer; the environment variable Digits will be set to this integer during the execution of this procedure. By default, digits = 10.
errorboundvar = name
The name to assign to the variable in the errorbound term.
extrapolate = algebraic, list(algebraic)
The points to be extrapolated. By default no points are extrapolated. To see the extrapolated values after using the PolynomialInterpolation command, use the ExactValue or ApproximateValue command.
function = algebraic
The exact function to use when computing the absolute error. If only the x data is given in xy, the function must be specified by the user, or an exception will be raised. By default, no function is used.
independentvar = name
The name to assign to the independent variable in the interpolant. If independentvar is not specified, the independent variable in function will be used. If function and independentvar are both unspecified, ind_var will be used as the independent variable in the interpolant.
method = hermite, lagrange, neville, newton
The method to use when performing the polynomial interpolation.
hermite : Hermite Interpolation; this method requires xy to be in the form [[x1, y1, p1], [x2, y2, p2],...].
lagrange : Lagrange Form Interpolation
neville : Neville's Algorithm
newton : Newton Interpolation
If no method is specified by the user, the Lagrange method will be used. However, if xy is of the form list(numeric, numeric, numeric) and the user does not specify a method, the Hermite method will be used.
The PolynomialInterpolation command interpolates the given data points xy and stores all computed information in a POLYINTERP structure.
The POLYINTERP structure is then passed around to different interpolation commands in the Student[NumericalAnalysis] subpackage where information can be extracted from it and, depending on the command, manipulated. To see a list of commands that accept a POLYINTERP structure, see Interpolation in the Glossary of Commands.
When the Hermite method is used to perform interpolation, xy must be of the form list(list(numeric, numeric, numeric)).
This procedure operates numerically; that is, inputs that are not numeric are first evaluated to floating-point numbers before computations proceed.
with⁡StudentNumericalAnalysis:
xy≔0,1,12,1,1,1110,32,34,2,78,52,910,3,1110,72,1
L≔PolynomialInterpolation⁡xy,independentvar=x,method=lagrange:
Nev≔PolynomialInterpolation⁡xy,independentvar=x,method=neville:
New≔PolynomialInterpolation⁡xy,independentvar=x,method=newton:
expand⁡Interpolant⁡L
1+22175⁢x6−53225⁢x7−1722473600⁢x3+73320⁢x4−3296225⁢x5+225475⁢x2−81831200⁢x
expand⁡Interpolant⁡Nev
expand⁡Interpolant⁡New
xyyp≔1,1.105170918,0.2210341836,1.5,1.252322716,0.3756968148,2,1.491824698,0.5967298792
p2≔PolynomialInterpolation⁡xyyp,method=hermite,function=exp⁡0.1⁢x2,independentvar=x,errorboundvar=ξ,digits=5:
RemainderTerm⁡p2
0.120⁢ⅇ0.1⁢ξ2+0.0720⁢ξ2⁢ⅇ0.1⁢ξ2+0.00480⁢ξ4⁢ⅇ0.1⁢ξ2+0.000064⁢ξ6⁢ⅇ0.1⁢ξ2⁢x−1.2⁢x−1.52⁢x−2.2720&where1.≤ξ≤2.
DividedDifferenceTable⁡p2
1.1052000001.10520.2210300001.25230.294200.146340001.25230.375700.163000.033320001.49180.479000.206600.0436000.01028001.49180.596730.235460.0577200.0141200.0038400
Draw⁡p2
See Also
Glossary of Commands
Student[NumericalAnalysis][AddPoint]
Student[NumericalAnalysis][BasisFunctions]
Student[NumericalAnalysis][ComputationOverview]
Student[NumericalAnalysis][CubicSpline]
Student[NumericalAnalysis][DataPoints]
Student[NumericalAnalysis][ExactValue]
Student[NumericalAnalysis][InterpolantRemainderTerm]
Download Help Document