Working with rational polynomials in Maple

In summary, the conversation discusses how to handle rational polynomials in Maple and specifically how to compute the Hermite normal form. One approach is to factor out the denominators and then get the Hermite form, while another involves using a unimodular matrix. The definition of the Hermite normal form and its application to polynomial matrices is also discussed.
  • #1
james1234
19
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
  • #2
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
 
  • #3
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
 
  • #4
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..?
 
  • #5
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
 
  • #6
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:

1. What is a rational polynomial in Maple?

A rational polynomial in Maple is an algebraic expression that involves a ratio of two polynomials. It can be written in the form of P(x) / Q(x), where P(x) and Q(x) are both polynomials.

2. How do I define a rational polynomial in Maple?

To define a rational polynomial in Maple, you can use the command "rationalpoly" followed by the numerator and denominator polynomials in parentheses. For example: rationalpoly(x^2 + 3, 2x + 5) will define the rational polynomial (x^2 + 3) / (2x + 5).

3. Can I perform operations on rational polynomials in Maple?

Yes, you can perform various operations such as addition, subtraction, multiplication, and division on rational polynomials in Maple. You can use the corresponding arithmetic operators (+, -, *, /) or the built-in functions "add", "sub", "mul", and "div".

4. How can I simplify a rational polynomial in Maple?

To simplify a rational polynomial in Maple, you can use the built-in function "simplify" followed by the expression in parentheses. This will reduce the rational polynomial to its simplest form.

5. Is there a way to graph rational polynomials in Maple?

Yes, you can graph rational polynomials in Maple using the command "plot" followed by the rational polynomial expression. This will plot the graph of the rational polynomial on a Cartesian coordinate system.

Similar threads

  • Calculus and Beyond Homework Help
Replies
11
Views
2K
  • Calculus and Beyond Homework Help
Replies
12
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
3K
  • Calculus and Beyond Homework Help
Replies
9
Views
14K
  • Differential Equations
Replies
2
Views
1K
Replies
4
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
Replies
6
Views
1K
Back
Top