2.1 Using LU Decomposition to Solve a System of Simultaneous Equations

Factoring a matrix in this manner is useful for solving large systems of n simultaneous equations in n unknowns. Although the coding of a full equation solver based on the LU decomposition method is not described in this manual, this section gives an abridged explanation of the application of LU decomposition to solving equations.

Although HPF achieves performance gains only for large matrices, (for the meaning of "large", see Section 6.1.1), the following artificially small example of a system of 3 equations in 3 variables can be used for the purpose of illustration:

Systems of n equations in n unknowns can be represented in matrix notation as a single equation, in terms of an n by n array A of coefficients, an n-element vector x of variables, and an n-element vector b of constants. Our example is expressed in this notation:

Using a Gaussian elimination technique, A can be factored (decomposed) into the following two matrices L and U:

After the matrix A of coefficients is factored into the lower and upper triangular matrices L and U, values for the vector x of variables can be determined easily:

Once A has been factored into L and U, this two-step procedure can be used repeatedly to solve the system of equations for different values of b.