linalg::charmat --
characteristic matrix
Introductionlinalg::charmat(A, x) returns the
characteristic matrix x*I - A of the n x n matrix
A, where I denotes the n x n identity
matrix.
Call(s)linalg::charmat(A, x)
ParametersA |
- | a square matrix of a domain of category Cat::Matrix |
x |
- | an indeterminate |
Returnsa matrix of the domain
Dom::Matrix(Dom::DistributedPolynomial([x],R)), where
R is the component ring of A.
Related
Functions
DetailsA must be a commutative ring,
i.e., a domain of category Cat::CommutativeRing.evalp(M, x =
u). See example 2.
Example
1We define a matrix over the rational numbers:
>> A := Dom::Matrix(Dom::Rational)([[1, 2], [3, 4]])
+- -+
| 1, 2 |
| |
| 3, 4 |
+- -+
and compute the characteristic matrix of A in the variable x:
>> MA := linalg::charmat(A, x)
+- -+
| x - 1, -2 |
| |
| -3, x - 4 |
+- -+
The determinant of the matrix MA is a
polynomial in x, the characteristic polynomial of the matrix
A:
>> pA := linalg::det(MA)
2
x - 5 x - 2
>> domtype(pA)
Dom::DistributedPolynomial([x], Dom::Rational, LexOrder)
Of course, we can compute the characteristic polynomial
of A directly via linalg::charpoly:
>> linalg::charpoly(A, x)
2
x - 5 x - 2
The result is of the same domain type as the polynomial
pA.
Example
2We define a matrix over the complex numbers:
>> B := Dom::Matrix(Dom::Complex)([[1 + I, 1], [1, 1 - I]])
+- -+
| 1 + I, 1 |
| |
| 1, 1 - I |
+- -+
The characteristic matrix of B in the
variable z is:
>> MB := linalg::charmat(B, z)
+- -+
| z - (1 + I), -1 |
| |
| -1, z - (1 - I) |
+- -+
We evaluate MB at z=I and get
the matrix:
>> evalp(MB, z = I)
+- -+
| -1, -1 |
| |
| -1, - 1 + 2 I |
+- -+
Note that this is a matrix of the domain type
Dom::Matrix(Dom::Complex):
>> domtype(%)
Dom::Matrix(Dom::Complex)
linalg::charMatrix