Page 122 - Compact Numerical Methods For Computers
P. 122

The algebraic eigenvalue problem               111
                     will be completely unrecognisable after multiplication by
                                                   if
                                              c = re  = r cos f + ir sin f              (9.29)
                     that is, we obtain
                                   x' + iy' = (xr cos f – yr sin f) + i(xr sin f + yr cos f).  (9.30)

                     Therefore, it is useful to standardise every computed eigenvector so that the
                     largest. component is
                                                       1 + i0.                          (9.31)
                     Furthermore it is worthwhile to compute residuals for each vector. While this may
                     be a trivial programming tack for those familiar with complex numbers and linear
                     algebra, algorithms for both standardisation and residual calculation follow as an
                     aid to those less familiar with the eigenproblem of general square matrices.
                       We now present three algorithms which are intended to be used together:

                        algorithm 11, to standardise a complex (eigen)vector;
                        algorithm 12, to compute residuals for a purported complex eigenvector;
                          and
                        algorithm 26, Eberlein’s Jacobi-like method for eigensolutions of a complex
                                     square matrix.

                      The driver program DR26.PAS on the software diskette is designed to use these three
                      algorithms in computing and presenting eigensolutions of a general square matrix,
                      that is, a square matrix which may have real or complex elements and need not have
                      any symmetries in its elements.

                     Algorithm 11. Standardisation of a complex vector

                       procedure stdceigv(n: integer; {number of elements in vector}
                                        var T, U: x-matrix); {eigenvector k is given
                                        (column k of T) + sqrt(-1) * (column k of U)
                                        = T[.,k] + sqrt(-1) * U[.,k] }
                        {algll.pas == Standardisation of complex eigensolutions.
                                        Copyright 1988 J.C.Nash
                        }
                       var
                          i, k, m : integer;
                          b, e, g, s : real;
                       begin
                          writeln(‘algll.pas -- standardized eigensolutions’);
                          for i := 1 to n do {loop over the eigensolutions}
                          begin {the standardization of the solution so that the largest
                                      element of each solution is set to 1 + 0 sqrt(-1)}
                             g := T[1,i]*T[1,i]+U[1,i]*U[1,i]; {STEP 1}
                                {the magnitude of element 1 of eigensolution i}
                             k := 1; {to set index for the largest element so far}
                             if n>1 then
                             begin {STEP 2}
                                for m := 2 to n do {loop over the other elements of the solution}
   117   118   119   120   121   122   123   124   125   126   127