Previous Page Next Page Contents

linalg::charpoly -- characteristic polynomial of a matrix

Introduction

linalg::charpoly(A, x) computes the characteristic polynomial of the matrix A. The characteristic polynomial of a n x n matrix is defined by pA(x):=det(x*I-A), where I denotes the n x n identity matrix.

Call(s)

linalg::charpoly(A, x)

Parameters

A - a square matrix of a domain of category Cat::Matrix
x - an indeterminate

Returns

a polynomial of the domain Dom::DistributedPolynomial([x],R), where R is the component ring of A.

Related Functions

linalg::charmat, linalg::det, linalg::hessenberg, linalg::minpoly

Details

Example 1

We define a matrix over the rational numbers:

>> A := Dom::Matrix(Dom::Rational)([[1, 2], [3, 4]])
                                +-      -+
                                |  1, 2  |
                                |        |
                                |  3, 4  |
                                +-      -+

Then the characteristic polynomial pA(x) is given by:

>> linalg::charpoly(A, x)
                                2
                               x  - 5 x - 2

It is of the domain type:

>> domtype(%)
         Dom::DistributedPolynomial([x], Dom::Rational, LexOrder)

Example 2

We define a matrix over Z7:

>> B := Dom::Matrix(Dom::IntegerMod(7))([[1, 2], [3, 0]])
                          +-                  -+
                          |  1 mod 7, 2 mod 7  |
                          |                    |
                          |  3 mod 7, 0 mod 7  |
                          +-                  -+

The characteristic polynomial pB(x) of B is given by:

>> p := linalg::charpoly(B, x)
                             2
                  (1 mod 7) x  + (6 mod 7) x + (1 mod 7)

We compute the zeros of pB(x), i.e., the eigenvalues of the matrix B:

>> solve(p)
                          x in {3 mod 7, 5 mod 7}

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000