Student[NumericalAnalysis]

 return an interpolated polynomial structure with a newly added point

Parameters

 p - a POLYINTERP structure pts - numeric, list(numeric, numeric), list(numeric, numeric,numeric); the new data point (node) to be added bcs - list(numeric, numeric); new boundary conditions for an interpolating polynomial created using the cubic spline method

Description

 • The AddPoint command takes the point(s) to be added and recomputes the interpolated polynomial from p with the new point(s) and returns the adjusted POLYINTERP structure.
 • This command is convenient because it prevents you from having to reenter all previous options and data with the new point into the PolynomialInterpolation command or the CubicSpline command to create a new POLYINTERP structure.
 • If the POLYINTERP structure was created using the CubicSpline command and the boundary conditions are not natural, then new boundary conditions bcs at the end points must be specified.

Notes

 • 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[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{p2}≔\mathrm{PolynomialInterpolation}\left(\mathrm{xy},\mathrm{method}=\mathrm{neville},\mathrm{extrapolate}=\left[1.5\right]\right):$
 > $\mathrm{NevilleTable}\left(\mathrm{p2},1.5\right)$
 $\left[\begin{array}{cccc}{0.7651977}& {0}& {0}& {0}\\ {0.6200860}& {0.5233448671}& {0}& {0}\\ {0.4554022}& {0.5102968002}& {0.5124714781}& {0}\\ {0.2818186}& {0.5132634002}& {0.5112856669}& {0.5118126939}\end{array}\right]$ (2)

 > $\mathrm{p2a}≔\mathrm{AddPoint}\left(\mathrm{p2},\left[2.2,0.1103623\right]\right):$

The Neville Table now has another row.

 > $\mathrm{NevilleTable}\left(\mathrm{p2a},1.5\right)$
 $\left[\begin{array}{ccccc}{0.7651977}& {0}& {0}& {0}& {0}\\ {0.6200860}& {0.5233448671}& {0}& {0}& {0}\\ {0.4554022}& {0.5102968002}& {0.5124714781}& {0}& {0}\\ {0.2818186}& {0.5132634002}& {0.5112856669}& {0.5118126939}& {0}\\ {0.1103623}& {0.5104270002}& {0.5137361336}& {0.5118302149}& {0.5118199942}\end{array}\right]$ (3)