Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Course Portfolio

Chapter 3
CO2: Solve system of linear equations using conventional and special properties matrix operations. Use
simplex method to solve linear programming problems.

FDM2043 COMPUTATIONAL METHODS

SEPTEMBER 2017 SEMESTER


GROUP NAME:

BIL GROUP MEMBERS COURSE MATRIX SIGNATURE Topic


1 Gauss-Seidel
2 Thomas
3 Inverse

HONOUR PLEDGE

SUBMISSION DATE: MONDAY 23 OCTOBER 2017 BEFORE 5PM. BLOK 20-03-29

RECEIVED BY:
SLT: 30
UNIVERSITI TEKNOLOGI PETRONAS
Minutes
FCM2043/FDM2043 COMPUTATIONAL METHODS
CHAPTER 3 GAUSS-SEIDEL SEPTEMBER 2017
ACTIVE LEARNING (PAIR WORK): In Class Work
Name : Student ID:

Name : Student ID:

1. A production line of an electronics company consists of three sections namely P, Q and R


with man hours’ constraint given as 919, 626 and 388 hours respectively. The production
line produce three electronic components x , y and z with needed man hours to produce

each component as given in TABLE 1.


TABLE 1
Section /Component x y z
A 17 10 7
B 6 13 9
C 5 3 10

The problem can be formulated as the following linear system;


17 x + 10 y + 7 z = 919
6 x + 13 y + 9 z = 626
5 x + 3 y + 10 z = 388
Perform five iterations of Gauss-Seidel method to determine x , y and z . Compute the

approximate percent relative error, ε a , after the first iteration.

2. Use the Gauss-Seidel method to solve the following system until the percent relative error
falls below ε s = 8% .

6 x1 + 2 x2 + x3 = 11
2 x1 − 3 x2 + x3 = 1.5
1.2 x1 + 2 x2 − 7 x3 = 5

Please write your reflection regarding these activities.


SLT: 30
UNIVERSITI TEKNOLOGI PETRONAS
Minutes
FCM2043/FDM2043 COMPUTATIONAL METHODS
CHAPTER 3 THOMAS ALGORITHM SEPTEMBER 2017
ACTIVE LEARNING (PAIR WORK): Home Work
Name : Student ID:

Name : Student ID:

Solve the following tridiagonal system of equations by using Thomas algorithm:


5 p1 + p 2 = 33
p1 + 5 p 2 + p 3 = 26
p 2 + 5 p 3 + p 4 = 30
p 3 + 5 p 4 = 15

Please write your reflection regarding this activity.


SLT: 30
UNIVERSITI TEKNOLOGI PETRONAS
Minutes
FCM2043/FDM2043 COMPUTATIONAL METHODS
CHAPTER 3 INVERSE OF MATRIX AND CONDITION NUMBER SEPTEMBER 2017
ACTIVE LEARNING (PAIR WORK): Home Work
Name : Student ID:

Name : Student ID:

The following system of equations is a simulation to determine the concentrations x,


y, and z in a series of coupled reactors as a function of the change in mass input to
each reactor.

4x − y + z = 8
2x + 5 y + 2z = 3
x + 2 y + 4 z = 11

a. Derive an LU decomposition of the coefficient matrix.


b. Use the LU decomposition found in part (a) to determine the inverse
of the coefficient matrix.
c. Use the result in part (b) to solve the given system of equations
[i.e, use the inverse method, X = A −1b ].
d. Find the residual error and the condition number for the given
system of linear equation [Refer to the attached PPT slides].

Please write your reflection regarding these activities.


Linear Algebra
Error, Residual and Condition Number

Open
40 Minutes Tour

Open
If [xNS ] is a computed approximate numerical
soloution of a system of n equations
[A][x] = [b]
and [xTS ] is the true (exact) solution, then the
error is the vector:
[e] = [xTS ] − [xNS ]
The true error, however, cannot be calculated
because the true solution is not known.

