Files
MultiPhysicsVault/.raw/AFirstCourseInTheFiniteElementMethod/AFirstCourseInTheFiniteElementMethod_075.md
T
김경종 b7f84e1c0f
Tests / Hermetic test suite (push) Has been cancelled
Tests / Skill frontmatter validation (push) Has been cancelled
add documents
2026-05-29 15:59:56 +09:00

543 lines
21 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- source-page: 741 -->
If the cs are all zero, the set of equations in homogeneous, and nontrivial solutions exist only if all equations are not independent. Buckling and vibration problems typically involve homogeneous sets of equations.
# B.2 Uniqueness, Nonuniqueness, and Nonexistence of Solution
To solve a system of simultaneous linear equations means to determine a unique set of values (if they exist) for the unknowns that satisfy every equation of the set simultaneously. A unique solution exists if and only if the determinant of the square coefficient matrix is not equal to zero. (All of the engineering problems considered in this text result in square coefficient matrices.) The problems in this text usually result in a system of equations that has a unique solution. Here we will briefly illustrate the concepts of uniqueness, nonuniqueness, and nonexistence of solution for systems of equations.
# Uniqueness of Solution
$$
2 x _ {1} + 1 x _ {2} = 6 \tag {B.2.1}
$$
$$
1 x _ {1} + 4 x _ {2} = 1 7
$$
For Eqs. (B.2.1), the determinant of the coefficient matrix is not zero, and a unique solution exists, as shown by the single common point of intersection of the two Eqs. (B.2.1) in Figure B1.
# Nonuniqueness of Solution
$$
2 x _ {1} + 1 x _ {2} = 6 \tag {B.2.2}
$$
$$
4 x _ {1} + 2 x _ {2} = 1 2
$$
![](images/page-741_8ab21a59d21805ce4a25d904dbc09276126f0c07eb10746300c57059ec83263d.jpg)
<details>
<summary>line</summary>
| x1 | x2 |
|---|---|
| 0 | 6 |
| 1 | 17 |
</details>
Figure B1 Uniqueness of solution
<!-- source-page: 742 -->
![](images/page-742_18774b72d0a908b4e8d4d3ce50b2643e5ee3d447acbceb99cac378d278f4a3f4.jpg)
<details>
<summary>line</summary>
| x1 | x2 |
|---|---|
| 0 | 6 |
| 1 | 12 |
</details>
Figure B2 Nonuniqueness off solution
![](images/page-742_e7917e97f2d2b6893a9d31432c8ee13e1280d73c6ee1d65c2e0bfc6e86e384cf.jpg)
<details>
<summary>line</summary>
| x1 | x2 |
|---|---|
| 0 | 16 |
| 1 | 6 |
The chart displays two lines representing equations 4x₁ + 2x₂ = 16 and 2x₁ + x₂ = 6. The x-axis is labeled x₁ and the y-axis is labeled x₂. The lines are drawn with explicit equations and equations.
</details>
Figure B3 Nonexistence of solution
For Eqs. (B.2.2), the determinant of the coefficient matrix is zero; that is,
$$
\left| \begin{array}{c c} 2 & 1 \\ 4 & 2 \end{array} \right| = 0
$$
Hence the equations are called singular, and either the solution is not unique or it does not exist. In this case, the solution is not unique, as shown in Figure B2.
# Nonexistence of Solution
$$
\begin{array}{l} 2 x _ {1} + x _ {2} = 6 \\ 4 x _ {1} + 2 x _ {2} = 1 6 \end{array} \tag {B.2.3}
$$
$$
4 x _ {1} + 2 x _ {2} = 1 6
$$
Again, the determinant of the coefficient matrix is zero. In this case, no solution exists because we have parallel lines (no common point of intersection), as shown in Figure B3.
# B.3 Methods for Solving Linear Algebraic Equations
We will now present some common methods for solving systems of linear algebraic equations that have unique solutions. Some of these methods work best for small sets of equations solved longhand, whereas others are well suited for computer application.
# Cramers Rule
We begin by introducing a method known as Cramers rule, which is useful for the longhand solution of small numbers of simultaneous equations. Consider the set of equations
$$
\underline {{a}} \underline {{x}} = \underline {{c}} \tag {B.3.1}
$$
<!-- source-page: 743 -->
or, in index notation,
$$
\sum_ {i = 1} ^ {n} a _ {i j} x _ {j} = c _ {i} \tag {B.3.2}
$$
We first let $\underline{d}^{(i)}$ be the matrix $\underline{a}$ with column $i$ replaced by the column matrix $\underline{c}$ . Then the unknown $x_{i}$ 's are determined by
$$
x _ {i} = \frac {| \underline {{d}} ^ {(i)} |}{| \underline {{a}} |} \tag {B.3.3}
$$
As an example of Cramer's rule, consider the following equations:
$$
- x _ {1} + 3 x _ {2} - 2 x _ {3} = 2
$$
$$
2 x _ {1} - 4 x _ {2} + 2 x _ {3} = 1 \tag {B.3.4}
$$
$$
4 x _ {2} + x _ {3} = 3
$$
In matrix form, Eqs. (B.3.4) become
$$
\left[ \begin{array}{r r r} - 1 & 3 & - 2 \\ 2 & - 4 & 2 \\ 0 & 4 & 1 \end{array} \right] \left\{ \begin{array}{l} x _ {1} \\ x _ {2} \\ x _ {3} \end{array} \right\} = \left\{ \begin{array}{l} 2 \\ 1 \\ 3 \end{array} \right\} \tag {B.3.5}
$$
By Eq. (B.3.3), we can solve for the unknown $x_{i}$ 's as
$$
x _ {1} = \frac {| \underline {{d}} ^ {(1)} |}{| \underline {{a}} |} = \frac {\left| \begin{array}{c c c} 2 & 3 & - 2 \\ 1 & - 4 & 2 \\ 3 & 4 & 1 \end{array} \right|}{\left| \begin{array}{c c c} - 1 & 3 & - 2 \\ 2 & - 4 & 2 \\ 0 & 4 & 1 \end{array} \right|} = \frac {- 4 1}{- 1 0} = 4. 1
$$
$$
x _ {2} = \frac {\left| \underline {{d}} ^ {(2)} \right|}{\left| \underline {{a}} \right|} = \frac {\left| \begin{array}{c c c} - 1 & 2 & - 2 \\ 2 & 1 & 2 \\ 0 & 3 & 1 \end{array} \right|}{- 1 0} = 1. 1 \tag {B.3.6}
$$
$$
x _ {3} = \frac {| \underline {{d}} ^ {(3)} |}{| \underline {{a}} |} = \frac {\left| \begin{array}{r r r} - 1 & 3 & 2 \\ 2 & - 4 & 1 \\ 0 & 4 & 3 \end{array} \right|}{- 1 0} = - 1. 4
$$
In general, to find the determinant of an $n \times n$ matrix, we must evaluate the determinants of n matrices of order $(n - 1) \times (n - 1)$ . It has been shown that the solution of n simultaneous equations by Cramer's rule, evaluating determinants by expansion by minors, requires $(n - 1)(n + 1)!$ multiplications. Hence, this method takes large amounts of computer time and therefore is not used in solving large systems of simultaneous equations either longhand or by computer.
<!-- source-page: 744 -->
# Inversion of the Coefficient Matrix
The set of equations $\underline { { a } } \underline { { x } } = \underline { { c } }$ can be solved for $\underline { x }$ by inverting the coefficient matrix a and premultiplying both sides of the original set of equations by $\underline { { \boldsymbol { a } } } ^ { - 1 }$ , such that
$$
\underline {{a}} ^ {- 1} \underline {{a}} \underline {{x}} = \underline {{a}} ^ {- 1} \underline {{c}}
$$
$$
\underline {{I}} \underline {{x}} = \underline {{a}} ^ {- 1} \underline {{c}} \tag {B.3.7}
$$
$$
\underline {{x}} = \underline {{a}} ^ {- 1} \underline {{c}}
$$
Two methods for determining the inverse of a matrix (the cofactor method and row reduction) were discussed in Appendix A.
The inverse method is much more time-consuming (because much time is required to determine the inverse of $\underline { { a } } )$ than either the elimination method or the iteration method, which are discussed subsequently. Therefore, inversion is practical only for small systems of equations.
However, the concept of inversion is often used during the formulation of the finite element equations, even though elimination or iteration is used in achieving the final solution for the unknowns (such as nodal displacements).
Besides the tedious calculations necessary to obtain the inverse, the method usually involves determining the inverse of sparse, banded matrices (stiffness matrices in structural analysis usually contain many zeros with the nonzero coefficients located in a band around the main diagonal). This sparsity and banded nature can be used to advantage in terms of storage requirements and solution algorithms on the computer. The inverse results in a dense, full matrix with loss of the advantages resulting from the sparse, banded nature of the original coefficient matrix.
To illustrate the solution of a system of equations by the inverse method, consider the same equations that we solved previously by Cramers rule. For conveniences sake, we repeat the equations here.
$$
\left[ \begin{array}{r r r} - 1 & 3 & - 2 \\ 2 & - 4 & 2 \\ 0 & 4 & 1 \end{array} \right] \left\{ \begin{array}{l} x _ {1} \\ x _ {2} \\ x _ {3} \end{array} \right\} = \left\{ \begin{array}{l} 2 \\ 1 \\ 3 \end{array} \right\} \tag {B.3.8}
$$
The inverse of this coefficient matrix was found in Eq. (A.3.11) of Appendix A. The unknowns are then determined as
$$
\left\{ \begin{array}{l} x _ {1} \\ x _ {2} \\ x _ {3} \end{array} \right\} = - \frac {1}{1 0} \left[ \begin{array}{c c c} - 1 2 & - 1 1 & - 2 \\ - 2 & - 1 & - 2 \\ 8 & 4 & - 2 \end{array} \right] \left\{ \begin{array}{l} 2 \\ 1 \\ 3 \end{array} \right\} = \left\{ \begin{array}{c} 4. 1 \\ 1. 1 \\ - 1. 4 \end{array} \right\} \tag {B.3.9}
$$
# Gaussian Elimination
We will now consider a commonly used method called Gaussian elimination that is easily adapted to the computer for solving systems of simultaneous equations. It is based on triangularization of the coefficient matrix and evaluation of the unknowns by back-substitution starting from the last equation.
<!-- source-page: 745 -->
The general system of n equations with n unknowns given by
$$
\left[ \begin{array}{c c c c} a _ {1 1} & a _ {1 2} & \dots & a _ {1 n} \\ a _ {2 1} & a _ {2 2} & \dots & a _ {2 n} \\ \vdots & \vdots & & \vdots \\ a _ {n 1} & a _ {n 2} & \dots & a _ {n n} \end{array} \right] \left\{ \begin{array}{l} x _ {1} \\ x _ {2} \\ \vdots \\ x _ {n} \end{array} \right\} = \left\{ \begin{array}{l} c _ {1} \\ c _ {2} \\ \vdots \\ c _ {n} \end{array} \right\} \tag {B.3.10}
$$
will be used to explain the Gaussian elimination method.
1. Eliminate the coefficient of $x _ { 1 }$ in every equation except the first one.
To do this, select $a _ { 1 1 }$ as the pivot, and
a. Add the multiple $- a _ { 2 1 } / a _ { 1 1 }$ of the first row to the second row.
b. Add the multiple $- a _ { 3 1 } / a _ { 1 1 }$ of the first row to the third row.
c. Continue this procedure through the nth row.
The system of equations will then be reduced to the following form:
$$
\left[ \begin{array}{c c c c} a _ {1 1} & a _ {1 2} & \dots & a _ {1 n} \\ 0 & a _ {2 2} ^ {\prime} & \dots & a _ {2 n} ^ {\prime} \\ \vdots & & & \vdots \\ 0 & a _ {n 2} ^ {\prime} & \dots & a _ {n n} ^ {\prime} \end{array} \right] \left\{ \begin{array}{l} x _ {1} \\ x _ {2} \\ \vdots \\ x _ {n} \end{array} \right\} = \left\{ \begin{array}{l} c _ {1} \\ c _ {2} ^ {\prime} \\ \vdots \\ c _ {n} ^ {\prime} \end{array} \right\} \tag {B.3.11}
$$
2. Eliminate the coefficient of $x _ { 2 }$ in every equation below the second equation. To do this, select $a _ { 2 2 } ^ { \prime }$ as the pivot, and
a. Add the multiple $- a _ { 3 2 } ^ { \prime } / a _ { 2 2 } ^ { \prime }$ of the second row to the third row.
b. Add the multiple $- a _ { 4 2 } ^ { \prime } / a _ { 2 2 } ^ { \prime }$ of the second row to the fourth row.
c. Continue this procedure through the nth row.
The system of equations will then be reduced to the following form:
$$
\left[ \begin{array}{c c c c c} a _ {1 1} & a _ {1 2} & a _ {1 3} & \dots & a _ {1 n} \\ 0 & a _ {2 2} ^ {\prime} & a _ {2 3} ^ {\prime} & \dots & a _ {2 n} ^ {\prime} \\ 0 & 0 & a _ {3 3} ^ {\prime \prime} & \dots & a _ {3 n} ^ {\prime \prime} \\ \vdots & & & & \vdots \\ 0 & 0 & a _ {n 3} ^ {\prime \prime} & \dots & a _ {n n} ^ {\prime \prime} \end{array} \right] \left\{ \begin{array}{l} x _ {1} \\ x _ {2} \\ x _ {3} \\ \vdots \\ x _ {n} \end{array} \right\} = \left\{ \begin{array}{l} c _ {1} \\ c _ {2} ^ {\prime} \\ c _ {3} ^ {\prime \prime} \\ \vdots \\ c _ {n} ^ {\prime \prime} \end{array} \right\} \tag {B.3.12}
$$
We repeat this process for the remaining rows until we have the system of equations (called triangularized ) as
$$
\left[ \begin{array}{c c c c c c} a _ {1 1} & a _ {1 2} & a _ {1 3} & a _ {1 4} & \dots & a _ {1 n} \\ 0 & a _ {2 2} ^ {\prime} & a _ {2 3} ^ {\prime} & a _ {2 4} ^ {\prime} & \dots & a _ {2 n} ^ {\prime} \\ 0 & 0 & a _ {3 3} ^ {\prime \prime} & a _ {3 4} ^ {\prime \prime} & \dots & a _ {3 n} ^ {\prime \prime} \\ 0 & 0 & 0 & a _ {4 4} ^ {\prime \prime \prime} & \dots & a _ {4 n} ^ {\prime \prime \prime} \\ \vdots & \vdots & \vdots & \vdots & & \vdots \\ 0 & 0 & 0 & 0 & \dots & a _ {n n} ^ {n - 1} \end{array} \right] \left\{ \begin{array}{l} x _ {1} \\ x _ {2} \\ x _ {3} \\ x _ {4} \\ \vdots \\ x _ {n} \end{array} \right\} = \left\{ \begin{array}{l} c _ {1} \\ c _ {2} ^ {\prime} \\ c _ {3} ^ {\prime \prime} \\ c _ {4} ^ {\prime \prime \prime} \\ \vdots \\ c _ {n} ^ {n - 1} \end{array} \right\} \tag {B.3.13}
$$
3. Determine $x _ { n }$ from the last equation as
$$
x _ {n} = \frac {c _ {n} ^ {n - 1}}{a _ {n n} ^ {n - 1}} \tag {B.3.14}
$$
<!-- source-page: 746 -->
and determine the other unknowns by back-substitution. These steps are summarized in general form by
$$
k = 1, 2, \dots , n - 1
$$
$$
a _ {i j} = a _ {i j} - a _ {k j} \frac {a _ {i k}}{a _ {k k}} \quad i = k + 1, \dots , n
$$
$$
j = k, \dots , n + 1 \tag {B.3.15}
$$
$$
x _ {i} = \frac {1}{a _ {i i}} \left(a _ {i, n + 1} - \sum_ {r = i + 1} ^ {n} a _ {i r} x _ {r}\right)
$$
where $a _ { i , n + 1 }$ represent the latest right side cs given by Eq. (B.3.13).
We will solve the following example to illustrate the Gaussian elimination method.
# Example B.1
Solve the following set of simultaneous equations using Gauss elimination method.
$$
2 x _ {1} + 2 x _ {2} + 1 x _ {3} = 9
$$
$$
2 x _ {1} + 1 x _ {2} \quad = 4 \tag {B.3.16}
$$
$$
1 x _ {1} + 1 x _ {2} + 1 x _ {3} = 6
$$
# Step 1
Eliminate the coefficient of $x _ { 1 }$ in every equation except the first one. Select $a _ { 1 1 } = 2$ as the pivot, and
a. Add the multiple $- a _ { 2 1 } / a _ { 1 1 } = - 2 / 2$ of the first row to the second row
b. Add the multiple $- a _ { 3 1 } / a _ { 1 1 } = - 1 / 2$ of the first row to the third row.
We then obtain
$$
2 x _ {1} + 2 x _ {2} + 1 x _ {3} = 9
$$
$$
0 x _ {1} - 1 x _ {2} - 1 x _ {3} = 4 - 9 = - 5 \tag {B.3.17}
$$
$$
0 x _ {1} + 0 x _ {2} + \frac {1}{2} x _ {3} = 6 - \frac {9}{2} = \frac {3}{2}
$$
# Step 2
Eliminate the coefficient of $x _ { 2 }$ in every equation below the second equation. In this case, we accomplished this in step 1.
# Step 3
Solve for $x _ { 3 }$ in the third of Eqs. (B.3.17) as
$$
x _ {3} = \frac {\left(\frac {3}{2}\right)}{\left(\frac {1}{2}\right)} = 3
$$
<!-- source-page: 747 -->
Solve for $x_{2}$ in the second of Eqs. (B.3.17) as
$$
x _ {2} = \frac {- 5 + 3}{- 1} = 2
$$
Solve for $x_{1}$ in the first of Eqs. (B.3.17) as
$$
x _ {1} = \frac {9 - 2 (2) - 3}{2} = 1
$$
To illustrate the use of the index Eqs. (B.3.15), we re-solve the same example as follows. The ranges of the indexes in Eqs. (B.3.15) are $k = 1,2$ ; $i = 2,3$ ; and $j = 1,2,3,4$ .
# Step 1
For $k = 1$ , $i = 2$ , and $j$ indexing from 1 to 4,
$$
\begin{array}{l} a _ {2 1} = a _ {2 1} - a _ {1 1} \frac {a _ {2 1}}{a _ {1 1}} = 2 - 2 \left(\frac {2}{2}\right) = 0 \\ a _ {2 2} = a _ {2 2} - a _ {1 2} \frac {a _ {2 1}}{a _ {1 1}} = 1 - 2 \left(\frac {2}{2}\right) = - 1 \tag {B.3.18} \\ \end{array}
$$
$$
a _ {2 3} = a _ {2 3} - a _ {1 3} \frac {a _ {2 1}}{a _ {1 1}} = 0 - 1 \left(\frac {2}{2}\right) = - 1
$$
$$
a _ {2 4} = a _ {2 4} - a _ {1 4} \frac {a _ {2 1}}{a _ {1 1}} = 4 - 9 \left(\frac {2}{2}\right) = - 5
$$
Note that these new coefficients correspond to those of the second of Eqs. (B.3.17), where the right-side $a$ 's of Eqs. (B.3.18) are those from the previous step [here from Eqs. (B.3.16)], the right-side $a_{24}$ is really $c_{2} = 4$ , and the left-side $a_{24}$ is the new $c_{2} = -5$ .
For $k = 1$ , $i = 3$ , and $j$ indexing from 1 to 4,
$$
\begin{array}{l} a _ {3 1} = a _ {3 1} - a _ {1 1} \frac {a _ {3 1}}{a _ {1 1}} = 1 - 2 \left(\frac {1}{2}\right) = 0 \\ a _ {3 2} = a _ {3 2} - a _ {1 2} \frac {a _ {3 1}}{a _ {1 1}} = 1 - 2 \left(\frac {1}{2}\right) = 0 \tag {B.3.19} \\ \end{array}
$$
$$
a _ {3 3} = a _ {3 3} - a _ {1 3} \frac {a _ {3 1}}{a _ {1 1}} = 1 - 1 \left(\frac {1}{2}\right) = \frac {1}{2}
$$
$$
a _ {3 4} = a _ {3 4} - a _ {1 4} \frac {a _ {3 1}}{a _ {1 1}} = 6 - 9 \left(\frac {1}{2}\right) = \frac {3}{2}
$$
where these new coefficients correspond to those of the third of Eqs. (B.3.17) as previously explained.
<!-- source-page: 748 -->
# Step 2
For $k = 2$ , $i = 3$ , and $j (= k)$ indexing from 2 to 4,
$$
a _ {3 2} = a _ {3 2} - a _ {2 2} \left(\frac {a _ {3 2}}{a _ {2 2}}\right) = 0 - (- 1) \left(\frac {0}{- 1}\right) = 0
$$
$$
a _ {3 3} = a _ {3 3} - a _ {2 3} \left(\frac {a _ {3 2}}{a _ {2 2}}\right) = \frac {1}{2} - (- 1) \left(\frac {0}{- 1}\right) = \frac {1}{2} \tag {B.3.20}
$$
$$
a _ {3 4} = a _ {3 4} - a _ {2 4} \left(\frac {a _ {3 2}}{a _ {2 2}}\right) = \frac {3}{2} - (- 5) \left(\frac {0}{- 1}\right) = \frac {3}{2}
$$
where the new coefficients again correspond to those of the third of Eqs. (B.3.17), because step 1 already eliminated the coefficients of $x_{2}$ as observed in the third of Eqs. (B.3.17), and the $a$ 's on the right side of Eqs. (B.3.20) are taken from Eqs. (B.3.18) and (B.3.19).
# Step 3
By Eqs. (B.3.15), for $x_{3}$ , we have
$$
x _ {3} = \frac {1}{a _ {3 3}} (a _ {3 4} - 0)
$$
or, using $a_{33}$ and $a_{34}$ from Eqs. (B.3.20),
$$
x _ {3} = \frac {1}{\left(\frac {1}{2}\right)} \left(\frac {3}{2}\right) = 3
$$
where the summation is interpreted as zero in the second of Eqs. (B.3.15) when $r > n$ (for $x_{3}$ , $r = 4$ , and $n = 3$ ). For $x_{2}$ , we have
$$
x _ {2} = \frac {1}{a _ {2 2}} \left(a _ {2 4} - a _ {2 3} x _ {3}\right)
$$
or, using the appropriate $a$ 's from Eqs. (B.3.18),
$$
x _ {2} = \frac {1}{- 1} [ - 5 - (- 1) (3) ] = 2
$$
and for $x_{1}$ , we have
$$
x _ {1} = \frac {1}{a _ {1 1}} \left(a _ {1 4} - a _ {1 2} x _ {2} - a _ {1 3} x _ {3}\right)
$$
or, using the $a$ 's from the first of Eqs. (B.3.16),
$$
x _ {1} = \frac {1}{2} [ 9 - 2 (2) - 1 (3) ] = 1
$$
In summary, the latest $a$ 's from the previous steps have been used in Eqs. (B.3.15) to obtain the $x$ 's.
<!-- source-page: 749 -->
Note that the pivot element was the diagonal element in each step. However, the diagonal element must be nonzero because we divide by it in each step. An original matrix with all nonzero diagonal elements does not ensure that the pivots in each step will remain nonzero, because we are adding numbers to equations below the pivot in each following step. Therefore, a test is necessary to determine whether the pivot $a _ { k k }$ at each step is zero. If it is zero, the current row (equation) must be interchanged with one of the following rows—usually with the next row unless that row has a zero at the position that would next become the pivot. Remember that the right-side corresponding element in $\underline { { \boldsymbol { \mathcal { C } } } }$ must also be interchanged. After making this test and, if necessary, interchanging the equations, continue the procedure in the usual manner.
An example will now illustrate the method for treating the occurrence of a zero pivot element.
# Example B.2
Solve the following set of simultaneous equations.
$$
2 x _ {1} + 2 x _ {2} + 1 x _ {3} = 9
$$
$$
1 x _ {1} + 1 x _ {2} + 1 x _ {3} = 6 \tag {B.3.21}
$$
$$
2 x _ {1} + 1 x _ {2} \quad = 4
$$
It will often be convenient to set up the solution procedure by considering the coefficient matrix $\underline { { \boldsymbol { a } } }$ plus the right-side matrix $\underline { { \boldsymbol { \mathcal { C } } } }$ in one matrix without writing down the unknown matrix $\underline { { x } } .$ This new matrix is called the augmented matrix. For the set of Eqs. (B.3.21), we have the augmented matrix written as
$$
\left[ \begin{array}{c c c c} 2 & 2 & 1 & 9 \\ 1 & 1 & 1 & 6 \\ 2 & 1 & 0 & 4 \end{array} \right] \tag {B.3.22}
$$
We use the steps previously outlined as follows:
# Step 1
We select $a _ { 1 1 } = 2$ as the pivot and
a. Add the multiple $- a _ { 2 1 } / a _ { 1 1 } = - 1 / 2$ of the first row to the second row of Eq. (B.3.22).
b. Add the multiple $- a _ { 3 1 } / a _ { 1 1 } = - 2 / 2$ of the first row to the third row of Eq. (B.3.22) to obtain
$$
\left[ \begin{array}{c c c c} 2 & 2 & 1 & 9 \\ 0 & 0 & \frac {1}{2} & \frac {3}{2} \\ 0 & - 1 & - 1 & - 5 \end{array} \right] \tag {B.3.23}
$$
At the end of step 1, we would normally choose $a _ { 2 2 }$ as the next pivot. However, $a _ { 2 2 }$ is now equal to zero. If we interchange the second and third rows of Eq. (B.3.23), the
<!-- source-page: 750 -->
new $a _ { 2 2 }$ will be nonzero and can be used as a pivot. Interchanging rows 2 and 3 results in
$$
\left[ \begin{array}{c c c c} 2 & 2 & 1 & 9 \\ 0 & - 1 & - 1 & - 5 \\ 0 & 0 & \frac {1}{2} & \frac {3}{2} \end{array} \right] \tag {B.3.24}
$$
For this special set of only three equations, the interchange has resulted in an uppertriangular coefficient matrix and concludes the elimination procedure. The backsubstitution process of step 3 now yields
$$
x _ {3} = 3 \quad x _ {2} = 2 \quad x _ {1} = 1
$$
A second problem when selecting the pivots in sequential manner without testing for the best possible pivot is that loss of accuracy due to rounding in the results can occur. In general, the pivots should be selected as the largest (in absolute value) of the elements in any column. For example, consider the set of equations given by
$$
\begin{array}{l} 0. 0 0 2 x _ {1} + 2. 0 0 x _ {2} = 2. 0 0 \\ 2. 0 0 x _ {1} + 1. 5 0 x _ {2} = 4. 5 0 \end{array} \tag {B.3.25}
$$
$$
3. 0 0 x _ {1} + 1. 5 0 x _ {2} = 4. 5 0
$$
whose actual solution is given by
$$
x _ {1} = 1. 0 0 0 5 \quad x _ {2} = 0. 9 9 9 \tag {B.3.26}
$$
The solution by Gaussian elimination without testing for the largest absolute value of the element in any column is
$$
0. 0 0 2 x _ {1} + 2. 0 0 x _ {2} = 2. 0 0
$$
$$
- 2 9 9 8. 5 x _ {2} = - 9 9 5. 5
$$
$$
x _ {2} = 0. 3 3 2 0
$$
$$
x _ {1} = 6 6 8 \tag {B.3.27}
$$
This solution does not satisfy the second of Eqs. (B.3.25). The solution by interchanging equations is
$$
3. 0 0 x _ {1} + 1. 5 0 x _ {2} = 4. 5 0
$$
$$
0. 0 0 2 x _ {1} + 2. 0 0 x _ {2} = 2. 0 0
$$
or $3 . 0 0 x _ { 1 } + 1 . 5 0 x _ { 2 } = 4 . 5 0$
$$
1. 9 9 9 x _ {2} = 1. 9 9 7
$$
$$
x _ {2} = 0. 9 9 9
$$
$$
x _ {1} = 1. 0 0 0 5 \tag {B.3.28}
$$
Equations (B.3.28) agree with the actual solution [Eqs. (B.3.26)].