CE304-Unit 3-Lect1-Jumah2018
CE304-Unit 3-Lect1-Jumah2018
1
In Unit 2, we determined the value x
This image cannot currently be display ed.
2
Still remember all these??
This image cannot currently be display ed.
3
Linear Algebraic
Equation Solvers
4
Gauss Elimination
Basic for linear equation solving on
many popular software packages.
Called as Gauss elimination because it
involves combining equations to eliminate
unknowns.
For solving small sets of equation (n≤ 3),
use graphical method, Cramer’s rule and
elimination of unknown.
Graphical method
a11 x1 a12 x2 b1 Example 9.1
a21 x1 a22 x2 b2 (Note: Determinant = D = 8)
a b
x2 11 x1 1
a12 a12
a b
x2 21 x1 2
a22 a 22
5
a) No solution, b) infinite solutions, and c) ill-conditioned system
where slopes are so close that the point of intersection is difficult to
detect visually
See Example 9.2:
Note: (Determinant = D)
a) D = 0, b) D = 0, and c) D = -0.04
Cramer’s rule
Cramer’s rule expresses the solution of a systems of
linear equations in terms of ratios of determinants.
AX B
a11 a12 a13
a a a a a a
A a21 a22 a23 D A a11 a22 a23 a12 a21 a23 a13 a21 a22
32 33 31 33 31 32
a31 a32 a33
6
Example 9.3 0.3 x1 0.52 x2 x 3 0.01
Use Cramer’s rule to solve: 0.5 x1 x2 1.92 x3 0.67
0.1 x1 0.3 x2 0.5 x3 0.44
Check it
1 1.9 0.5 1.9 0.5 1
D 0.3 0.52 1 0.0022
0.3 0.5 0.1 0.5 0.1 0.3
Elimination of unknown
Solve one of the equations of the set for one of the unknowns and to
eliminate that variable from the remaining equations by substitution.
Example: Set of two equations
a11 x1 a12 x2 b1
a21 x1 a22 x2 b2
Eliminating x1:
7
Elimination of unknown
a12 b2 a22 b1
x1
a12a21 a11a22
See example 9.4
8
Forward Elimination
The goal of Forward Elimination is to transform the
coefficient matrix into an Upper Triangular Matrix
Try this??
25 5 1 25 5 1
64 8 1 0 4.8 1.56
144 12 1 0 0 0.7
Forward Elimination
Linear Equations
A set of n equations and n unknowns
9
Forward Elimination
Transform to an Upper Triangular Matrix
Step 1: Eliminate x1 in 2nd equation using equation 1 as
the pivot equation
Eqn1
(a21 )
a
11
Which will yield
a21 a a
a21 x1 a12 x2 ... 21 a1n x n 21 b1
a11 a11 a11
Forward Elimination
Zeroing out the coefficient of x1 in the 2nd equation.
Subtract this equation from 2nd equation
a21 a a
a22 a12 x2 ... a2 n 21 a1n xn b2 21 b1
a11 a11 a11
Or Where
a21
'
a 22 x2 ... a2' n xn b2'
'
a22 a22 a
a11 12
a21
a2' n a2n a1n
a11
10
Forward Elimination
Repeat this procedure for the remaining equations to
reduce the set of equations as
a11 x1 a12 x2 a13 x3 ... a1n xn b1
'
a 22 x 2 a23
'
x3 ... a2' n x n b2'
'
a32 x2 a33
'
x3 ... a3' n x n b3'
. . .
. . .
. . .
Forward Elimination
Step 2: Eliminate x2 in the 3rd equation.
Equivalent to eliminating x1 in the 2nd equation
using equation 2 as the pivot equation.
Eqn2
Eqn3 (a32 )
a22
11
Forward Elimination
This procedure is repeated for the remaining equations to
reduce the set of equations as
Forward Elimination
Continue this procedure by using the third equation as the pivot
equation and so on.
At the end of (n-1) Forward Elimination steps, the system of
equations will look like:
12
Forward Elimination
At the end of the Forward Elimination steps
Back Substitution
13
Back Substitution
bn( n1)
xn ( n1)
ann
Back Substitution
Representing Back Substitution for all equations by
formula
n
b( i 1)
i a
j i 1
( i 1)
ij xj
xi ( i 1)
for i = n - 1, n - 2, ...,1
a ii
and
bn( n 1)
xn ( n1)
ann
14
Example 9.5 3.0 x1- 0.1 x2 - 0.2 x3 = 7.85 (1)
0.1 x1+ 7.0 x2 - 0.3 x3 = -19.3 (2)
Forward elimination: 0.3 x1- 0.2 x2 + 10.0 x3 = 71.4 (3)
(3) x3 = 7.00003
(2) x2 = -2.50000
(1) x1= 3.00000
15