Next: , Previous: Matrix Factorizations, Up: Linear Algebra


18.4 Functions of a Matrix

— Function File: expm (A)

Return the exponential of a matrix, defined as the infinite Taylor series

          expm(A) = I + A + A^2/2! + A^3/3! + ...

The Taylor series is not the way to compute the matrix exponential; see Moler and Van Loan, Nineteen Dubious Ways to Compute the Exponential of a Matrix, SIAM Review, 1978. This routine uses Ward's diagonal Padé approximation method with three step preconditioning (SIAM Journal on Numerical Analysis, 1977). Diagonal Padé approximations are rational polynomials of matrices

               -1
          D (A)   N (A)

whose Taylor series matches the first 2q+1 terms of the Taylor series above; direct evaluation of the Taylor series (with the same preconditioning steps) may be desirable in lieu of the Padé approximation when Dq(A) is ill-conditioned.

— Function File: s = logm (A)
— Function File: s = logm (A, opt_iters)
— Function File: [s, iters] = logm (...)

Compute the matrix logarithm of the square matrix A. The implementation utilizes a Padé approximant and the identity

          logm(A) = 2^k * logm(A^(1 / 2^k))

The optional argument opt_iters is the maximum number of square roots to compute and defaults to 100. The optional output iters is the number of square roots actually computed.

— Loadable Function: [result, error_estimate] = sqrtm (A)

Compute the matrix square root of the square matrix A.

Ref: N.J. Higham. A New sqrtm for matlab. Numerical Analysis Report No. 336, Manchester Centre for Computational Mathematics, Manchester, England, January 1999.

See also: expm, logm.

— Loadable Function: kron (A, B)

Form the Kronecker product of two matrices, defined block by block as

          x = [a(i, j) b]

For example:

          kron (1:4, ones (3, 1))
                ⇒  1  2  3  4
                    1  2  3  4
                    1  2  3  4

— Loadable Function: x = syl (A, B, C)

Solve the Sylvester equation

          A X + X B + C = 0

using standard lapack subroutines. For example:

          syl ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12])
               ⇒ [ -0.50000, -0.66667; -0.66667, -0.50000 ]