Open
An alternative measure of the
accuracy of a solution is the residual
which is defined by
[r ] = [a][xTS ] − [a ][xNS ] = b − [a ][xNS ] = [a][e]

Please take note that the residual [r ]


does not really indicate how small
the error is in the solution [x]
Open
Norms and Condition Number
The matrix Infinity norm is given
by n
[a ] ∞ = max
1≤i ≤ n
j =1
∑ aij
The matrix 1-norm is calculated
by: n
[a ] 1 = max
1≤ j ≤ n
i =1
∑ aij

Open
The 2-norm of a matrix is given by
 [a ][v ] 
[a ] 2 = max 

 [v ] 
where [v] is an eigenvector of the
matrix[a] corresponding to the
eigenvalue λ

Open
Condition Number
If the inverse matrix exist,
then it is defined by
−1
Cond [a ] = [a ] ∞ [a ]

Open
Example. Consider the
following systems of equations:
9 x 1 − 2 x 2 + 3 x 3 + 2 x 4 = 54 . 5
2 x 1 + 8 x 2 − 2 x 3 + 3 x 4 = − 14
− 3 x 1 + 2 x 2 + 11 x 3 − 4 x 4 = 12 . 5
− 2 x 1 + 3 x 2 + 2 x 3 + 10 x 4 = − 21

The true solution is


x 1 = 5 , x 2 = − 2 , x 3 = 2 . 5 , and
x4 = −1.
Open
When this system is solved
with the Gauss-Seidel
iteration method, the
numerical solution in the
sixth iteration was:

x1 = 4 . 98805 , x 2 = − 1 . 99511 ,
x 3 = 2 . 49806 , and x 4 = − 1 . 00347 .

Open
(a) Determine the true error, [e]
and the residual [r ]
(b) Determine the infinity norms
of the true solution [xTS ] , the error
[e] , the residual [r ] and the vector [b]
(c) Find the condition number for
matrix [a]

Open
Solution
Firstly we write in matrix
form:
 9 −2 3 2   x1   54 . 5 
 2 8 −2  
3   x2   − 14 
 =  
− 3 2 11 − 4   x3  12 . 5 
    
− 2 3 2 10   x 4   − 21 

Open
The true solution is  5 
− 2
x TS =  
 2 .5 
 
 −1
the approximate solution is
 4 . 98805 
 − 1 . 99511 
x NS =  
 2 . 49806 
 
 − 1 . 00347 
Open
 0.0119 
− 0.0049
The error [e] =  
 0.0019 
 
 0.0035 

the residual
 0.13009 
− 0.00869
[r ] =  
− 0.03817
 
 0.00001 

Open
(b) [xTS ] ∞ = max[5 , − 2 , 2.5 , − 1 ] = 5
[e] ∞ = 0.0119
[r ] ∞ = 0.13009
[b] ∞ = 54.5

(c)
 0.0910 0.0386 − 0.0116 − 0.0344
− 0.0206 0.1194 0.0308 
− 0.0194
[a] = 
−1

 0.0349 − 0.0200 0.0727 0.0281 


 
 0.0174 − 0.0241 − 0.0261 0.0933 
Open
[a] ∞ = max[16,15,20,16] = 20
−1
[a] ∞ = max[0.1756,0.1902,0.1557,0.1609] = 0.1902

Thus condition number is

−1
Cond [a ] = [a ] ∞ [a ] = 3.804

Open
Ill-Conditioned Systems

This happen when


−1
Cond [a ] = [a ] ∞ [a ]

is significantly very large

Open
Exercise. Given the system
1 . 02 x 1 + 0 . 98 x 2 = 2
0 . 98 x 1 + 1 . 02 x 2 = 2
has true solution x 1 = x 2 = 1
Calculate the error and the residual
for the following two approximate
solutions:
(a) x 1 = 1 . 02 , x 2 = 1 . 02
(b) x 1 = 2 , x 2 = 0
Verify the statement: A small
residual does not necessarily
guarantee a small error.
Open

You might also like