  eig
  Builtin Function



      SSyynnooppssiiss
        Eigensolver.

      SSyynnttaaxx
        eig ( _A )

      DDeessccrriippttiioonn

        eeiigg (( _A ))
           Computes the eigenvectors, and values of matrix _A. eig()
           returns a LIST with elements `val' and `vec' which are the
           eigenvalues and eigenvectors. Eig checks for symmetry in _A,
           and uses the appropriate solver.


        eeiigg (( _A ,, _B ))
           Computes the eigenvectors, and values of _A, and _B.  Where A*x
           = lambda*B*x. The values and vectors are returned in a list
           with element names _v_a_l and _v_e_c. Eig checks for symmetry in _A
           and _B and uses the appropriate solver.


        Uses the LAPACK subroutines DSYEV/ZHEEV or DGEEV/ZGEEV.

        EExxaammppllee::

        The generalized eigenvalue problem arises quite regularly in
        structures. From the second order differential equations
        describing a lumped mass system arise $M$ and $K$, coefficient
        matrices representing the mass and stiffness of the various
        physical degress of freedom. The equations are formulated as
        follows:



          M*dx^2/dt^2 + K*x = F





     Which leads to the eigenvalue problem:



          K*v = w^2*M*v





     For a two degree of freedom system we might have:









     > m = eye(2,2)
     > k = [5,1;1,5]
     > </ val ; vec /> = eig(k, m);

     > // Test the solution

     > k * vec[;1]
         -2.83
          2.83
     > val[1] * m * vec[;1]
         -2.83
          2.83

     > // Properties of the solution

     > vec' * m * vec
             1  -4.27e-17
     -4.27e-17          1

     > vec' * k * vec
             4  -1.71e-16
      1.23e-16          6




     The eigenvalues and vectors are sometimes obtained by converting
     the generalized problem into a standard eigenvalue problem (this is
     only feasible under certain conditions).



          > a = m\k
           a =
                  5          1
                  1          5
          > eig(a).val
           val =
                  4          6
          > eig(a).vec
           vec =
             -0.707      0.707
              0.707      0.707





     SSeeee AAllssoo
        svd, schur
















