Working with rational polynomials in Maple

Click For Summary

Homework Help Overview

The discussion revolves around handling rational polynomials in Maple, specifically in the context of matrices. The original poster describes encountering an error when attempting to compute the Hermite form of a matrix of rational polynomials, expressing confusion over the expected input type for the function.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants explore methods to address the error encountered in Maple, including factoring out denominators and using the least common multiple of denominators to create a new matrix for Hermite form calculations. Questions arise regarding the definition and application of Hermite normal form to rational polynomial matrices versus polynomial matrices.

Discussion Status

Several participants have offered insights and alternative approaches to the problem, including suggestions for automating the process of finding the least common multiple of denominators. There is an ongoing exploration of definitions and interpretations of Hermite normal form, with references to external texts and papers provided for further context.

Contextual Notes

Participants note the complexity of working with larger matrices and the limitations of Maple in handling rational polynomial matrices. There is also mention of differing definitions of Hermite normal form in literature, which may affect the understanding of the problem at hand.

james1234
Messages
19
Reaction score
0
Hi

Could someone please explain how to best handle rational polynomials in Maple?
I have matrix of rational polynomials and for some reason Maple keeps grumbling
i.e.
"error, (in, linearalgebra:- HermiteForm) expecting a matrix of rational polynomials"

The matrix I am working with is of the form (lets assume for simplicity its a 2x2)

with(LinearAlgebra); with(MatrixPolynomialAlgebra)
TF :=Matrix(2, 2, [a/s^2, -b/(s^2+1), c/(s^2+d), c/(s^2+d)]).
% just for good measure
M := convert(evalf(TF, 5), rational)
H := HermiteForm[column](M, s)

where a, b, c, d are rational numbers

Now each of the elements of the matrix are rational polynomials so I fail to see the issue. I need to be able to work with matrices in this form in maple/matlab/Magma as its no longer practical to continue to solve these probs by hand, especially for the larger matrices.

Would really appreciate any pointers
 
Physics news on Phys.org
james1234 said:
Hi

Could someone please explain how to best handle rational polynomials in Maple?
I have matrix of rational polynomials and for some reason Maple keeps grumbling
i.e.
"error, (in, linearalgebra:- HermiteForm) expecting a matrix of rational polynomials"

The matrix I am working with is of the form (lets assume for simplicity its a 2x2)

with(LinearAlgebra); with(MatrixPolynomialAlgebra)
TF :=Matrix(2, 2, [a/s^2, -b/(s^2+1), c/(s^2+d), c/(s^2+d)]).
% just for good measure
M := convert(evalf(TF, 5), rational)
H := HermiteForm[column](M, s)

where a, b, c, d are rational numbers

Now each of the elements of the matrix are rational polynomials so I fail to see the issue. I need to be able to work with matrices in this form in maple/matlab/Magma as its no longer practical to continue to solve these probs by hand, especially for the larger matrices.

Would really appreciate any pointers

If you look at the help entry on HermiteForm you will see that the matrix M is assumed to be a polynomial in s (although the answer may well contain rational polynomials in s). One way around the problem is to factor out the denominators, by looking at N = s^2*(s^2+1)*(s^2+d)*M, then getting its HermiteForm. Presumably, since N and M differ by an overall polynomial, you can then get the HermiteForm of M in terms of that of N. This works well in Maple 9.5 although, for some reason, N as defined above prints out as a matrix without actually being a matrix; it is necessary to look at N1 = <<N[1,1]|N[1,2]>,<N[2,1]|N[2,2]>> and then do HermiteForm[column](N1,s). I haven't tried it on higher versions of Maple.

RGV
 
I tried it in Maple 11 and the simple form N = f*M works, where f = least common multiple of all denominators in M. To automate the procedure, you can do this: f = 1; for i from 1 to n do for j from 1 to n do f:=lcm(f,denom(simplify(M[i,j]))): end do: end do: Then take N:=f*M. Now you can do Hn:=HermiteForm(N,s) with no difficulty (except maybe for very large and time-consuming calculations). I guess once you have N, you can get the Hermite form of M as Hm = Hn/f.

RGV
 
Hi Ray,

Thanks for your help!
From what I understand the right hermite normal form is actually determined based on the relative degree of the respective elements (rational entries). i.e. the column operations are performed to reduce the relative degree of the lower triangular entries and insure that the upper triangular entries are zero

Clearly Maple applies a different definition..?
 
james1234 said:
Hi Ray,

Thanks for your help!
From what I understand the right hermite normal form is actually determined based on the relative degree of the respective elements (rational entries). i.e. the column operations are performed to reduce the relative degree of the lower triangular entries and insure that the upper triangular entries are zero

Clearly Maple applies a different definition..?

As far as I have been able to find out in books, notes, etc., the Hermite normal form applies to *polynomial* matrices (not to rational polynomial matrices?) Could you cite a reference to this more general form of Hermite?

RGV
 
Yes certainly,
Bodson's text "Adaptive control: stability convergence and robustness" briefly describes the form of the right (column) Hermite normal form on page 284 of the following link
http://www.ece.utah.edu/~bodson/acscr/

where the hermite normal form is defined by P(s)=H(s)U(s) with unimodular matrix U. P(s) is in this instance defined as a square matrix whose elements are rational functions of s with real coefficients (page 278) i.e. is a transfer function matrix of proper polynomials.

If your interested in the right hermite forms you may like to have a look at page 621 of this paper http://www.cs.ucf.edu/~qu/J39.pdf
It provides some steps for computing the right hermite normal form which is great..
However, computing the hermite using these steps on a very simple example I have my doubts about the resultant matrix. I would have expected the resultant matrix to be a lower triangular not diagonal (I don't think the system is decoupled?)

For instance assume P(s) = Matrix(2,2 [2.806*s^2, -2.806*s^2, .3946/(s^2+1.192), .3946/(s^2+1.192)])
the solution would appear to be H(s) = Matrix(2,2[2.806*x^2, 0, 0, .3946/(s^2+1.192)]) for which U(s) is indeed unimodular (U = U1*U2 = [1, 1; 0, 1]*[1, 0; -.5, .5]) i.e. has a non-zero constant determinant.

However, the definition seems to indicate that the numerator of each element should be unity? There is a formal discussion on how one might choose the factors for the column operations required to calculate the hermite in Raghuvansh Prasad Singh's thesis entitled "Stable multivariable adaptive control systems" however the concepts of euclidean domains, and polynomial rings escape me..

Bit of a journal; apologies, got a little carried away.

thanks again Ray for the Maple code snippets in the prior post. I'm new to maple so it was much appreciated.

 
Last edited by a moderator:

Similar threads

  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 9 ·
Replies
9
Views
15K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
15
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 2 ·
Replies
2
Views
4K