Files
MultiPhysicsVault/.raw/FiniteElementProcedures/FiniteElementProcedures_004.md
T
김경종 4cc312954f
Tests / Hermetic test suite (push) Has been cancelled
Tests / Skill frontmatter validation (push) Has been cancelled
add wiki
2026-05-28 17:16:48 +09:00

312 lines
29 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: 31 -->
Considering the use of finite element methods in the engineering sciences, while there is considerable use already, there is much further potential for development and applications. In essence, the aim in all analyses, in engineering and in the sciences, is to predict—to predict how a chosen design or a structure will perform, or to predict why and how in sciences a specific phenomenon occurs. Clearly, the human spirit is extremely interested in predicting, and when using the finite element process much can be done in that respect.
With these remarks we do not wish to suggest overconfidence but to express a realistic outlook with respect to the valuable and exciting future use of finite element procedures. For some remarks on overconfidence in regard to finite element methods, see the article “A Commentary on Computational Mechanics” by J. T. Oden and K. J. Bathe [A].
# 1.4 SOME RECENT RESEARCH ACCOMPLISHMENTS
Since the publication of the 1996 edition of this book, significant research has focused on new finite element developments, primarily, to address the solution of physical problems that before could not be solved, to alleviate the human effort required to perform a finite element analysis, and to establish computationally faster solution schemes. These aims to perform simulations more broadly and more effectively are naturally very important to be addressed in research and developments.
Numerous papers have been published on these topics, and it is hardly possible to describe in a single book all these recent developments with an exhaustive list of references while also presenting in some detail important fundamental formulations and finite element techniques which are the focus of this book. In accordance with this focus, it is however appropriate to refer to some major recent research, published in many papers, briefly here. While mostly academically excellent research accomplishments, the step from a publication of a method in a paper to its wide use is very large and, frequently, it is still questionable in how far the proposed methods will actually advance the state of simulations in practice.
A very natural further development of finite element procedures is based on “enriching the interpolation functions” used. Usually, simple polynomial functions are employed but other functions for specific problem solutions can be more effective. In fact, the best interpolation functions are clearly always those that contain the solution sought (see Section 4.3). Some of the first developments in this regard are the special crack tip elements, see S.E. Benzley [A], special pipe elements to include ovalization modes, see K.J. Bathe and C. A. Almeida [A], and special elements with discontinuities, see E.N. Dvorkin, A.M. Cuitiño, and G. Gioia, [A]. The procedure to enrich finite element interpolation functions can be valuable, in particular, for the analyses of structures with cracks and crack propagations, see N. Moës, J. Dolbow, and T. Belytschko [A], and the solution of wave propagations, see S. Ham and K.J. Bathe [A]. More recently, the approach has been named “extended finite element method” or in short XFEM, see N. Sukumar, N. Moës, B. Moran, and T. Belytschko [A], “generalized finite element method”, see T. Strouboulis, K. Copps, and I. Babuška [A], and the “partition of unity finite element method”, see J.M. Melenk and I. Babuška [A]. In essence, the usual, widely employed finite element discretizations and interpolation functions are in these approaches enriched with special functions, known to be effective for the solution of specific problems. A valuable other development for general polygonal elements preserving polynomial accuracy and continuity requirements has been proposed by L. Beirão da Veiga, F. Brezzi, A. Cangiani, G. Manzini, L.D. Marini, and A. Russo [A]. An important consideration in all developments is, of course,
<!-- source-page: 32 -->
to ensure that the overall solution is computationally always effective, in particular when considering solutions in three-dimensional complex domains, see R. Tian, G. Yagawa, and H. Terasaka [A] and S. Ham and K.J. Bathe [A].
Instead of embedding new special functions in the finite element interpolations, also “interpolation covers” can be used to increase the accuracy of the solution while always working with non-singular, well-conditioned stiffness matrices, see C.A. Duarte, I. Babuška, and J.T. Oden [A], J.H. Kim and K.J. Bathe [A,B] and H.M. Jeon, P. S. Lee, and K.J. Bathe [A]. This approach is appealing because the standard finite elements are used and covers are applied only when needed in certain areas of the finite element mesh, without remeshing. The basic idea relates to the original development of the “numerical manifold method”, see G.H. Shi [A] and G.W. Ma, X.M. An, H.H. Zhang, and L.X. Li [A].
To increase the accuracy of solution, mostly just the mesh density is increased in the areas of large solution errors. However, remeshing using traditional finite element interpolations that are continuous over the element boundaries can be computationally demanding and here the discontinuous Galerkin finite element procedures have been proposed, see F. Bassi and S. Rebay [A], D.N. Arnold, F. Brezzi, B. Cockburn, and L.D. Marini [A] and L. Noels and R. Radovitzky [A]. The elements are formulated with discontinuous interpolations, and, in theory, a mesh density can be easily increased. Various interesting forms of discontinuous finite element formulations exist.
In practice, a major effort in finite element analysis frequently pertains to the generation of a good finite element mesh. The geometry is constructed in the finite element preprocessor or taken as input to the preprocessor from a CAD package, like NX or SolidWorks. Simple geometries can directly be meshed but frequently the CAD geometry is first worked on to simplify the geometry, for example to remove small features such as small holes, or to convert a thin three-dimensional geometry into a two-dimensional surface of a shell structure. The result is a geometry tractable for analysis, that is, given in terms of lines (defining surfaces and volumes) associated with control points for the lines. This geometry is then meshed with finite elements defined by nodal points and degrees of freedom on and within the geometry. Instead of defining the elements in this way, some recent research has focused on defining the finite elements and the interpolations of solution variables directly by the CAD interpolation functions used to define the CAD geometry, with degrees of freedom located at the control points of the CAD functions. These control points are mostly not located on the CAD lines and are usually located outside the physical domain that is considered in the analysis. Much research has been focused on this interesting approach, see for example P. Kagan, A. Fischer, and P.Z. Bar-Yoseph [A] and T.J.R. Hughes, J.A. Cottrell, and Y. Bazilevs [A].
For the finite element mesh generation, today, very powerful programs are in use, but it is a specific challenge to only generate “good elements”, which means elements that are close to their natural geometries, for example in three-dimensional analysis, tetrahedral elements of equal sides and not thin and long elements. In fluid mechanics solutions, it is particularly important that the lines connecting the centers of the elements are perpendicular to the element faces (for the upwinding procedures used, see Chapter 7.4.3). The difficulty of obtaining a good mesh of elements stems, in essence, from the fact that the complete geometry needs to be covered with finite elements that do not overlap. Good element meshes can be generated quite easily in two-dimensional analyses but not so for complex three-dimensional solutions.
To by-pass the need for a mesh, so-called “meshless methods” (or meshfree methods) have been developed. Here nodal points are used with unknown solution variables, like in the finite element method, but the domains pertaining to these nodes are different. Some specific
<!-- source-page: 33 -->
developments are the “element-free Galerkin methods”, see T. Belytschko, Y.Y. Lu, and L. Gu [A], the “reproducing kernel particle methods”, see W.K. Liu, S. Jun, and Y.F. Zhang [A], the “meshless cloud method”, see T.J. Liszka, C.A.M. Duarte, and W.W. Tworzydlo [A] and J.T. Oden, C.A.M. Duarte, and O.C. Zienkiewicz [A], the “finite point method”, see E. Oñate, S. Idelsohn, O.C. Zienkiewicz, and R.L. Taylor [A], the “meshless Petrov-Galerkin method”, see S.N. Atluri and T. Zhu [A], the “method of finite spheres”, see S. De and K.J. Bathe [A, B] and J.W. Hong and K.J. Bathe [A], and “particle methods”, see T. Rabczuk, T. Belytschko, and S.P. Xiao [A] and G.R. Liu [A]. While the basic ideas of meshless methods are very appealing, the difficulties are in the expense of the numerical integrations and, sometimes, in the use of numerical factors (undesirable in practice) to have a stable scheme. Of course, in principle, the interpolation enhancements mentioned above can also be embedded into meshless methods, see S. Ham, B. Lai, and K.J. Bathe [A].
Considering the method of finite spheres, it can be thought of as a finite element method in which the elements (here now the discs, spheres) overlap. Using "overlapping finite elements" (including quadrilaterals and bricks, and only near the boundaries of a CAD domain) coupled with traditional finite elements, an analysis scheme with much promise has been proposed for CAD driven analyses in K.J. Bathe [M] and K.J. Bathe and L. Zhang [A].
Significant further research effort has also been directed to the more effective analysis of shells. These structures are very difficult to analyze because of their extremely rich linear and nonlinear behavior, see D. Chapelle and K.J. Bathe [B,E]. Progress has been achieved in establishing more encompassing formulations, see M. Bischoff and E. Ramm [A], D. Chapelle, A. Ferent, and K.J. Bathe [A], T. Sussman and K.J. Bathe [D], formulating new elements, see P.S. Lee and K.J. Bathe [A], proposing different discretization techniques, see F. Cirak, M. Ortiz, and P. Schröder [A] and identifying stringent test problems with appropriate norms to measure the solution accuracy, see K.J. Bathe and P.S. Lee [A]. As pointed out in Section 5.4.2, the stringent testing of any shell discretization technique is very important, see D. Chapelle and K.J. Bathe [E].
Of much interest in engineering practice is the solution of increasingly larger finite element systems. This is achieved through combinations of sparse and iterative solvers in parallel processing, on shared and distributed memory machines. Finite element solutions with millions of degrees of freedom are now routinely obtained, see for example K.J. Bathe [J, K], and this trend towards the solution of larger finite element models must be expected to continue.
Today, an increased emphasis of finite element analysis is on the solution of fluid-structure interactions, see S. Rugonyi and K.J. Bathe [A], and general multiphysics problems involving structures, fluids and electromagnetics, see K.J. Bathe, H. Zhang, and Y. Yan [A]. Simulations are performed from the nano- to the kilometer scales, like the modeling of proteins and DNA structures, see e.g. M. Bathe [A], to the modeling of the earth crust for understanding earthquakes. The possible applications are vast in the various fields of engineering and the sciences, and simulations will be possible and pursued to an ever increasing extent, due to the increase in capabilities of software and hardware. Indeed, we may conjecture that “we are still only at the beginning of all the many and varied simulations that will be performed in the future because to understand and predict is a basic and most valuable desire of mankind.”
In many of these developments and applications, the finite element procedures given in this book are fundamental ingredients that have been built upon. The procedures given in the book are those that we can expect to be used for a long time, because they are reliable and effective, they are used already extensively in practice, and represent foundations for many further developments.
<!-- source-page: 34 -->
# Vectors, Matrices, and Tensors
# 2.1 INTRODUCTION
The use of vectors, matrices, and tensors is of fundamental importance in engineering analysis because it is only with the use of these quantities that the complete solution process can be expressed in a compact and elegant manner. The objective of this chapter is to present the fundamentals of matrices and tensors, with emphasis on those aspects that are important in finite element analysis.
From a simplistic point of view, matrices can simply be taken as ordered arrays of numbers that are subjected to specific rules of addition, multiplication, and so on. It is of course important to be thoroughly familiar with these rules, and we review them in this chapter.
However, by far more interesting aspects of matrices and matrix algebra are recognized when we study how the elements of matrices are derived in the analysis of a physical problem and why the rules of matrix algebra are actually applicable. In this context, the use of tensors and their matrix representations are important and provide a most interesting subject of study.
Of course, only a rather limited discussion of matrices and tensors is given here, but we hope that the focused practical treatment will provide a strong basis for understanding the finite element formulations given later.
<!-- source-page: 35 -->
# 2.2 INTRODUCTION TO MATRICES
The effectiveness of using matrices in practical calculations is readily realized by considering the solution of a set of linear simultaneous equations such as
$$
5 x _ {1} - 4 x _ {2} + x _ {3} = 0
$$
$$
- 4 x _ {1} + 6 x _ {2} - 4 x _ {3} + x _ {4} = 1 \tag {2.1}
$$
$$
x _ {1} - 4 x _ {2} + 6 x _ {3} - 4 x _ {4} = 0
$$
$$
x _ {2} - 4 x _ {3} + 5 x _ {4} = 0
$$
where the unknowns are $x_{1}, x_{2}, x_{3}$ , and $x_{4}$ . Using matrix notation, this set of equations is written as
$$
\left[ \begin{array}{r r r r} 5 & - 4 & 1 & 0 \\ - 4 & 6 & - 4 & 1 \\ 1 & - 4 & 6 & - 4 \\ 0 & 1 & - 4 & 5 \end{array} \right] \left[ \begin{array}{l} x _ {1} \\ x _ {2} \\ x _ {3} \\ x _ {4} \end{array} \right] = \left[ \begin{array}{l} 0 \\ 1 \\ 0 \\ 0 \end{array} \right] \tag {2.2}
$$
where it is noted that, rather logically, the coefficients of the unknowns (5, -4, 1, etc.) are grouped together in one array; the left-hand-side unknowns $(x_{1}, x_{2}, x_{3}, \text{and } x_{4})$ and the right-hand-side known quantities are each grouped together in additional arrays. Although written differently, the relation (2.2) still reads the same way as (2.1). However, using matrix symbols to represent the arrays in (2.2), we can now write the set of simultaneous equations as
$$
\mathbf {A} \mathbf {x} = \mathbf {b} \tag {2.3}
$$
where A is the matrix of the coefficients in the set of linear equations, x is the matrix of unknowns, and b is the matrix of known quantities; i.e.,
$$
\mathbf {A} = \left[ \begin{array}{r r r r} 5 & - 4 & 1 & 0 \\ - 4 & 6 & - 4 & 1 \\ 1 & - 4 & 6 & - 4 \\ 0 & 1 & - 4 & 5 \end{array} \right]; \quad \mathbf {x} = \left[ \begin{array}{l} x _ {1} \\ x _ {2} \\ x _ {3} \\ x _ {4} \end{array} \right]; \quad \mathbf {b} = \left[ \begin{array}{l} 0 \\ 1 \\ 0 \\ 0 \end{array} \right] \tag {2.4}
$$
The following formal definition of a matrix now seems apparent.
Definition: A matrix is an array of ordered numbers. A general matrix consists of mn numbers arranged in m rows and n columns, giving the following array:
$$
\mathbf {A} = \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 _ {m 1} & a _ {m 2} & \dots & a _ {m n} \end{array} \right] \tag {2.5}
$$
We say that this matrix has order $m \times n$ (m by n). When we have only one row (m = 1) or one column (n = 1), we also call A a vector. Matrices are represented in this book by boldface letters, usually uppercase letters when they are not vectors. On the other hand, vectors can be uppercase or lowercase boldface.
<!-- source-page: 36 -->
We therefore see that the following are matrices:
$$
\left[ \begin{array}{l} 1 \\ 2 \end{array} \right]; \quad \left[ \begin{array}{c c c} 1 & 4 & - 5. 3 \\ 3 & 2. 1 & 6 \end{array} \right]; \quad \left[ \begin{array}{l l l} 6. 1 & 2. 2 & 3 \end{array} \right] \tag {2.6}
$$
where the first and the last matrices are also column and row vectors, respectively.
A typical element in the ith row and jth column of A is identified as $a_{ij}$ ; e.g., in the first matrix in (2.4), $a_{11} = 5$ and $a_{12} = -4$ . Considering the elements $a_{ij}$ in (2.5), we note that the subscript i runs from 1 to m and the subscript j runs from 1 to n. A comma between subscripts will be used when there is any risk of confusion, e.g., $a_{1+r, j+s}$ , or to denote differentiation (see Chapter 6).
In general, the utility of matrices in practice arises from the fact that we can identify and manipulate an array of many numbers by use of a single symbol. We shall use matrices in this way extensively in this book.
# Symmetric, Diagonal, and Banded Matrices; A Storage Scheme
Whenever the elements of a matrix obey a certain law, we can consider the matrix to be of special form. A real matrix is a matrix whose elements are all real. A complex matrix has elements that may be complex. We shall deal only with real matrices. In addition, the matrix will often be symmetric.
Definition: The transpose of the $m \times n$ matrix A, written as $A^{T}$ , is obtained by interchanging the rows and columns in A. If $A = A^{T}$ , it follows that the number of rows and columns in A are equal and that $a_{ij} = a_{ji}$ . Because m = n, we say that A is a square matrix of order n, and because $a_{ij} = a_{ji}$ , we say that A is a symmetric matrix. Note that symmetry implies that A is square, but not vice versa; i.e., a square matrix need not be symmetric.
For example, the coefficient matrix $\mathbf{A}$ in (2.2) is a symmetric matrix of order 4. We can verify that $\mathbf{A}^T = \mathbf{A}$ by simply checking that $a_{ji} = a_{ij}$ for $i, j = 1, \ldots, 4$ .
Another special matrix is the identity (or unit) matrix $I_{n}$ , which is a square matrix of order n with only zero elements except for its diagonal entries, which are unity. For example, the identity matrix of order 3 is
$$
\mathbf {I} _ {3} = \left[ \begin{array}{l l l} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right] \tag {2.7}
$$
In practical calculations the order of an identity matrix is often implied and the subscript is not written. In analogy with the identity matrix, we also use identity (or unit) vectors of order n, defined as $e_{i}$ , where the subscript i indicates that the vector is the ith column of an identity matrix.
We shall work abundantly with symmetric banded matrices. Bandedness means that all elements beyond the bandwidth of the matrix are zero. Because A is symmetric, we can state this condition as
$$
a _ {i j} = 0 \quad \text { for } j > i + m _ {\mathrm{A}} \tag {2.8}
$$
<!-- source-page: 37 -->
where $2m_{A} + 1$ is the bandwidth of A. As an example, the following matrix is a symmetric banded matrix of order 5. The half-bandwidth $m_{A}$ is 2:
$$
\mathbf {A} = \left[ \begin{array}{l l l l l} 3 & 2 & 1 & 0 & 0 \\ 2 & 3 & 4 & 1 & 0 \\ 1 & 4 & 5 & 6 & 1 \\ 0 & 1 & 6 & 7 & 4 \\ 0 & 0 & 1 & 4 & 3 \end{array} \right] \tag {2.9}
$$
If the half-bandwidth of a matrix is zero, we have nonzero elements only on the diagonal of the matrix and denote it as a diagonal matrix. For example, the identity matrix is a diagonal matrix.
In computer calculations with matrices, we need to use a scheme of storing the elements of the matrices in high-speed storage. An obvious way of storing the elements of a matrix A of order $m \times n$ is simply to dimension in the FORTRAN program an array A(M, N), where M = m and N = n, and store each matrix element $a_{ij}$ in the storage location A(I, J). However, in many calculations we store in this way unnecessarily many zero elements of A, which are never needed in the calculations. Also, if A is symmetric, we should probably take advantage of it and store only the upper half of the matrix, including the diagonal elements. In general, only a restricted number of high-speed storage locations are available, and it is necessary to use an effective storage scheme in order to be able to take into high-speed core the maximum matrix size possible. If the matrix is too large to be contained in high-speed storage, the solution process will involve reading and writing on secondary storage, which can add significantly to the solution cost. Fortunately, in finite element analysis, the system matrices are symmetric and banded. Therefore, with an effective storage scheme, rather large-order matrices can be kept in high-speed core.
Let us denote by A(I) the Ith element in the one-dimensional storage array A. A diagonal matrix of order n would simply be stored as shown in Fig. 2.1(a):
$$
\mathrm{A} (\mathrm{I}) = a _ {i i}; \quad \mathrm{I} = i = 1, \dots , n \tag {2.10}
$$
Consider a banded matrix as shown in Fig. 2.1(b). We will see later that zero elements within the “skyline” of the matrix may be changed to nonzero elements in the solution process; for example, $a_{35}$ may be a zero element but becomes nonzero during the solution process (see Section 8.2.3). Therefore we allocate storage locations to zero elements within the skyline but do not need to store zero elements that are outside the skyline. The storage scheme that will be used in the finite element solution process is indicated in Fig. 2.1 and is explained further in Chapter 12.
# Matrix Equality, Addition, and Multiplication by a Scalar
We have defined matrices to be ordered arrays of numbers and identified them by single symbols. In order to be able to deal with them as we deal with ordinary numbers, it is necessary to define rules corresponding to those which govern equality, addition, subtraction, multiplication, and division of ordinary numbers. We shall simply state the matrix rules and not provide motivation for them. The rationale for these rules will appear later, as it will turn out that these are precisely the rules that are needed to use matrices in the
<!-- source-page: 38 -->
$$
\left[ \begin{array}{cccccccc}a_{11} & & & & & & \\ & a_{22} & & & \text{Elements not} & & \\ & & a_{33} & & & & \\ & & & & a_{44} & & & & & & & & \\ & & & & & \ddots & & & & & & & \\ & & & & & & \ddots & & & & & & \\ & & & & & & & & \ddots & & & & \\ & & & & & & & & & & a_{nn} & & \\ \end{array} \right].\]
\[
A(1) = a_{11}, A(2) = a_{22}, A(3) = a_{33}, A(4) = a_{44}, \ldots, A(N) = a_{nn}
$$
(a) Diagonal matrix
![](images/page-038_257e4208283969cda0e7b5e998839623bc8f3679fbc2c8afaa2700ae3da1d826.jpg)
<details>
<summary>text_image</summary>
m_A + 1 = 4
Skyline
a_{11} 0 a_{13} 0
a_{22} a_{23} 0 a_{25}
a_{33} a_{34} a_{35} 0
a_{44} a_{45} a_{46}
symmetric
A(1) = a_{11}, A(2) = a_{22},
A(3) = a_{33}, A(4) = a_{23},
A(5) = a_{13}, A(6) = a_{44},
A(7) = a_{34}, A(8) = a_{55},
A(9) = a_{45}, A(10) = a_{35},
A(11) = a_{25}, A(12) = a_{66},
etc.
</details>
(b) Banded matrix, $m_{A}=3$
Figure 2.1 Storage of matrix A in a one-dimensional array
solution of practical problems. For matrix equality, matrix addition, and matrix multiplication by a scalar, we provide the following definitions.
Definition: The matrices A and B are equal if and only if
1. A and B have the same number of rows and columns.
2. All corresponding elements are equal; i.e. $a_{ij} = b_{ij}$ for all i and j.
Definition: Two matrices A and B can be added if and only if they have the same number of rows and columns. The addition of the matrices is performed by adding all corresponding elements; i.e., if $a_{ij}$ and $b_{ij}$ denote general elements of A and B, respectively, then $c_{ij} = a_{ij} + b_{ij}$ denotes a general element of C, where $C = A + B$ . It follows that C has the same number of rows and columns as A and B.
EXAMPLE 2.1: Calculate $\mathbf{C} = \mathbf{A} + \mathbf{B}$ , where
$$
\mathbf {A} = \left[ \begin{array}{l l l} 2 & 1 & 1 \\ 0. 5 & 3 & 0 \end{array} \right]; \quad \mathbf {B} = \left[ \begin{array}{l l l} 3 & 1 & 2 \\ 2 & 4 & 1 \end{array} \right]
$$
Here we have $\mathbf{C} = \mathbf{A} + \mathbf{B} = \begin{bmatrix} 5 & 2 & 3 \\ 2.5 & 7 & 1 \end{bmatrix}$
<!-- source-page: 39 -->
It should be noted that the order in which the matrices are added is not important. The subtraction of matrices is defined in an analogous way.
EXAMPLE 2.2: Calculate C = A - B, where A and B are given in Example 2.1. Here we have
$$
\mathbf {C} = \mathbf {A} - \mathbf {B} = \left[ \begin{array}{c c c} - 1 & 0 & - 1 \\ - 1. 5 & - 1 & - 1 \end{array} \right]
$$
From the definition of the subtraction of matrices, it follows that the subtraction of a matrix from itself results in a matrix with zero elements only. Such a matrix is defined to be a null matrix 0. We turn now to the multiplication of a matrix by a scalar.
Definition: A matrix is multiplied by a scalar by multiplying each matrix element by the scalar; i.e., C = kA means that $c_{ij} = ka_{ij}$ .
The following example demonstrates this definition.
EXAMPLE 2.3: Calculate C = kA, where
$$
\mathbf {A} = \left[ \begin{array}{l l l} 2 & 1 & 1 \\ 0. 5 & 3 & 0 \end{array} \right]; \quad k = 2
$$
We have $\mathbf{C} = k\mathbf{A} = \begin{bmatrix} 4 & 2 & 2 \\ 1 & 6 & 0 \end{bmatrix}$
It should be noted that so far all definitions are completely analogous to those used in the calculation with ordinary numbers. Furthermore, to add (or subtract) two general matrices of order $n \times m$ requires nm addition (subtraction) operations, and to multiply a general matrix of order $n \times m$ by a scalar requires nm multiplications. Therefore, when the matrices are of special form, such as symmetric and banded, we should take advantage of the situation by evaluating only the elements below the skyline of the matrix C because all other elements are zero.
# Multiplication of Matrices
We consider two matrices A and B and want to find the matrix product C = AB.
Definition: Two matrices A and B can be multiplied to obtain C = AB if and only if the number of columns in A is equal to the number of rows in B. Assume that A is of order $p \times m$ and B is of order $m \times q$ . Then for each element in C we have
$$
c _ {i j} = \sum_ {r = 1} ^ {m} a _ {i r} b _ {r j} \tag {2.11}
$$
where $\mathbf{C}$ is of order $p \times q$ ; i.e., the indices $i$ and $j$ in (2.11) vary from 1 to $p$ and 1 to $q$ , respectively.
Therefore, to calculate the $(i,j)$ th element in C, we multiply the elements in the ith row of A by the elements in the jth column of B and add all individual products. By taking the product of each row in A and each column in B, it follows that C must be of order $p \times q$ .
<!-- source-page: 40 -->
EXAMPLE 2.4: Calculate the matrix product C = AB, where
$$
\mathbf {A} = \left[ \begin{array}{l l l} 5 & 3 & 1 \\ 4 & 6 & 2 \\ 1 0 & 3 & 4 \end{array} \right]; \quad \mathbf {B} = \left[ \begin{array}{l l} 1 & 5 \\ 2 & 4 \\ 3 & 2 \end{array} \right]
$$
We have $c_{11} = (5)(1) + (3)(2) + (1)(3) = 14$
$$
c _ {2 1} = (4) (1) + (6) (2) + (2) (3) = 2 2
$$
$$
c _ {3 1} = (1 0) (1) + (3) (2) + (4) (3) = 2 8 \quad \text { etc. }
$$
Hence we obtain $\mathbf{C} = \begin{bmatrix} 14 & 39 \\ 22 & 48 \\ 28 & 70 \end{bmatrix}$
As can readily be verified, the number of multiplications required in this matrix multiplication is $p \times q \times m$ . When we deal with matrices in practice, however, we can often reduce the number of operations by taking advantage of zero elements within the matrices.
EXAMPLE 2.5: Calculate the matrix product c = Ab, where
$$
\mathbf {A} = \left[ \begin{array}{c c c c} 2 & - 1 & 0 & 0 \\ & 2 & - 1 & 0 \\ & & 2 & - 1 \\ \text { symmetric } & & & 1 \end{array} \right]; \quad \mathbf {b} = \left[ \begin{array}{l} 4 \\ 1 \\ 2 \\ 3 \end{array} \right]
$$
Here we can take advantage of the fact that the bandwidth of A is 3; i.e., $m_{A} = 1$ . Thus, taking into account only the elements within the band of A, we have
$$
c _ {1} = (2) (4) + (- 1) (1) = 7
$$
$$
c _ {2} = (- 1) (4) + (2) (1) + (- 1) (2) = - 4
$$
$$
c _ {3} = (- 1) (1) + (2) (2) + (- 1) (3) = 0
$$
$$
c _ {4} = (- 1) (2) + (1) (3) = 1
$$
Hence $\mathbf{c} = \begin{bmatrix} 7 \\ -4 \\ 0 \\ 1 \end{bmatrix}$
As is well known, the multiplication of ordinary numbers is commutative; i.e., ab = ba. We need to investigate if the same holds for matrix multiplication. If we consider the matrices
$$
\mathbf {A} = \left[ \begin{array}{l} 1 \\ 2 \end{array} \right]; \quad \mathbf {B} = \left[ \begin{array}{l l} 3 & 4 \end{array} \right] \tag {2.12}
$$
we have $\mathbf{AB} = \begin{bmatrix} 3 & 4 \\ 6 & 8 \end{bmatrix}$ ; $\mathbf{BA} = [11]$ (2.13)