Student[NumericalAnalysis]
Interpolant
return the interpolated polynomial from a POLYINTERP structure
Calling Sequence
Parameters
Options
Description
Notes
Examples
Interpolant(p, opts)
p
-
a POLYINTERP structure
opts
(optional) equations of the form keyword=value where keyword is independentvar; options for returning the interpolant
independentvar = name
A name for the independent variable in the polynomial. By default, the name given in the PolynomialInterpolation call is used.
The Interpolant command retrieves the interpolated polynomial from a POLYINTERP structure.
The POLYINTERP structure is created using the PolynomialInterpolation command or the CubicSpline command.
In order to perform an interpolation, the PolynomialInterpolation command or CubicSpline command is used first, where all options are chosen and the interpolation is performed. Then the Interpolant command can be used to extract the interpolating polynomial.
You may want to use the expand command to get the polynomial into a nicer form, since the Interpolant command returns the polynomial in factored form.
with⁡StudentNumericalAnalysis:
xy≔0,4.0,0.5,0,1.0,−2.0,1.5,0,2.0,1.0,2.5,0,3.0,−0.5
p1a≔PolynomialInterpolation⁡xy,function=22−x⁢cos⁡π⁢x,method=lagrange,extrapolate=0.25,0.75,1.25,errorboundvar=ξ:
p1b≔CubicSpline⁡xy,function=22−x⁢cos⁡π⁢x,extrapolate=0.25,0.75,1.25:
expand⁡Interpolant⁡p1a
−48.67222223⁢x2−1.022222222⁢x6+71.08333335⁢x3−41.05555556⁢x4+10.60000001⁢x5+4.000000000+3.066666669⁢x
expand⁡Interpolant⁡p1b
4.−8.48076923076923⁢x+1.92307692307692⁢x3x<0.5−5.13461538461539⁢x+3.44230769230769−6.69230769230769⁢x2+6.38461538461538⁢x3x<1.021.2884615384615−58.6730769230769⁢x+46.8461538461538⁢x2−11.4615384615385⁢x3x<1.515.0576923076923⁢x−15.5769230769231−2.30769230769231⁢x2−0.538461538461538⁢x3x<2.0−64.8076923076923+88.9038461538461⁢x−39.2307692307692⁢x2+5.61538461538461⁢x3x<2.5−52.4423076923077⁢x+52.9807692307692+17.3076923076923⁢x2−1.92307692307692⁢x3otherwise
xyy≔1,1.105170918,0.2210341836,1.5,1.252322716,0.3756968148,2,1.491824698,0.5967298792
p2≔PolynomialInterpolation⁡xyy,method=hermite,function=exp⁡0.1⁢x2,independentvar=x,errorboundvar=ξ,digits=5:
Interpolant⁡p2,independentvar=t
0.88417+0.22103⁢t+0.14634⁢t−1.2+0.033320⁢t−1.2⁢t−1.5+0.010280⁢t−1.2⁢t−1.52+0.0038400⁢t−1.2⁢t−1.52⁢t−2.
See Also
Student[NumericalAnalysis][AddPoint]
Student[NumericalAnalysis][BasisFunctions]
Student[NumericalAnalysis][ComputationOverview]
Student[NumericalAnalysis][CubicSpline]
Student[NumericalAnalysis][DataPoints]
Student[NumericalAnalysis][InterpolantRemainderTerm]
Student[NumericalAnalysis][PolynomialInterpolation]
Download Help Document