Next: Optimization
Up: Numerical Analysis for Chemical
Previous: Roots of Equations
Subsections
Matrix notation:
- sysmmetric matrix
- diagonal matrix
- principal or main diagonal of the matrix
- identity matrix
- upper triangular matrix
- lower triangular matrix
- banned matrix
- tridiagonal matrix
- transpose
- trace
Problems when solving sets of linear equations
- Singular
- no solution
- infinite solution
- Ill-conditioned : system that are very close to being singular
Cramer's Rule : each unknown in a system of linear algebraic equations may
be expressed as a fraction of two determinants with denominator D and with
the numerator obtained from D by replacing the column of coefficients of
the unknown in question by the constant
. For more
than three equations, Cramer's rule becomes impractical because, as the
number of equations increases, the determinants are time-consuming to
evaluate.
The elimination of unknowns consists of two steps
- The equations are manipulated to eliminate one of the unknowns from
the equations. The result of this elimination step is that we have on
equation with one unknown.
- This equation can be solved directly and the result back-substituted
into one of the original equations to solve for the remaining unknown.
But the above method can't avoid division by zero in computer program. Need
more elaborated algorithms !
- Division by zero : partially avoided by the technique of pivoting
- Round-off errors : An error in early steps wiil tend to
propagate-that is, it will cause errors in subsequent steps.
- Ill-conditioned systems : small changes in coefficients result in
large changes in the solution. An ill-conditioned system is one with a
determinant close to zero. This means that there is no solutions or an
infinite number of solutions. However, it is difficult to specify how
close to zero the determinant must be to indicate ill-conditioning. This
is complicated by the fact that the determinant can be changed by
multiplying one or more of the equations by a scale factor without
changing the solution. Consequently, the determinant is a relative value
that is influenced by the magnitude of the coefficients. One way to
partially prevent a scaling effect is to scale the equations so that the
maximum element in any row is equal to 1.
- Singular systems : lose one degree of freedom and we would be dealing
with the impossible case of
equations with
unknowns. Check the
determinant whether it is zero or not !
- Use more significant figures in the computation
- Use pivoting
- partial pivoting : make the largest element in the column to be the
pivot element
- avoiding division by zero
- minimizes round-off error
- gives a partial remedy for ill-conditioning
- Use scaling : minimize round-off error for those cases where some of
the equations in a system have much larger coefficients than others.
However, sometime scaling introduces a round-off error. Thus, it is used as
a criterion for pivoting and the original coefficient values are retrained
for the actual elimination and substitution computation.
Convert a complex system into two real system and employ the algorithm for
the real system.
Use a multidimensional verstion of Newton-Raphson method for nonlinear
system. However, there are two major shortcoming.
- Difficult to calculate partial derivatives
- Need excellent initial guesses
Need optimization techniques !
Difference between Gauss and Gauss-Jordan
- An unknown is elminated from all other euqation rather than just the
subsequent ones.
- All rows are normalized by dividing them by their pivot elements.
- the elimination step results in an identity matrix rather than a
triangular matrix
- No need to employ back substitution to obtain the solution.
LU decomposition provides
- well-suited for those situations where many right-hande side vector
must be evaluated for a single value of
.
- an efficient means to compute the matrix inverse.
Gauss elimination is designed to solve system of linear algebraic equations
![$\displaystyle [A]\{X\} = \{B\}$](img94.png) |
(3.1) |
Gauss elimination involves two steps: forward elimination and back
substitution. Of these, the forward elimination step require more
computation times. LU decomposition methods separate the time-consuming
elimination of the matrix
from the manipulations of the right-hand
side
. Thus, once
has ben decomposed, multiple right-hand side
vectors can be evaluated in an efficient manner.
Equation (3.1) can be rearranged to give
![$\displaystyle [A]\{X\} - \{B\}=0$](img95.png) |
(3.2) |
The above equation can be reduced into upper triangular form with Gauss
elimination.
![$\displaystyle [U]\{X\} - \{D\}=0$](img96.png) |
(3.3) |
And assume a lower triangular matrix
which satisfies the following
equation
![$\displaystyle [L]\{[U]\{X\} - \{D\}\}=[A]\{X\} - \{B\}$](img98.png) |
(3.4) |
If this equation holds,
A two-step strategy for obtaining solutions with LU decomposition
- Decompose
into
and
- Find a intermediate vector
with equation (3.6) and
solve equation (3.3) for
LU decomposition can be performed in Gauss elimination.
is a direct
product of the forward elimination. For example, consider the following
system
 |
(3.7) |
The forward elimination step reduce the original matrix
to the form
 |
(3.8) |
which is in the desired upper triangular format. The matrix
is also
produced during the step.
 |
(3.9) |
LU decomposition algorithm:
- The factors generated during the elimination phase are stored in the
lower part of the matrix
- Keep track of pivoting
- Scaled values of the elements are used to determine whether pivoting
is to be implemented
- The diagonal term is monitored during the pivoting phase to detect
near-zero occurrences in order to flag singular systems.
The inverse can be computed in a column-by column fashion by generating
solutions tieh unit vector as the right-hand-side constants. The best way
to implement such a calculation is with the LU decomposition algorithm and
it is one of the great strengths of LU decomposition.
Determination of ill-conditioned system:
- Scale the matrix and invert the scaled matrix. If there are element
of
that are several orders of magnitude greater than one, then
the system is ill-conditioned.
- Mutiply the inverse by the original matrix and assess whether the
result is close to the identity matrix. If not, it indicate
ill-conditioning.
- Invert the inversed matrix and assess whether the result is
sufficiently close to the original matrix. If not, it indicate that the
system is ill-conditioned.
The indication of ill-conditioning with a single number
- Norm: a real-valued function that provide a measure of the size of
multicomponent mathematical entities. For example, consider a vector in
three-dimensional Euclidean space
 |
(3.10) |
The length of this vector-that is, the distance from the coordinate
(0, 0, 0) to (a, b, c)
 |
(3.11) |
where the nomenclature
indicates that this length is referred
to as the Euclidean norm of
. For matrix case,
 |
(3.12) |
which is given a special name-the Frobenius norm. it provide a single
value to quantify the ``size'' of
.
- Matrix condition number:
![$\displaystyle \mathrm{Cond}[A] = \Vert A\Vert \cdot \Vert A^{-1}\Vert$](img116.png) |
(3.13) |
Note that for a matrix
, this number will be greater than or equal
to 1. However, the above equation require computation time to obtain
.
- Banded matrix : a square matrix that has all elements equal to zero,
with exception of a band centered on the main diagonal. The convensional
LU decompostion methods are inefficient to solve banded systems.
- Tridiagonal system : Thomas algorithm
- Symmetric matrix : Cholesky decomposition
The Gauss-Seidel method:
- An alternative to the elimination method
- Iterative or approximate method
Convergence enhancement with relaxation
- Matlab:
- cond : matrix condition number
- norm : matrix or vector norm
- rank : no. of linearly independent rows or columns
- det : determinant
- trace : sum of diagonal elements
- / : linear equation solution
- chol : cholesky factorization
- lu : factors from gauss elimination
- inv : matrix inverse
- IMSL: various routines are exist to solve linear system
See the textbook
Next: Optimization
Up: Numerical Analysis for Chemical
Previous: Roots of Equations
Taechul Lee
2001-11-29