Professional Documents
Culture Documents
Exercises 2
Exercises 2
EXERCISE 2
5x2-y2=0,
y-0.25[sin (x)+cos (y)] = 0.
a) By retaining 4 significant digits, that is, by using 4 figure floating point arithmetic (in
which we express the numbers as 0.xxxxE xx ), solve the system in equation (1)
by LU decomposition method (LUM) i) without pivoting ii) with partial pivoting (PP).
b) Check the results you obtained in part (a) by using the computer program BKSB.FOR
which may be found in the WEB site
http://www.metu.edu.tr/~azulfu/courses/es361/es361.htm.
c) Also, find the determinant of the coefficient matrix in eqn (1) in view of the U part of
the decomposition found in part (a/ii). Check this determinant value using the program
DET.FOR available in the aforementioned WEB site.
1
3) Compute A of
2 1 2
A 1 2 3
4 1 2
Use 3 figure floating point arithmetic (that is, 3 significant digits) in your computations.
1 1
NOTE: U and L may be found respectively by backward and forward substitutions :
L | I L | e1 en
1
forward substitution gives L ,
1 0 0
0 1
where, e1 , e 2 0 , ……, e n .
0
0 1
0
4) Solve the following system given in question (1)
by Gaussian elimination method (GEM) i) without pivoting ii) with partial pivoting (PP). (In
calculations, keep 4 significant digits, that is, by using 4 figure floating point arithmetic in
which we express the numbers as 0.xxxxE xx ).
5) a)If we disregard the multiplications by “0” (zero), show that the # of multiplications (N) in
x x x 0 0
0
x x (1)
0
0 0 x x x
E F
( nxn ) ( nxn )
upper triangular Lower triangular
is N n 3 / 3 (2)
m m
NOTE: Recall the formulas : i m(m 1) / 2 , i 2
m(m 1)(2m 1) / 6 (*)
i 1 i 1
HINT: If we disregard zero multiplications, show that the # of multiplications for multiplying
“k”th row of E by the all the columns of F in eqn (1) is (n-k+1)*(n+k)/2.
n
So, we have, for the total # of multiplications, N (n k 1)(n k ) / 2 which in view of
k 1
the formulas (*), gives eqn (2).
b) Consider the augmented matrix
U | I U | e1 e n , (3)
1
whose solution by back substitutions gives U , where U is upper triangular matrix.
x1+x2-x3=-3,
6x1+2x2+2x3 =2
-3x1+4x2+x3 =1.
-5x1+12x3 = 80,
4x1-x2-x3 = -2,
6x1+8x2= 45.
Start with the initial guess of x1 = 2.375, x2 =3.845, x3 = 7.655 and tolerance of 0.5E-4 in
your hand calculations. Use Matlab routines with the initial guess of { 0.0, 0.0, 0.0}T and
tolerance of 0.5E-8.