In linear algebra, the modal matrix is used in the diagonalization process involving eigenvalues and eigenvectors.
Specifically the modal matrix                     M                 for the matrix                     A                 is the n × n matrix formed with the eigenvectors of                     A                 as columns in                     M                . It is utilized in the similarity transformation
                    D        =                  M                      −            1                          A        M        ,                where                     D                 is an n × n diagonal matrix with the eigenvalues of                     A                 on the main diagonal of                     D                 and zeros elsewhere. The matrix                     D                 is called the spectral matrix for                     A                . The eigenvalues must appear left to right, top to bottom in the same order as their corresponding eigenvectors are arranged left to right in                     M                .
The matrix
                    A        =                              (                                                            3                                                  2                                                  0                                                                              2                                                  0                                                  0                                                                              1                                                  0                                                  2                                                      )                                  has eigenvalues and corresponding eigenvectors
                              λ                      1                          =        −        1        ,                                                            b                                            1                          =                  (          −          3          ,          6          ,          1          )                ,                                              λ                      2                          =        2        ,                                                    b                                            2                          =                  (          0          ,          0          ,          1          )                ,                                              λ                      3                          =        4        ,                                                    b                                            3                          =                  (          2          ,          1          ,          1          )                .                A diagonal matrix                     D                , similar to                     A                 is
                    D        =                              (                                                            −                  1                                                  0                                                  0                                                                              0                                                  2                                                  0                                                                              0                                                  0                                                  4                                                      )                          .                One possible choice for an invertible matrix                     M                 such that                     D        =                  M                      −            1                          A        M        ,                 is
                    M        =                              (                                                            −                  3                                                  0                                                  2                                                                              6                                                  0                                                  1                                                                              1                                                  1                                                  1                                                      )                          .                Note that since eigenvectors themselves are not unique, and since the columns of both                     M                 and                     D                 may be interchanged, it follows that both                     M                 and                     D                 are not unique.
Let                     A                 be an n × n matrix. A generalized modal matrix                     M                 for                     A                 is an n × n matrix whose columns, considered as vectors, form a canonical basis for                     A                 and appear in                     M                 according to the following rules:
All Jordan chains consisting of one vector (that is, one vector in length) appear in the first columns of                     M                .All vectors of one chain appear together in adjacent columns of                     M                .Each chain appears in                     M                 in order of increasing rank (that is, the generalized eigenvector of rank 1 appears before the generalized eigenvector of rank 2 of the same chain, which appears before the generalized eigenvector of rank 3 of the same chain, etc.).One can show that
where                     J                 is a matrix in Jordan normal form. By premultiplying by                               M                      −            1                                  , we obtain
Note that when computing these matrices, equation (1) is the easiest of the two equations to verify, since it does not require inverting a matrix.
This example illustrates a generalized modal matrix with four Jordan chains. Unfortunately, it is a little difficult to construct an interesting example of low order. The matrix
                    A        =                              (                                                            −                  1                                                  0                                                  −                  1                                                  1                                                  1                                                  3                                                  0                                                                              0                                                  1                                                  0                                                  0                                                  0                                                  0                                                  0                                                                              2                                                  1                                                  2                                                  −                  1                                                  −                  1                                                  −                  6                                                  0                                                                              −                  2                                                  0                                                  −                  1                                                  2                                                  1                                                  3                                                  0                                                                              0                                                  0                                                  0                                                  0                                                  1                                                  0                                                  0                                                                              0                                                  0                                                  0                                                  0                                                  0                                                  1                                                  0                                                                              −                  1                                                  −                  1                                                  0                                                  1                                                  2                                                  4                                                  1                                                      )                                  has a single eigenvalue                               λ                      1                          =        1                 with algebraic multiplicity                               μ                      1                          =        7                . A canonical basis for                     A                 will consist of one linearly independent generalized eigenvector of rank 3 (generalized eigenvector rank; see generalized eigenvector), two of rank 2 and four of rank 1; or equivalently, one chain of three vectors                               {                                                    x                                                    3                                ,                                                    x                                                    2                                ,                                                    x                                                    1                                }                        , one chain of two vectors                               {                                                    y                                                    2                                ,                                                    y                                                    1                                }                        , and two chains of one vector                               {                                                    z                                                    1                                }                        ,                               {                                                    w                                                    1                                }                        .
An "almost diagonal" matrix                     J                 in Jordan normal form, similar to                     A                 is obtained as follows:
                    M        =                              (                                                                                                                              z                                                                                    1                                                                                                                                                          w                                                                                    1                                                                                                                                                          x                                                                                    1                                                                                                                                                          x                                                                                    2                                                                                                                                                          x                                                                                    3                                                                                                                                                          y                                                                                    1                                                                                                                                                          y                                                                                    2                                                                                            )                          =                              (                                                            0                                                  1                                                  −                  1                                                  0                                                  0                                                  −                  2                                                  1                                                                              0                                                  3                                                  0                                                  0                                                  1                                                  0                                                  0                                                                              −                  1                                                  1                                                  1                                                  1                                                  0                                                  2                                                  0                                                                              −                  2                                                  0                                                  −                  1                                                  0                                                  0                                                  −                  2                                                  0                                                                              1                                                  0                                                  0                                                  0                                                  0                                                  0                                                  0                                                                              0                                                  1                                                  0                                                  0                                                  0                                                  0                                                  0                                                                              0                                                  0                                                  0                                                  −                  1                                                  0                                                  −                  1                                                  0                                                      )                          ,                                    J        =                              (                                                            1                                                  0                                                  0                                                  0                                                  0                                                  0                                                  0                                                                              0                                                  1                                                  0                                                  0                                                  0                                                  0                                                  0                                                                              0                                                  0                                                  1                                                  1                                                  0                                                  0                                                  0                                                                              0                                                  0                                                  0                                                  1                                                  1                                                  0                                                  0                                                                              0                                                  0                                                  0                                                  0                                                  1                                                  0                                                  0                                                                              0                                                  0                                                  0                                                  0                                                  0                                                  1                                                  1                                                                              0                                                  0                                                  0                                                  0                                                  0                                                  0                                                  1                                                      )                          ,                where                     M                 is a generalized modal matrix for                     A                , the columns of                     M                 are a canonical basis for                     A                , and                     A        M        =        M        J                . Note that since generalized eigenvectors themselves are not unique, and since some of the columns of both                     M                 and                     J                 may be interchanged, it follows that both                     M                 and                     J                 are not unique.