Numerical Methods in Engineering with Python

A matrix can be decomposed in numerous ways, some of which are generally useful, whereas others find use in special applications. The most important of the latter are the QR factorization and the singular value decomposition.
The QR decomposition of a matrix A is
where Q is an orthogonal matrix (recall that the matrix Q is orthogonal if Q ? 1= Q T) and R is an upper triangular matrix. Unlike LU factorization, QR decomposition does not require pivoting to sustain stability, but it does involve about twice as many operations. Due to its relative inefficiency, the QR factorization is not used as a general-purpose tool, but finds its niche in applications that put a premium on stabiliy (e.g., solution of eigenvalue problems).
The singular value decomposition is useful in dealing with singular or ill-conditioned matrices. Here the factorization is
where U and V are orthogonal matrices and
is a diagonal matrix. The elements ? i of ? can be shown to be positive or zero. If A is symmetric and positive definite, then the ? s are the eigenvalues of A. A nice characteristic of the singular value decomposition is that it works even if A is singular or ill-conditioned. The conditioning of A can be diagnosed from magnitudes of the ? s: the matrix is singular if one or more of the ? s are zero, and it is...