NewtonBasis - Help

NewtonBasis

Newton polynomials on a set of nodes

 Calling Sequence NewtonBasis(k, nodes, x)

Parameters

 k - algebraic expression; the index nodes - list of algebraic expressions; nodes where the polynomial is known x - algebraic expression; the argument

Description

 • The $k$th Newton polynomial of degree $k$ is defined by

$\mathrm{NewtonBasis}\left(k,\mathrm{nodes},x\right)=\prod _{j=0}^{k-1}\left(x-{\mathrm{nodes}}_{j}\right)$

 By convention, the nodes are indexed from $0$, so $\mathrm{nodes}=[\mathrm{x0},\mathrm{x1},...,\mathrm{xn}]$.
 • At present, this can only be evaluated in Maple by prior use of the object-oriented representation obtained by P:=convert(p,MatrixPolynomialObject,x) and subsequent call to P:-Value(), which uses Horner's method to evaluate the polynomial $p$.

Examples

 > $\mathrm{nodes}≔\left[-1,-\frac{1}{3},\frac{1}{3},1\right]$
 ${\mathrm{nodes}}{≔}\left[{-1}{,}{-}\frac{{1}}{{3}}{,}\frac{{1}}{{3}}{,}{1}\right]$ (1)
 > $p≔3\mathrm{NewtonBasis}\left(0,\mathrm{nodes},x\right)+5\mathrm{NewtonBasis}\left(2,\mathrm{nodes},x\right)+7\mathrm{NewtonBasis}\left(3,\mathrm{nodes},x\right)$
 ${p}{≔}{3}{}{\mathrm{NewtonBasis}}{}\left({0}{,}\left[{-1}{,}{-}\frac{{1}}{{3}}{,}\frac{{1}}{{3}}{,}{1}\right]{,}{x}\right){+}{5}{}{\mathrm{NewtonBasis}}{}\left({2}{,}\left[{-1}{,}{-}\frac{{1}}{{3}}{,}\frac{{1}}{{3}}{,}{1}\right]{,}{x}\right){+}{7}{}{\mathrm{NewtonBasis}}{}\left({3}{,}\left[{-1}{,}{-}\frac{{1}}{{3}}{,}\frac{{1}}{{3}}{,}{1}\right]{,}{x}\right)$ (2)

The coefficients of that polynomial can be interpreted in terms of divided differences of the values of $p$ at the nodes.

 > $P≔\mathrm{convert}\left(p,\mathrm{MatrixPolynomialObject},x\right)$
 ${P}{≔}{\mathrm{Record}}{}\left({\mathrm{Value}}{=}{{\mathrm{Default}}}_{{\mathrm{value}}}{,}{\mathrm{Variable}}{=}{x}{,}{\mathrm{Degree}}{=}{3}{,}{\mathrm{Coefficient}}{=}{\mathrm{coe}}{,}{\mathrm{Dimension}}{=}\left[{1}{,}{1}\right]{,}{\mathrm{Basis}}{=}{\mathrm{NewtonBasis}}{,}{\mathrm{BasisParameters}}{=}\left[\left[{-1}{,}{-}\frac{{1}}{{3}}{,}\frac{{1}}{{3}}{,}{1}\right]\right]{,}{\mathrm{IsMonic}}{=}{\mathrm{mon}}{,}{\mathrm{OutputOptions}}{=}\left[{\mathrm{shape}}{=}\left[\right]{,}{\mathrm{storage}}{=}{\mathrm{rectangular}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}{,}{\mathrm{fill}}{=}{0}{,}{\mathrm{attributes}}{=}\left[\right]\right]\right)$ (3)
 > $P:-\mathrm{Degree}\left(\right)$
 ${3}$ (4)

Note that the result returned by $\mathrm{convert}\left(...,\mathrm{MatrixPolynomialObject}\right)$ represents a matrix polynomial; hence these results are 1 by 1 matrices.

 > $\mathrm{seq}\left({P:-\mathrm{Value}\left({\mathrm{nodes}}_{k}\right)}_{1,1},k=1..\mathrm{nops}\left(\mathrm{nodes}\right)\right)$
 ${3}{,}{3}{,}\frac{{67}}{{9}}{,}\frac{{259}}{{9}}$ (5)
 > $P:-\mathrm{Value}\left(0.3\right)$
 $\left[\begin{array}{c}{6.924555556}\end{array}\right]$ (6)
 > $\mathrm{factor}\left({P:-\mathrm{Value}\left(t\right)}_{1,1}\right)$
 ${7}{}{{t}}^{{3}}{+}{12}{}{{t}}^{{2}}{+}\frac{{53}}{{9}}{}{t}{+}\frac{{35}}{{9}}$ (7)