characteristic polynomials



Hi,

In maxima 5.26.0 I found the following function.

 -- Function: ncharpoly (<M>, <x>)
    Returns the characteristic polynomial of the matrix <M> with
    respect to <x>.  This is an alternative to Maxima's `charpoly'.

However, its result do not coincide with that of `charpoly'.
Indeed one obtains:

(%i1) load ("nchrpl")&
(%i2) ncharpoly(ident(3),x);
(%o2) x^3-3*x^2+3*x-1;

while

(%i3) ratsimp(charpoly(ident(3),x));
(%o3) -x^3+3*x^2-3*x+1;

The reasion is that 'charpoly' defines the characteristic polynomial as

  det(A-xI)

while 'ncharpoly' defines it as

  det(xI-A)

Although this difference can be found when reading both help pages
carefully, this may be a trapdoor for some users. E.g., for my students 
it is a challenge to understand the concept of eigenvalues and
characteristic polynomials. So this subtle difference may be a problem.

I found function 'ncharpoly' as the Maxima help system reports that
"There are also some inexact matches for `charpoly'."
So my students will find that as well.

Is this difference intentional?
IMHO it want to suggest to change the help page and point out that
'ncharpoly' is not identical to 'charpoly'.
(As the word 'alternative' might suggest.)

with best wishes
Josef

-- 


-----------------------------------------------------------------------------
Josef Leydold   |  WU (Vienna University of Economics and Business)
                |  Institute for Statistics and Mathematics
-----------------------------------------------------------------------------
Augasse 2-6     |  Tel.   +43 1 31336 4695
A-1090 Vienna   |  FAX    +43 1 31336 774
European Union  |  email  josef.leydold at wu.ac.at
-----------------------------------------------------------------------------
Alles Unglueck kam daher, dass die Denkenden nicht mehr handeln konnten,
und die Handelnden keine Zeit mehr fanden zu denken.       (Marlen Haushofer)