Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Numerical Methods
Chapter 1
Systems of Linear Algebraic Equations
Systems of Linear Algebraic
Equations
. . ... ... .
an1 an 2 ... ... amn
(i = 1, 2,…,n; j = 1, 2,…,m)
Special Types of Matrices
Vectors are a special type of matrix which has only one column or
one row. A column vector is an n x 1 matrix. Thus,
x1
x = [xj] = x2 (i = 1, 2,…,n)
...
xn
A row vector is a 1 x n matrix. For example,
y = [yj] = y1 y2 ... yn (j = 1, 2,…,n)
is a 4 x 4 diagonal matrix.
The identity matrix I is a diagonal matrix with unity diagonal
elements. The matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
is the 4 x 4 identity matrix.
Special Types of Matrices
A triangular matrix is a square matrix in which all of the elements
on one side of the major diagonal are zero. The remaining
elements may be zero or nonzero. An upper triangular matrix U
has all zero elements below the major diagonal. The matrix
a11 a12 a13 a14
0 a a a24
22 23
0 0 a33 a34
0 0 0 a44
is a 4 x 4 upper triangular matrix. A lower triangular matrix L has all
zero elements above the major diagonal. The matrix
a11 0 0 0
a a 0 0
21 22
a31 a32 a33 0
41 42 43 44
a a a a
2 −1 3 1 − 3 1 − 4 3
3 − 2 0 − 5 4 − 5 3 − 6
A= B=
4 1 1 − 3 5 4 −2 4
− 2 5 6 4 7 − 2 5 − 2
Matrix Algebra
Matrix multiplication consists of row-element to column-element
multiplication and summation of the resulting products. Multiplication
of the two matrices A and B is defined only when the number of
columns of matrix A is the same as the number of rows of matrix B.
Matrices that satisfy this condition are called conformable in the order
AB. Thus, if the size of matrix A is n x m and the size of matrix B is m x r,
then
AB = [aij][bij] = [cij] = C
where m
cij = aik bkj (i = 1, 2,..,n, j = 1, 2,…,n)
k =1
The size of matrix C is n x r. Matrices that are not conformable cannot
be multiplied.
Matrix Algebra
Example: Find AB given that
1 1 3 2 3 5
A = 5 3 1 B = 3 1 − 2
2 3 1 1 3 4
Multiplication of the matrix A by the scalar consists of
multiplying each element of A by .
Thus,
A = [aij] = [aij] = [bij] = B
Stages in LU Factorization
1. Solve for L and U
2. Use Ly = b to solve for y.
3. Use Ux = y to solve for x.
LU Factorization Method
Example 1. Use Doolittle’s LU factorization method to solve the
system
− 2 x1 + 3x2 + x3 − x4 = 8
3 x1 + 4 x2 − 5 x3 + 2 x4 = 2
x1 − 2 x2 + x3 + 4 x4 = 0
x1 + 7 x2 − 4 x3 − 6 x4 = 3
Example 2. Solve the system given in the previous problem using
Crout’s LU factorization method.
System Condition
A well-conditioned system is one in which a small change in any
of the elements of the system causes only a small change in the
solution of the system.
An ill-conditioned system is one in which a small change in any
of the elements of the system causes a large change in the
solution of the problem.
System Condition
Illustration: Solve the system
x1 + x2 = 2
x1 + 1.0001x2 = 2.0001
1 i −1 n
(k )
= bi − aij x j − aij x j (i = 1, 2,…,n)
( k +1)
(7) xi
(k )
aii j =1 j =i +1
The Jacobi Iteration method
Or equivalently,
aii
i i i ij j
j =1
8 x1 − x2 + 4 x3 + 3 x4 = 21
3 x1 − 5 x2 + x3 − x4 = 9
4 x1 − x2 + 8 x3 + 2 x4 = 3
4 x1 + 3 x2 − 2 x3 − 10 x4 = −10
(x )
1/ 2
n xi n x
2
i max
or i
xi i =1 xi i =1 xi
Gauss-Seidel Iteration Method
This method is similar to the Jacobi method, except that the most
recently calculated values of all xi are used in all computations.
Thus,
(11) 1 (k )
i −1 n
= bi − aij x j − aij x j
( k +1) ( k +1)
xi
aii j =1 j = i +1
or,
(k )
( k +1) Ri
= xi +
(k )
x
(12) i aii
i −1 n
= bi − aij x j − aij x j
(k ) ( k +1) (k )
(13)
Ri
j =1 j =1
Gauss-Seidel Iteration Method
Example: Solve
8 x1 − x2 + 4 x3 + 3 x4 = 21
3 x1 − 5 x2 + x3 − x4 = 9
4 x1 − x2 + 8 x3 + 2 x4 = 3
4 x1 + 3 x2 − 2 x3 − 10 x4 = −10