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

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

> 

p≔add⁡k+1k+2⁢ChebyshevT⁡k,x,k=0..5

p≔ChebyshevT⁡0,x2+2⁢ChebyshevT⁡1,x3+3⁢ChebyshevT⁡2,x4+4⁢ChebyshevT⁡3,x5+5⁢ChebyshevT⁡4,x6+6⁢ChebyshevT⁡5,x7

(1)
> 

P≔convert⁡p,MatrixPolynomialObject,x

P≔Record⁡Value=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:-Value⁡0.3

0.5949161905

(5)

Lagrange basis.

> 

nodes≔−1,−13,13,1

nodes≔−1,−13,13,1

(6)
> 

values≔−1,1,−1,1

values≔−1,1,−1,1

(7)
> 

P≔convert⁡values,MatrixPolynomialObject,nodes

P≔Record⁡Value=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:-Value⁡0.3

−0.9284999999

(10)
> 

pinterp≔CurveFitting:-PolynomialInterpolation⁡nodes,values,t,form=Lagrange

pinterp≔9⁢t+13⁢t−13⁢t−116+27⁢t+1⁢t−13⁢t−116+27⁢t+1⁢t+13⁢t−116+9⁢t+1⁢t+13⁢t−1316

(11)
> 

normal⁡pinterpP:-Value⁡t1,1

1

(12)

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

> 

N≔4

N≔4

(13)
> 

p≔add⁡k3k+1⁢BernsteinBasis⁡k,N,0,1,x,k=0..N

p≔BernsteinBasis⁡1,4,0,1,x2+8⁢BernsteinBasis⁡2,4,0,1,x3+27⁢BernsteinBasis⁡3,4,0,1,x4+64⁢BernsteinBasis⁡4,4,0,1,x5

(14)
> 

P≔convert⁡p,MatrixPolynomialObject,x

P≔Record⁡Value=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)
> 

type⁡P,MatrixPolynomialObject

true

(16)
> 

Digits≔trunc⁡evalhf⁡Digits

Digits≔15

(17)
> 

P:-Value⁡0.3

1.52538000000000

(18)
> 

C0,C1≔LinearAlgebraCompanionMatrix⁡P,x

C0,C1≔0000100−12010−83001−274,40001320−120123−83001−7120

(19)
> 

E≔LinearAlgebraEigenvalues⁡evalf⁡C0,evalf⁡C1

E≔10.0659400730377+0.⁢I−4.86159366800340+0.⁢I−0.204346405034140+0.⁢I0.+0.⁢I

(20)
> 

map⁡t→P:-Value⁡t1,1,E

−9.36779542826116×10−11−1.00044417195022×10−11−1.11022302462516×10−160.

(21)

A matrix polynomial example.

> 

A0,A1,A2≔LinearAlgebraRandomMatrix⁡3,3,LinearAlgebraRandomMatrix⁡3,3,LinearAlgebraRandomMatrix⁡3,3

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

(22)
> 

nodes≔−1,0,1

nodes≔−1,0,1

(23)
> 

P≔convert⁡A0,A1,A2,MatrixPolynomialObject,nodes

P≔Record⁡Value=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:-Value⁡0.3

−83.164999999999932.5050000000000−72.0749999999999−79.3999999999999−107.67000000000010.525000000000044.7449999999999−86.9649999999999−32.3450000000000

(25)
> 

C0,C1≔LinearAlgebraCompanionMatrix⁡P,dummy

C0,C1≔10000000074…010000000−8…001000000−29…00000000098…000000000−27…00000000072…000000−1009…0000000−10−45…00000000−118…1200−10012000…⋮⋮⋮⋮⋮⋮⋮⋮⋮⋮12 × 12 Matrix,−1000000000…0−100000000…00−10000000…000−1000000…0000−100000…00000−10000…000000−1000…0000000−100…00000000−10…0000000000…⋮⋮⋮⋮⋮⋮⋮⋮⋮⋮12 × 12 Matrix

(26)

See Also

BernsteinBasis

ChebyshevT

ChebyshevU

GegenbauerC

JacobiP

LagrangeBasis

LinearAlgebra[CompanionMatrix]

Matrix

NewtonBasis

OrthogonalSeries

PochhammerBasis

Record