type/MatrixPolynomialObject - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : type/MatrixPolynomialObject

convert/MatrixPolynomialObject

convert a matrix polynomial or scalar polynomial to a standard internal representation

type/MatrixPolynomialObject

test for a MatrixPolynomialObject

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

convert(p, MatrixPolynomialObject, x)

convert(values, MatrixPolynomialObject, nodes)

type(expr, MatrixPolynomialObject, x)

Parameters

p

-

polynomial expressed in any of a number of polynomial bases

x

-

name; the variable for the polynomial

values

-

list of values of the (matrix or scalar) polynomial p at the (distinct) nodes

nodes

-

list of algebraic expressions representing distinct scalar nodes

expr

-

arbitrary Maple object

Description

• 

The convert(p, MatrixPolynomialObject, x) function converts the (matrix or scalar) polynomial p into a standard representation, a Record. This allows systematic (conventional) access to the polynomial properties, such as Degree, in a manner independent of the polynomial basis.  The bases understood by MatrixPolynomialObject include:

BernsteinBasis

ChebyshevT

ChebyshevU

GegenbauerC

JacobiP

LagrangeBasis

NewtonBasis

PochhammerBasis

 

  

and most others understood by the OrthogonalSeries package.  This routine is used internally by LinearAlgebra[CompanionMatrix].

• 

If the input polynomial p contains more than one basis, then this (heuristic) conversion will fail.

• 

The type(expr, MatrixPolynomialObject) function checks whether expr is a Record of the type returned by convert(...,MatrixPolynomialObject).

• 

A MatrixPolynomialObject record has the following fields:

  

Basis - the name of the basis used; either PowerBasis or any of the supported basis names listed above.

  

BasisParameters - a list of the parameters of the particular basis; e.g. for LagrangeBasis or NewtonBasis these are the nodes; for BernsteinBasis these are the degree n and the left and right ends a and b of the interval.

  

Coefficient - a procedure to return a specific coefficient matrix. It takes as argument a nonnegative integer less or equal to Degree and returns a Matrix.

  

Degree - a nonnegative integer; the degree of the polynomial (in the LagrangeBasis or BernsteinBasis case, an upper bound on the degree).

  

Dimension - a positive integer; the matrix dimension s of the matrix polynomial (s=1 if the original polynomial is a scalar polynomial).

  

IsMonic - a procedure without arguments returning true or false, depending on whether the polynomial is known to be monic (not relevant for Lagrange or Bernstein bases).

  

OutputOptions - a list of output options for the coefficient Matrices (see MatrixOptions).

  

Value - a procedure to evaluate the polynomial at any point. It takes as an argument the point (an algebraic expression) and returns a Matrix.

  

Variable - a name; the original variable used to define the polynomial (which may be unspecified in the LagrangeBasis case).

Examples

paddk+1k+2ChebyshevTk,x,k=0..5

pChebyshevT0,x2+2ChebyshevT1,x3+3ChebyshevT2,x4+4ChebyshevT3,x5+5ChebyshevT4,x6+6ChebyshevT5,x7

(1)

Pconvertp,MatrixPolynomialObject,x

PRecordValue=Defaultvalue,Variable=x,Degree=5,Coefficient=coe,Dimension=1,1,Basis=ChebyshevT,BasisParameters=,IsMonic=mon,OutputOptions=shape=,storage=rectangular,order=Fortran_order,fill=0,attributes=

(2)

P:-Degree

5

(3)

P:-Dimension

1,1

(4)

P:-Value0.3

0.5949161905

(5)

Lagrange basis.

nodes1,13,13,1

nodes−1,13,13,1

(6)

values1,1,1,1

values−1,1,−1,1

(7)

Pconvertvalues,MatrixPolynomialObject,nodes

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

(8)

P:-Degree

3

(9)

P:-Value0.3

−0.9284999999

(10)

pinterpCurveFitting:-PolynomialInterpolationnodes,values,t,form=Lagrange

pinterp9t+13t13t116+27t+1t13t116+27t+1t+13t116+9t+1t+13t1316

(11)

normalpinterpP:-Valuet1,1

1

(12)

Bernstein Basis: note that the zeros of p are the eigenvalues of the companion matrix pencil of p.

N4

N4

(13)

paddk3k+1BernsteinBasisk,N,0,1,x,k=0..N

pBernsteinBasis1,4,0,1,x2+8BernsteinBasis2,4,0,1,x3+27BernsteinBasis3,4,0,1,x4+64BernsteinBasis4,4,0,1,x5

(14)

Pconvertp,MatrixPolynomialObject,x

PRecordValue=Defaultvalue,Variable=x,Degree=4,Coefficient=coe,Dimension=1,1,Basis=BernsteinBasis,BasisParameters=4,0,1,IsMonic=mon,OutputOptions=shape=,storage=rectangular,order=Fortran_order,fill=0,attributes=

(15)

typeP,MatrixPolynomialObject

true

(16)

DigitstruncevalhfDigits

Digits15

(17)

P:-Value0.3

1.52538000000000

(18)

C0,C1LinearAlgebraCompanionMatrixP,x

C0,C100001001201083001274,40001320120123830017120

(19)

ELinearAlgebraEigenvaluesevalfC0,evalfC1

E10.0659400730376+0.I−4.86159366800337+0.I−0.204346405034140+0.I0.+0.I

(20)

mapt→P:-Valuet1,1,E

−6.54979459837233×10−11−6.43295475392105×10−121.00075642936163×10−160.

(21)

A matrix polynomial example.

A0,A1,A2LinearAlgebraRandomMatrix3,3,LinearAlgebraRandomMatrix3,3,LinearAlgebraRandomMatrix3,3

A0,A1,A2−74829−46944279992,−9827−72−77−93−257−76−32,−945−18−50−8187−22−3833

(22)

nodes1,0,1

nodes−1,0,1

(23)

PconvertA0,A1,A2,MatrixPolynomialObject,nodes

PRecordValue=Defaultvalue,Variable=_X4,Degree=2,Coefficient=coe,Dimension=3,3,Basis=LagrangeBasis,BasisParameters=−1,0,1,IsMonic=mon,OutputOptions=shape=,storage=rectangular,order=Fortran_order,fill=0,attributes=

(24)

P:-Value0.3

−83.164999999999932.5050000000000−72.0749999999999−79.3999999999999−107.67000000000010.525000000000044.7450000000000−86.9649999999999−32.3450000000000

(25)

C0,C1LinearAlgebraCompanionMatrixP,dummy

See Also

BernsteinBasis

ChebyshevT

ChebyshevU

GegenbauerC

JacobiP

LagrangeBasis

LinearAlgebra[CompanionMatrix]

Matrix

NewtonBasis

OrthogonalSeries

PochhammerBasis

Record