type/MatrixPolynomialObject - Help

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+1ChebyshevTk,xk+2,k=0..5

p12ChebyshevT0,x+23ChebyshevT1,x+34ChebyshevT2,x+45ChebyshevT3,x+56ChebyshevT4,x+67ChebyshevT5,x

(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

nodes1,13,13,1

(6)

values1,1,1,1

values1,1,1,1

(7)

Pconvertvalues,MatrixPolynomialObject,nodes

PRecordValue=Defaultvalue,Variable=_X0,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

pinterp916t+13t13t1+2716t+1t13t1+2716t+1t+13t1+916t+1t+13t13

(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)

paddk3BernsteinBasisk,N,0,1,xk+1,k=0..N

p12BernsteinBasis1,4,0,1,x+83BernsteinBasis2,4,0,1,x+274BernsteinBasis3,4,0,1,x+645BernsteinBasis4,4,0,1,x

(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,C1LinearAlgebra[CompanionMatrix]P,x

C0,C100001001201083001274,40001320120123830017120

(19)

ELinearAlgebra[Eigenvalues]evalfC0,evalfC1

E10.0659400730377+0.I4.86159366800340+0.I0.204346405034140+0.I0.+0.I

(20)

mapt→P:-Valuet1,1,E

9.3677954282611610-111.0004441719502210-111.1102230246251610-160.

(21)

A matrix polynomial example.

A0,A1,A2LinearAlgebra[RandomMatrix]3,3,LinearAlgebra[RandomMatrix]3,3,LinearAlgebra[RandomMatrix]3,3

A0,A1,A27482946944279992,98277277932577632,94518508187223833

(22)

nodes1,0,1

nodes1,0,1

(23)

PconvertA0,A1,A2,MatrixPolynomialObject,nodes

PRecordValue=Defaultvalue,Variable=_X3,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.505000000000072.074999999999979.3999999999999107.67000000000010.525000000000044.744999999999986.964999999999932.3450000000000

(25)

C0,C1LinearAlgebra[CompanionMatrix]P,dummy

C0,C1 12 x 12 MatrixData Type: anythingStorage: rectangularOrder: Fortran_order, 12 x 12 MatrixData Type: anythingStorage: rectangularOrder: Fortran_order

(26)

See Also

BernsteinBasis

ChebyshevT

ChebyshevU

GegenbauerC

JacobiP

LagrangeBasis

LinearAlgebra[CompanionMatrix]

Matrix

NewtonBasis

OrthogonalSeries

PochhammerBasis

Record