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

 > nodes := [-1,-1/3,1/3,1];
 ${\mathrm{nodes}}{≔}\left[{-1}{,}{-}\frac{{1}}{{3}}{,}\frac{{1}}{{3}}{,}{1}\right]$ (1)
 > p := 3*NewtonBasis(0,nodes,x) + 5*NewtonBasis(2,nodes,x) + 7*NewtonBasis(3,nodes,x);
 ${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 := convert( p, MatrixPolynomialObject, x );
 ${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:-Degree();
 ${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.

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