perform polynomial interpolation on a set of data - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Education : Student Package : Numerical Analysis : Computation : Student/NumericalAnalysis/PolynomialInterpolation

Student[NumericalAnalysis][PolynomialInterpolation] - perform polynomial interpolation on a set of data

 Calling Sequence PolynomialInterpolation(xy, opts)

Parameters

 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

Description

 • 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.

Notes

 • 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.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{NumericalAnalysis}]\right):$
 > $\mathrm{xy}:=\left[\left[0,1\right],\left[\frac{1}{2},1\right],\left[1,\frac{11}{10}\right],\left[\frac{3}{2},\frac{3}{4}\right],\left[2,\frac{7}{8}\right],\left[\frac{5}{2},\frac{9}{10}\right],\left[3,\frac{11}{10}\right],\left[\frac{7}{2},1\right]\right]$
 ${\mathrm{xy}}{:=}\left[\left[{0}{,}{1}\right]{,}\left[\frac{{1}}{{2}}{,}{1}\right]{,}\left[{1}{,}\frac{{11}}{{10}}\right]{,}\left[\frac{{3}}{{2}}{,}\frac{{3}}{{4}}\right]{,}\left[{2}{,}\frac{{7}}{{8}}\right]{,}\left[\frac{{5}}{{2}}{,}\frac{{9}}{{10}}\right]{,}\left[{3}{,}\frac{{11}}{{10}}\right]{,}\left[\frac{{7}}{{2}}{,}{1}\right]\right]$ (1)
 > $L:=\mathrm{PolynomialInterpolation}\left(\mathrm{xy},\mathrm{independentvar}=x,\mathrm{method}=\mathrm{lagrange}\right):$
 > $\mathrm{Nev}:=\mathrm{PolynomialInterpolation}\left(\mathrm{xy},\mathrm{independentvar}=x,\mathrm{method}=\mathrm{neville}\right):$
 > $\mathrm{New}:=\mathrm{PolynomialInterpolation}\left(\mathrm{xy},\mathrm{independentvar}=x,\mathrm{method}=\mathrm{newton}\right):$
 > $\mathrm{expand}\left(\mathrm{Interpolant}\left(L\right)\right)$
 ${1}{+}\frac{{2254}}{{75}}{}{{x}}^{{2}}{+}\frac{{733}}{{20}}{}{{x}}^{{4}}{-}\frac{{3296}}{{225}}{}{{x}}^{{5}}{+}\frac{{221}}{{75}}{}{{x}}^{{6}}{-}\frac{{53}}{{225}}{}{{x}}^{{7}}{-}\frac{{172247}}{{3600}}{}{{x}}^{{3}}{-}\frac{{8183}}{{1200}}{}{x}$ (2)
 > $\mathrm{expand}\left(\mathrm{Interpolant}\left(\mathrm{Nev}\right)\right)$
 ${1}{+}\frac{{2254}}{{75}}{}{{x}}^{{2}}{+}\frac{{733}}{{20}}{}{{x}}^{{4}}{-}\frac{{3296}}{{225}}{}{{x}}^{{5}}{+}\frac{{221}}{{75}}{}{{x}}^{{6}}{-}\frac{{53}}{{225}}{}{{x}}^{{7}}{-}\frac{{172247}}{{3600}}{}{{x}}^{{3}}{-}\frac{{8183}}{{1200}}{}{x}$ (3)
 > $\mathrm{expand}\left(\mathrm{Interpolant}\left(\mathrm{New}\right)\right)$
 ${1}{+}\frac{{2254}}{{75}}{}{{x}}^{{2}}{+}\frac{{733}}{{20}}{}{{x}}^{{4}}{-}\frac{{3296}}{{225}}{}{{x}}^{{5}}{+}\frac{{221}}{{75}}{}{{x}}^{{6}}{-}\frac{{53}}{{225}}{}{{x}}^{{7}}{-}\frac{{172247}}{{3600}}{}{{x}}^{{3}}{-}\frac{{8183}}{{1200}}{}{x}$ (4)
 > $\mathrm{xyyp}:=\left[\left[1,1.105170918,0.2210341836\right],\left[1.5,1.252322716,0.3756968148\right],\left[2,1.491824698,0.5967298792\right]\right]$
 ${\mathrm{xyyp}}{:=}\left[\left[{1}{,}{1.105170918}{,}{0.2210341836}\right]{,}\left[{1.5}{,}{1.252322716}{,}{0.3756968148}\right]{,}\left[{2}{,}{1.491824698}{,}{0.5967298792}\right]\right]$ (5)
 > $\mathrm{p2}:=\mathrm{PolynomialInterpolation}\left(\mathrm{xyyp},\mathrm{method}=\mathrm{hermite},\mathrm{function}={ⅇ}^{0.1{x}^{2}},\mathrm{independentvar}=x,\mathrm{errorboundvar}=\mathrm{ξ},\mathrm{digits}=5\right):$
 > $\mathrm{RemainderTerm}\left(\mathrm{p2}\right)$
 $\left(\frac{{1}}{{720}}{}\left({0.120}{}{{ⅇ}}^{{0.1}{}{{\mathrm{ξ}}}^{{2}}}{+}{0.0720}{}{{\mathrm{ξ}}}^{{2}}{}{{ⅇ}}^{{0.1}{}{{\mathrm{ξ}}}^{{2}}}{+}{0.00480}{}{{\mathrm{ξ}}}^{{4}}{}{{ⅇ}}^{{0.1}{}{{\mathrm{ξ}}}^{{2}}}{+}{0.000064}{}{{\mathrm{ξ}}}^{{6}}{}{{ⅇ}}^{{0.1}{}{{\mathrm{ξ}}}^{{2}}}\right){}{\left({x}{-}{1.}\right)}^{{2}}{}{\left({x}{-}{1.5}\right)}^{{2}}{}{\left({x}{-}{2.}\right)}^{{2}}\right){&where}\left\{{1.}{\le }{\mathrm{ξ}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{and}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{ξ}}{\le }{2.}\right\}$ (6)
 > $\mathrm{DividedDifferenceTable}\left(\mathrm{p2}\right)$
 $\left[\begin{array}{cccccc}{1.1052}& {0}& {0}& {0}& {0}& {0}\\ {1.1052}& {0.22103}& {0}& {0}& {0}& {0}\\ {1.2523}& {0.29420}& {0.14634}& {0}& {0}& {0}\\ {1.2523}& {0.37570}& {0.16300}& {0.033320}& {0}& {0}\\ {1.4918}& {0.47900}& {0.20660}& {0.043600}& {0.010280}& {0}\\ {1.4918}& {0.59673}& {0.23546}& {0.057720}& {0.014120}& {0.0038400}\end{array}\right]$ (7)
 > $\mathrm{Draw}\left(\mathrm{p2}\right)$

## Was this information helpful?

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