CH 11 1
CH 11 1
2
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
In matrix form;
[ A]{ X } {B}
where A (coefficient matrix) is a n x n matrix, and X and B
are n x 1 vectors.
3
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Matrix definitions
4
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• Transpose
aijT a ji
•Determinant
n
D det A (1)i j aij M ij for any i=1, 2 ...n
j 1
•Inverse
If matrix A is nonsingular (det≠0) and square, A-1 is the inverse such
that
1
A A I
5
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Matrix operations
Cnxl = AnxmBmxl
AB BA
6
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
If you need to work more than one linear equations, a system
of linear equations must be solved simultaneously.
8
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Jacobi Iterative Method
n
1
xi ( k 1)
aii j 1
( aij x j ) bi
(k )
i 1,2 n
j i
10
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
4. Terminate the procedure when
a s
or max. number of iterations is reached.
How to define εa
We have vectors so we’ll use norms to to define εa
X ( k 1) X ( k )
a ( k 1)
X ( k 1)
x max xi
1i n
p norm
1/ p
n
p
x p xi
i 1
n
p=1 x 1 xi
i 1
1/ 2
2
n
p=2 x 2 xi Euclidean norm
i 1 12
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The distance between two vectors is defined as the norm of the
difference of the vectors.
y y1 y2 yn T
x y max xi yi
1i n
1/ 2
n
2
x y 2 ( xi yi )
i 1
13
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 11.1
Solve the linear system with Jacobi iterative method
4 x1 x2 x3 7
4 x1 8 x2 x3 21 x ( 0)
1 2 2 T
2 x1 x2 5 x3 15
iter. no x1 x2 x3
0 1 2 2
1 1.75 3.375 3
2 1.8438 3.875 3.025
3 1.9625 3.925 2.963
4 1.9906 3.9766 3
14
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Gauss-Seidel Method
The Gauss-Seidel method is a commonly used iterative
method. It is same as Jacobi technique except that it uses the
latest values of x’s.
1 i 1 n
ij j )
( k 1) ( k 1)
xi ( a x (aij x (jk ) ) bi i 1,2n
aii j 1 j i 1
15
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 11.2
Solve the linear system with Gauss-Seidel iterative method
5 x1 2 x2 3x3 1
3x1 9 x2 x3 2
x ( 0) 0 0 0
T
2 x1 x2 7 x3 3
Iterate until εa ≤ 0.02 . Use maximum magnitude norm to
calculate εa .
iter.no x1 x2 x3 εa
0 0 0 0
1 -0.2000 0.1556 -0.5079
2 0.1670 0.3343 -0.4286 0.8562
3 0.1909 0.3335 -0.4217 0.0567
4 0.1864 0.3312 -0.4226 0.0107
16
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Convergence criterion
iter.no x1 x2 x3 εa
0 1 2 2
21
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.