TOPIC 2:
NUMERICAL METHOD
BFMI / DEC 2020 / DBM30043
Solution of • Gaussian Elimination Method
Linear • LU Decomposition Method
• ( Crout & Doolittle)
Equation
Solution of • Newton Raphson Method
Polynomial • Fixed Point Iteration Method
Equation
BFMI / JUN 2020 / DBM30043
GAUSSIAN ELIMINATION METHOD
BBFMFMI /I J/ UJUNN20220020/ D/ DBBMM3030040343
Gaussian Elimination Method
STEPS OF USING GAUSSIAN
ELIMINATION METHOD
STEP 1: Change Into Matrix Form
STEP 2: Transform 1
STEP 3: Transform 2
STEP 4: Find Value Of Variables Of Matrix X
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method 1
a11x1 a12 x2 a13x3 b1
a21x1 a22 x2 a23x3 b2
a31x1 a32 x2 a33x3 b3
STEP 1: CHANGE INTO MATRIX FORM
a11 a12 a13 x1 b1
a21 b2
a22 a23 x2
a31 a32 a33 x3 b3
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
STEP 2: TRANSFORM 1(involving rows 2 and 3)
Make a21 = 0 Make a31 = 0
a '21 a21 a11 a21 0 a ' 31 a31 a11 a31 0
a11 a11
a '22 a22 a12 a21 ? a '32 a32 a12 a31 ?
a11 a11
a '23 a23 a13 a21 ? a ' 33 a33 a13 a31 ?
a11 a11
b'2 b2 b1 a21 ? b'3 b3 b1 a31 ?
a11 a11
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
The 1st level transform:
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
Make a21 = 0
The 2nd level transform:
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
STEP 4: FIND THE VALUE x1 , x2 ,x3
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method (Method 1)
Example 1 : Solve this 3 simultaneous linear equation using Gaussian Elimination Method
STEP 1: CHANGE INTO MATRIX FORM
3 2 1 x 10
7 1 6 y = 8
3 0 2 z 5
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
STEP 2: TRANSFORM 1(involving rows 2 and 3)
Make a21 = 0 Make a31 = 0
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
The 1st level transform:
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
STEP 3: TRANSFORM 2 (involving row 3)
Make a32 = 0
BFMI / JUN 2020 / DBM30043
The 2nd level transform:
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
STEP 4: FIND THE VALUE x , y , z
BFMI / JUN 2020 / DBM30043
GUaSuINsGsiaGnAEUlSimSiInAaNtioEnLIMeINthAoTdION (METHOD 2)
USING GAUSSIAN ELIMINATION (METHOD 2)
a11x1 a12 x2 a13x3 b1
a21x1 a22 x2 a23x3 b2
a31x1 a32 x2 a33x3 b3
STEP 1: CHANGE INTO MATRIX FORM
a11 a12 a13 x1 b1
a21 b2
a22 a23 x2
a31 a32 a33 x3 b3
BFMI / JUN 2020 / DBM30043
STEP 2: CREATE THE TABLE
A B Elimination Operation
Coefficient
a11 a12 a13 b1 a21 a '21 a21 a11 a21 0
a21 a22 a23 b2 a11 a11
a31 a32 a33 b3
a '22 a22 a12 a21 ?
a11
a '23 a23 a13 a21 ?
a11
b'2 b2 b1 a21 ?
a11
a11 a12 a13 b1 a ' 31 a31 a11 a31 0
0 a'22 a'23 b2 a11
a31 a33 b3 a31
a32 a11 a '32 a32 a12 a31 ?
a11
a ' 33 a33 a13 a31 ?
a11
b'3 b3 b1 a31 ?
a11
a11 a12 a13 b1 , a"33 a '33 a '23 a '32 ?
0 a ' 22 a'23 b'2 a '22
a 32
a2, 2
a " a ' 32 a ' 22 a ' 32 0
32 a ' 22
0 a '32 a '33 b'3
a '32
b"3 b'3 b'2 a '22 ?
a11 a12 a13 b1 '
0 a ' 22 a ' 23 b 2
0 0 a"33 b"33
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
STEP 3: CHANGE INTO NEW MATRIX FORM TO FIND THE
VALUE OF X1, X2, X3
STEP 4: FIND THE VALUE x1 , x2 ,x3
BFMI / JUN 2020 / DBM30043
Gaussian Elimination (Method 2)
Example 2: Solve this 3 simultaneous linear equation using Gaussian Elimination Method
x1 2x2 5x3 6
4x1 4x2 3x3 7
5x1 7x2 13x3 9
STEP 1: CHANGE INTO MATRIX FORM
1 2 5 x1 = 6
4 4 3 x2 7
5 7 13 x3 9
BFMI / JUN 2020 / DBM30043
STEP 2: CREATE THE TABLE
A B Elimination Operation
Coefficient
1 2 5 6 4 4 4(1) 0
4 4 3 7
5 7 13 9 4 4 4 4(2) 4
1 3 3 4(5) 17
7 7 4(6) 31
1 2 5 6 5 5 5(1) 0
0 4 17 31
5 7 13 9 5 7 7 5(2) 3
1 2 5 6 1 13 13 5(5) 12
0 4 17 31
0 3 12 21 9 9 5(6) 21
3 3 3 (4) 0
−3 4
12 12 3 (17) 3
−4 44
21 21 3 (31) 9
44
1 2 5 6
0 4 17 31
0 3 9
0
4 4
BFMI / JUN 2020 / DBM30043
Gaussian Elimination Method
STEP 3: CHANGE INTO NEW MATRIX FORM TO FIND
THE VALUE OF X1, X2, X3
1 2 5 x1 6
4 x2
0 0 17 x3 31
3 9
0
4 4
STEP 4: FIND THE VALUE x1 , x2 ,x3
x1 2x2 5x3 6 4x2 17 x3 31 3 x3 9
x1 (2x5) (5x3) 6 4x2 17(3) 31 4 4
x1 1 x2 5
x3 3
BFMI / JUN 2020 / DBM30043
LU DECOMPOSITION METHOD
Method Lower (L) Upper (U) Multiplication
Crout Method
l11 0 0 1 u12 u13 l11 l11u12 l11u13
Doolittle Method l21 l22 0 0 1 u23
l31 l32 l33 0 0 1 l21 l u21 12 l22 l u21 13 l22u23
1 0 0 u11 u12 u13 l31 l u31 12 l32 l31u13 l32u23 l33
l21 1 0 0 u22 u23
l31 l32 1 0 0 u33 u11 u12 u13
l21u11 l21u12 U 22 l21u13 u23
l31u11 l31u12 l32u22 l31u13 l32u23 U 33
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Crout Method
a11x1 a12 x2 a13x3 b1
a21x1 a22 x2 a23x3 b2
a31x1 a32 x2 a33x3 b3
STEP 1: CHANGE INTO MATRIX FORM
a11 a12 a13 x1 b1
a21 b2
a22 a 23 x 2
a31 a32 a33 x3 b3
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Crout Method
STEP 2: Find LU
A= L U
a 11 a12 a 13 ll1211 0 0 1 u12 u13
a 21 a 22 a 23 l 22 0 0 1 u23
a31 a32 a33 l31 l32 l33 0 0 1
l11 l11u12 l11u13
l21 l21u12 l22 l u21 13 l22u23
l31 l31u12 l32 l31u13 l32u23 l33
a11 = l11 a12 = l11u12 a13 = l11u13
a21 = l21 a22 = l21u12 + l22 a23 = l21u13 + l22u23
a31 = l31 a32 = l31u12 + l32 a33 = l31u13 + l22u23 + l33
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Crout Method
STEP 3: Find Ly=B
L =y B
1 0 0 y1 b1
l 21 1 0 y2 b2
l31 l32 1 y3 b3
STEP 4: Ux=y
U x= B
1 u12 u13 x1 y1
0 1 u23 x2 y2
0 0 1 x3 y3
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Crout Method
Example 3: Solve this 3 simultaneous equation below using Crout method
3 p 6q 5r 6
4q 3r 4 0
4 p 8q 8r 10
STEP 1: CHANGE INTO MATRIX FORM
3 6 5 p 6
0 4 3 q 4
4 8 8 r 10
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Crout Method
STEP 2: Find LU
A = L U
a 11 a12 a13 l 11 0 0 1 u12 u13
a 21 a 22 a 23 l 21 l 22 0 0 1 u23
a 32
a31 a33 l31 l32 l33 0 0 1
3 6 5 l11 l11u12 l11u13
0 4 3 l21 l21u12 l22 l u21 13 l22u23
4 8 8 l31 l31u12 l32 l31u13 l32u23 l33
a11 = l11 a12 = l11u12 a13 = l11u13
-6= (3)u12
3 = l11 12 = −2 5 = (3)u13
13 = 5/3
a21 = l21 a22 = l21u12 + l22 3 = l21u13 + l22u23
3 = 0 5/3 + −4 23
0 = l21 −4 = 0(−2) + 22 23 = −3/4
22 = −4
a31 = l31 a33 = l31u13 + l32u23 + l3
a32 = l31u12 + l32
1 = l31 −8 = 1 5/3 + 10 −3/4 + 33
8=(1)(-2)+ l32 l33= -13/6
10= l32
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Crout Method
STEP 3: Find Ly=B
L =y B
l11 0 0 y1 b1
l 21 l 22 0 y2 b2
l31 l32 l33 y3 b3
STEP 4: Ux=y
U x= B
1 u12 u13 x1 y1
0 1 u23 x2 y2
0 0 1 x3 y3
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Crout Method
STEP 3: Find Ly=B
L =y B
3 0 0 y1 6
0 -4 0 y2 4
3 y1 6 1 10 -13/6 y3 10 13 y3 10
y1 2 6
4 y2 4 y1 10 y2
y 2 1 13
6
2 10(1) y3 10
108 y3
13
STEP 4: Ux=y
U x= B x1 2(0.25) 5 (8.31) 2 0 x2 3 x3 1 0 0 1x3 108
3 4 13
1 5
-2 x1 0.5 13.85 2 3 x3 8.31
0 3 x1 2 x2 4 1
1 3 x2
0 0 4 x3 1 x1 15.35 x2 0.25
108
1
13
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Doolittle Method
a11x1 a12 x2 a13x3 b1
a21x1 a22 x2 a23x3 b2
a31x1 a32 x2 a33x3 b3
STEP 1: CHANGE INTO MATRIX FORM
a11 a12 a13 x1 b1
a21 b2
a22 a 23 x 2
a31 a32 a33 x3 b3
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Doolittle Method
STEP 2: Find LU
A= L U
a11 a12 a13 1 0 0 u11 u12 u13
a 21 a 22 a 23 l 21 1 0 0 u22 u23
a31 a32 a33 l31 l32 1 0 0 u33
u11 u12 u13
l21u11 l21u12 U 22 l21u13 u23
l31u11 l31u12 l32u22 l31u13 l32u23 U33
a11 = l11 a12 = u12 a13 = u13
a21 l u21 11 a22 = l21u12 + U22 a23 = l21u13 + u23
a31 l u31 11
a32 = l31u12 + l32 U22 a33 = l31u13 + l32u23 + 33
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Doolittle Method
STEP 3: Find Ly=B
L =y B
1 0 0 y1 b1
l 21 1 0 y2 b2
l31 l32 1 y3 b3
STEP 4: Ux=y
U x= B
u11 u12 u13 x1 y1
0 u22 u23 x2 y2
0 0 u33 x3 y3
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Doolittle Method
Example 4: Solve this 3 simultaneous equation below using Doolittle method
3x 2 y z 10
7x y 6z 8
3x 2z 5
STEP 1: CHANGE INTO MATRIX FORM
3 2 1 x 10
7 1 6 y 8
3 0 2 z 5
BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Doolittle Method
STEP 2: Find LU
A= L U
a11 a12 a13 1 0 0 u11 u12 u13
a 21 a 22 a 23 l 21 1 0 0 u22 u23
a31 a32 a33 l31 l32 1 0 0 u33
3 2 1 u11 u12 u13
7 1 6 l21u11 l21u12 U 22 l21u13 u23
3 0 2 l31u11 l31u12 l32u22 l31u13 l32u23 U33
a11 = u11 a12 = 2 a13 = -1
3 = u11
a22 = l2731u122+ u22 6 l21u13 u23
a21 = l21u11 -1 u
7 = l21(3) 22 6 7 1 u23
3
7 17
21 = 3 u22 3
25
a31 l u31 11 u23 3
3 l313
l31 1 a31 l u31 11 0 l21u13 l32u23 2 l31u13 l32u23 u33
0 12 l32 17 2 11 6 25 u33
3 17 3
a 21 l u21 11
6 1
17 u33 17
l32 BFMI / JUN 2020 / DBM30043
Apply LU Decomposition using Doolittle Method
STEP 3: Find Ly=B
L =y B
1 0 0 y1 180
7 1 0 y2
y3
3 1
6 5
1 17
1 = 10 7 6
3 1 + 2 = 8 1 + 17 2 + 3 = 5
7 6 46
2 = 8 − 3 10 3 = 5 − 10 − 17 − 3
46 7
2 = − 3 3 = 17
STEP 4: Ux=y
U x= B 17 25 46
3 2 -1 17 − 3 + 3 = − 3 3 + 2 − = 10
25 17 = 17 221 17 10 − 2 13 + (7)
3 x 10 = − 3 ÷ − 3
17 1 y 46 = 7 = 3
3 z − 3
0 - 3
7 = 13
0 0 17 17
CONSTRUCT SOLUTIONS OF POLYNOMIAL
EQUATIONS
BFMI / JUN 2020 / DBM30043
Fixed Point Iteration Method
Step in Fixed Point Iteration Method
STEP 1 Make x as a subject x = g(x)
STEP 2
Initial approximate value x0
Use the given x0
If x0 is not given, assume x0 = 1
Substitute x0 in x = g(x) to find x1
Substitute x1 in x = g(x) to find x2
STEP 3 Find Ixn+1- xnI
STEP 4 Repeat second and third step until
Ixn+1- xnI < (depends on the required accuracy)
BFMI / JUN 2020 / DBM30043
Fixed Point Iteration Method
Example 5: Solve 5xex = 1 using fixed point iteration method. Give your answer correct
to 3 decimal places. Consider xo= 1
Solution :
First step : Make x as a subject
5xex 1
x 1
5e x
Second step : Substitute x0 =1 in x = g(x) to find x1
x 1 0.074
1
5e(1)
Third step : Find Ixn+1- xnI <0.001 FALSE. More iterations
Ix1- x0I <0.001 needed because the
I 0.074-1 I < 0.001 value is still larger than
I -0.926 I <0.001 0.001
BFMI / JUN 2020 / DBM30043
Fixed Point Iteration Method
Forth step : Repeat second and third step till Ixn+1- xnI <0.001
n − +1 − < 0.001
+1 = 5
01 0.926
1 0.074 0.074 0.112
2 0.186 0.186 0.019
3 0.167 0.167 0.003
4 0.170 0.170 0.001
0.169
TRUE, The value
is smaller than
0.001
Therefore, the approximate root is x5 = 0.169
BFMI / JUN 2020 / DBM30043
Fixed Point Iteration Method
Example 6 : Given x3 6x 4 has an approximate rootx0 1. By using the fixed point iteration
method, find the root up to three decimal places
Solution :
First step : Make x as a subject
Second step : Substitute x0 =1 into 3 6x 4 to find x1
Third step : Find Ixn+1- xnI <0.001
Ix1- x0I <0.001
I 2.154 -1 I < 0.001
I 1.154 I < 0.001
BFMI / JUN 2020 / DBM30043
Fixed Point Iteration Method
Forth step : Repeat second and third step till Ixn+1- xnI <0.001
n xn1 3 6x 4 +1 − < 0.001
01 2.154 1.154
1 2.154 2.567 0.413
2 2.567 2.685 0.118
3 2.685 2.719 0.034
4 2.719 2.729 0.010
5 2.729 2.731 0.002
6 2.731 2.731 0.000
Therefore, the approximate root is x6 = 2.731
BFMI / JUN 2020 / DBM30043
Newton Raphson Method
Step in Newton Raphson Method (If x0 is not given)
STEP 1 Find x0 (change in sign)
x0 1 x1 y1
y2 x1 x2 y2
STEP 2 Differentiate f(x)
STEP 3 Substitute into table
STEP 4 Repeat second and third step until
Ixn+1- xnI < (depends on the required accuracy)
BFMI / JUN 2020 / DBM30043
Newton Raphson Method
Example 7 : Solve 3x3 2x 4 0 using the Newton Raphson method. Give your answer
correct to four decimal places.
Solution : Substitute the value of x,
f (x) 3x3 2x 4
First step : Find x0 (change in sign) f (0) 3(0) 2(0) 4 4
f (1) 3(1)3 2(1) 4 1
x 01
f (x) 4 1
Using the formula x0 1 x1 y1
y2 x1 x2 y2
x0 1 1 0 4
(4) 1 1
0.8
Second step : Differentiate f (x) 3x3 2x 4 0
f ,(x) 9x2 2
BFMI / JUN 2020 / DBM30043
Newton Raphson Method
Third step :Substitute into table
f (x) 3x3 2x 4 0 f ,(x) 9x2 2 xn1 xn f (xn )
f '(xn )
f (x0 ) 3(0.8)3 2(0.8) 4 f , (x) 9(0.8)2 2 x1 0.8 0.864
0.864 7.76 7.76
0.9113
f (x1) 3(0.9113)3 2(0.9113) 4 f , (x1) 9(0.9113)2 2 x2 0.9113 0.0930
9.4742
0.0930 9.4742
0.9015
BFMI / JUN 2020 / DBM30043
Newton Raphson Method
Fourth step: Repeat second and third step until Ixn+1- xnI < 0.0001
Ixn+1- xnI < 0.0001
Ix1- x0I <0.0001
I 0.9113 - 0.8 I < 0.0001
I 0.1113 I < 0.0001 FALSE
n xn1 xn f (xn ) +1 − < 0.001
f '(xn )
0 0.8 0.9113 0.1113
1 0.9113 0.9015 0.0098
2 0.9015 0.9014 0.0001
3 0.9014 0.9014 0.0000
Therefore, the approximate root is x4 = 0.9014
BFMI / JUN 2020 / DBM30043
Newton Raphson Method
Example 8 : Given the function f (x) x4 x 2 :
a) Show that there is a real root for f(x) =0 between x=1 and x= 1.5
b) Find the real roots of f(x)= 0 using Newton Raphson method , correct to
three decimal places
Solution :
First step : Find x0 (change in sign)
x 1 1.5 Substitute the value of x,
f (x) 2 1.5625 f (x) x4 x 2
f (1) 14 (1) 4 2
f (1.5) (1.5)4 (1) 2 1.5625
Since three is a change in the sign of f(x) between x= 1 and x =1.5, there is a real root for f(x)=0
between x=1 and x =1.5.
Using the formula x0 1 x1 y1
y2 x1 x2 y2
x0 1 0 2 BFMI / JUN 2020 / DBM30043
1.5625 (2) 1.5 1.5625
1.281
Newton Raphson Method
Second step : Differentiate f (x) x4 x 2
f '(x) 4x3 1
Third step : Substitute into table
f (x) x4 x 2 f '(x) 4x3 1 xn1 xn f (xn )
f '(xn )
f (x0 ) (1.281)4 (1.281) 2 f '(x0 ) 4(1.281)3 1 x1 1.281 0.588
7.408
0.588 7.408
BFMI / JUN 2020 / DBM30043
Newton Raphson Method
Fourth step: Repeat second and third step until Ixn+1- xnI < 0.0001
Ixn+1- xnI < 0.0001
Ix1- x0I <0.0001
I 1.360-1.281I < 0.0001
I 0.079 I < 0.0001 FALSE
n xn1 xn f (xn ) +1 − < 0.001
f '(xn )
0 1.281 0.0790
1 1.360 1.360 0.0070
2 1.353 0.0000
1.353
1.353
Therefore, the approximate root is x3 = 1.353
BFMI / JUN 2020 / DBM30043
Newton Raphson Method
Step in Newton Raphson Method (If x0 is given)
STEP 1 Differentiate f(x)
STEP 2
STEP 3 Substitute into table
Repeat second and third step until
Ixn+1- xnI < (depends on the required accuracy)
BFMI / JUN 2020 / DBM30043
Newton Raphson Method
Example 9 : Solve 3x3 2x 4 0using the Newton Raphson method. Give your answer
correct to three decimal places. Consider x0 1
Solution : First step : Differentiate f (x) 3x3 2x 4 0
f ,(x) 9x2 2
Second step : Substitute into
f (x) 3x3 2x 4 f '(x) 9x2 2 xn1 xn f (xn )
f (x0 ) 3(1)3 2(1) 4 f ' (x) 9(1)3 2 f '(xn )
xn 1 1 1
1
0.909
BFMI / JUN 2020 / DBM30043