AM-lecture 4
AM-lecture 4
AM-lecture 4
1
1. Gaussian elimination method
Step 1: Elimination
2
In this step, the solution is obtained by back substi-
tution step-by-step.
.. = ..
.. .. ... .. .. ... .. ..
an1 an2 ... ann bn an1 an2 ... ann an,n+1
For k = 1, 2, . . . , n:
3
(1)
1 a12 ... a1k a1,k+1 . . . akn b1
0 1 ... a2k a2,k+1 . . . akn b2
......
0 0 ... akk ak,k+1 . . . akn bk
0 0 ... ak+1,k ak+1,k+1 . . . ak+1,n bk+1
.. .. . . . .. ..
0 0 . . . an,k an,k+1 . . . ann bn
(2) If akk ̸= 0,
4
akj
akj = (j = k + 1, k + 2, · · · , n + 1)
akk
aij = −aik akj + aij
(i = k + 1, k + 2, · · · , n; j = k + 1, k + 2, · · · , n + 1)
akk = 1
aik = 0 (i = k + 1, k + 2, · · · , n)
x n = bn
n
x i = bi − aik xk (i = n − 1, n − 2, . . . , 1)
X
k=i+1
5
Example 1. Solve the following equations with Gaus-
sian elimination method.
2x2 + 3x3 = 8
4x1 + 6x2 + 7x3 = −3
2x1 + x2 + 6x3 = 5
2. Elimination
0 2 3 8
4 6 7 −3
2 1 6 5
6
4 6 7 −3
0 2 3 8
2 1 6 5
1 32
0 4
−2 25 13
0
2
7
3 7
− 43
1 2 4
3
0 1 4
2
11 29
0 0
2 2
2
row (3)× 11 gives
3 7
− 43
1 2 4
1 32
0 4
29
0 0 1
11
3. Back substitution
29
x3 = 11
x2 = 4 − 32 x1 = 4 − 32 × 29
11 =
1
22
x1 = − 34 − 23 x2 − 74 x3 = − 34 − 23 × 22
1
− 74 × 29 239
11 = − 11
8
2. Problems and Measures for Improving
Solutions
SF x1 x2 Error of x1 (%)
3 -3.00 0.667 1099
4 0.0000 0.6667 100
5 0.30000 0.66667 10
6 0.330000 0.666667 1
7 0.3330000 0.6666667 0.1
10
(3) By column pivoting Gaussian elimination, the sys-
tem becomes
x1 + x2 = 1
0.0003x1 + 3x2 = 2.0001
SF x1 x2 Error of x1 (%)
3 0.333 0.667 0.1
4 0.3333 0.6667 0.01
5 0.33333 0.66667 0.001
6 0.333333 0.666667 0.0001
7 0.3333333 0.6666667 0.00001
11
2.2 Ill-conditioned systems
2 × 10 − 2 × 10.4
x1 = =4
1 × 2 − 2 × 1.1
12
1 × 10.4 − 1.1 × 10
x2 = =3
1 × 2 − 2 × 1.1
2 × 10 − 2 × 10.4
x1 = =8
1 × 2 − 2 × 1.05
1 × 10.4 − 1.05 × 10
x2 = =1
1 × 2 − 2 × 1.05
It shows that slight change in the system parameter can
lead to large change in solution. This is one of the be-
haviors of the ill-conditioned system.
a11 b1
x2 = − x1 +
a12 a12
a21 b2
x2 = − x1 +
a22 a22
14
a11 a21
≈
a12 a22
or
a11 a21 a11a22 − a12a21
− = ≈0
a12 a22 a12a22
15
and
x1 + 2x2 = 10
(b)
1.1x + 2x = 10.4
1 2
Solution:
3x1 + 2x2 = 18
(a)
−x + 2x = 2
1 2
x1 + 32 x2 = 6
1
− x + x = 1
2 1 2
and
2 2 −1
D =1× − × = 1.333
3 3 2
17
x1 + 2x2 = 10
(b)
1.1x + 2x = 10.4
1 2
and
D = 0.5 × 1 − 1 × 0.55 = −0.05
(c) The scaled system (c) is the same as the scaled sys-
tem (b) and then their determinants are also the same.
18
2.3 Singular system
x + x = 2
1 2
20
x2 = 0.99998 ≈ 1.00.
4
−5.00 × 10 x = −5.00 × 10
4
2
x + x = 2
1 2
21
which can be solved for x1 = x2 = 1.00.
The scaling leads to the need for pivoting and the piv-
oting leads to correct answer.
22
4. Solutions of Nonlinear Algebraic Equa-
tions
Assignment 4:
24
−3x1 − 6x2 + 2x3 = −61.5
x1 + x2 + 5x3 = −21.5
10x1 + 2x2 − x3 = 27
25