Student/NumericalAnalysis/ApproximateValue - Help

Student[NumericalAnalysis]

 ApproximateValue
 return specific approximate value(s) of the interpolating polynomial

 Calling Sequence ApproximateValue(p) ApproximateValue(p, pts)

Parameters

 p - a POLYINTERP structure pts - (optional) numeric, list(numeric); a point or list of points at which the value of the approximating polynomial is to be computed

Description

 • The ApproximateValue command computes the value(s) of the approximated polynomial at specified point(s) pts or at the extrapolated point(s) from the POLYINTERP structure, depending on whether pts is specified or not.
 • The approximate values are returned in a list of the form [[$\mathrm{point}[i]$, ${\mathrm{approx}}_{i}$], [...], ...], $i$=$1..\mathrm{number}$ $\mathrm{of}$ $\mathrm{points}$.
 • The POLYINTERP structure is created using the PolynomialInterpolation command or the CubicSpline command.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{NumericalAnalysis}]\right):$
 > $\mathrm{xy}≔\left[\left[1.0,0.7651977\right],\left[1.3,0.6200860\right],\left[1.6,0.4554022\right],\left[1.9,0.2818186\right]\right]$
 ${\mathrm{xy}}{≔}\left[\left[{1.0}{,}{0.7651977}\right]{,}\left[{1.3}{,}{0.6200860}\right]{,}\left[{1.6}{,}{0.4554022}\right]{,}\left[{1.9}{,}{0.2818186}\right]\right]$ (1)
 > $\mathrm{p1}≔\mathrm{PolynomialInterpolation}\left(\mathrm{xy},\mathrm{method}=\mathrm{neville},\mathrm{extrapolate}=\left[1.5\right]\right):$
 > $\mathrm{ApproximateValue}\left(\mathrm{p1}\right)$
 $\left[\left[{1.5}{,}{0.5118126939}\right]\right]$ (2)
 > $\mathrm{ApproximateValue}\left(\mathrm{p1},\left[1.7,1.8\right]\right)$
 $\left[\left[{1.7}{,}{0.3980028398}\right]{,}\left[{1.8}{,}{0.3400098828}\right]\right]$ (3)
 > $\mathrm{xyy}≔\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{xyy}}{≔}\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]$ (4)
 > $\mathrm{p2}≔\mathrm{CubicSpline}\left(\mathrm{xyy},\mathrm{independentvar}='x'\right):$
 > $\mathrm{ApproximateValue}\left(\mathrm{p2},1.3\right)$
 $\left[\left[{1.3}{,}{0.8776545517}\right]\right]$ (5)