Eigenvalues and Eigenvectors of a 4 X 4 Matrix, a Numerical Solution Utility

This page contains a routine that numerically finds the eigenvalues and eigenvectors of a 4 X 4 Real Matrix. It is written in JavaScript, so make sure that JavaScript is enabled in your browser. The algorithm is from the EISPACK collection of subroutines.

References:

Smith, B.T.; J.M. Boyle; J.J. Dongarra; B.S. Garbow; Y. Ikebe; V.C. Klema; and C.B. Moler.
          "Matrix Eigensystem Routines--(EISPACK) Guide"
          Springer-Verlag, Berlin.
          1976

Garbow, B.S.; J.M. Boyle; J.J. Dongarra; and C.B. Moler.
          "Matrix Eigensystem Routines--(EISPACK) Guide Extension"
          Springer-Verlag, Berlin.
          1977

The original sub-routines were written in FORTRAN and have been translated to Javascript here. Although all care has been taken to ensure that the sub-routines were translated accurately, some errors may have crept into the translation. These errors are mine; the original FORTRAN routines have been thoroughly tested and work properly. Please report any errors to the webmaster.


λ is an eigenvalue (a scalar) of the Matrix [A] if there is a non-zero vector (v) such that the following relationship is satisfied:

[A](v) = λ (v)

Every vector (v) satisfying this equation is called an eigenvector of [A] belonging to the eigenvalue λ.

As an example, in the case of a 3 X 3 Matrix and a 3-entry column vector,

            a11   a12   a13
[A]  =   a21   a22   a23
            a31   a32   a33

and each eigenvector v1, v2, v3, etc takes the form

              v1
(v)   =   v2
              v3

To use this utility, you should have the a values ready to enter. If you have all the data ready, simply enter it, click the Solve button, and it will calculate the eigenvalues of [A] and the associated eigenvectors. Note that the a values are assumed to be real; however, the solutions may be complex. In other words, this utility calculates solutions that may have imaginary components (indicated by the "i"); however, it assumes the inputs are all real (it does not accept complex inputs).

IMPORTANT! How to use the output.
If the i-th eigenvalue is real, the i-th COLUMN of the eigenvector Matrix contains the corresponding eigenvector.
If the i-th eigenvalue is complex with positive imaginary part, COLUMNS i and (i + 1) contain the real and imaginary parts of the corresponding eigenvector. The conjugate of this vector is the eigenvector for the conjugate eigenvalue.
Note the Error Code. If it does not equal -1, some eigenvalues and all eigenvectors are meaningless.

a11 a12 a13 a14
a21 a22 a23 a24
a31 a32 a33 a34
a41 a42 a43 a44

The eigenvalues are:

λ1 = + i
λ2 = + i
λ3 = + i
λ4 = + i

The eigenvector Matrix is:

z11 z12 z13 z14
z21 z22 z23 z24
z31 z32 z33 z34
z41 z42 z43 z44

Error Code

Error Code = -1: Normal completion.
Error Code > 0: If more than 30 iterations are required to determine an eigenvalue, the subroutine terminates. The Error Code gives the index of the eigenvalue for which the failure occurred. Eigenvalues λ ErCode + 1 , λ ErCode + 2 , . . . λ N should be correct, but no eigenvectors are computed.

Return to Math Functions Page

Return to Thothworks Home Page