LagrangeBasis - Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : LagrangeBasis

LagrangeBasis

Lagrange polynomials on a set of nodes

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

LagrangeBasis(k, nodes, x)

Parameters

k

-

algebraic expression; the index

nodes

-

list of algebraic expressions; the nodes where the polynomial is known

x

-

algebraic expression; the argument

Description

• 

LagrangeBasisk,nodes,x=wkjkxnodesj defines the kth Lagrange polynomial of degree n which is either 1 or 0 on the given nodes. By convention, the nodes are indexed from 0, so nodes=x0,x1,...,xn , and the barycentric weights wk are defined as wk=jk1xkxj.

• 

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(<x-value>) , which uses the numerically stable barycentric form to evaluate the polynomial p.

Examples

nodes1&comma;13&comma;13&comma;1

nodes−1&comma;13&comma;13&comma;1

(1)

p3LagrangeBasis0&comma;nodes&comma;x&plus;5LagrangeBasis2&comma;nodes&comma;x&plus;7LagrangeBasis3&comma;nodes&comma;x

p3LagrangeBasis0&comma;−1&comma;13&comma;13&comma;1&comma;x+5LagrangeBasis2&comma;−1&comma;13&comma;13&comma;1&comma;x+7LagrangeBasis3&comma;−1&comma;13&comma;13&comma;1&comma;x

(2)

That polynomial has the value 3 at x=−1, the value 0 at x=13, the value 5 at x=13, and the value 7 at x=1.

Pconvertp&comma;MatrixPolynomialObject&comma;x

PRecordValue=Defaultvalue&comma;Variable=x&comma;Degree=3&comma;Coefficient=coe&comma;Dimension=1&comma;1&comma;Basis=LagrangeBasis&comma;BasisParameters=−1&comma;13&comma;13&comma;1&comma;IsMonic=mon&comma;OutputOptions=shape=&comma;storage=rectangular&comma;order=Fortran_order&comma;fill=0&comma;attributes=

(3)

P:-Degree

3

(4)

Note that the result returned by convert...,MatrixPolynomialObject represents a matrix polynomial; hence these results are 1 by 1 matrices.

seqP:-Valuenodesk1&comma;1&comma;k&equals;1..nopsnodes

3,0,5,7

(5)

P:-Value0.3

4.729812500

(6)

factorP:-Valuet1&comma;1

33t226t353t+116

(7)

See Also

BernsteinBasis

convert/MatrixPolynomialObject

LinearAlgebra[CompanionMatrix]

NewtonBasis

OrthogonalSeries

PochhammerBasis

type/MatrixPolynomialObject