Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
20 views28 pages

Unit 2

The document discusses numerical methods for solving simultaneous linear algebraic equations, particularly in science and engineering, highlighting both direct methods (like Gauss elimination and Gauss-Jordan methods) and iterative methods (like Gauss-Jacobi and Gauss-Seidel methods). It provides examples demonstrating the application of these methods to solve systems of equations and also addresses the conditions under which iterative methods can converge successfully. Additionally, it covers the use of the Gauss-Jordan method for finding the inverse of a matrix.

Uploaded by

satabdipuchi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views28 pages

Unit 2

The document discusses numerical methods for solving simultaneous linear algebraic equations, particularly in science and engineering, highlighting both direct methods (like Gauss elimination and Gauss-Jordan methods) and iterative methods (like Gauss-Jacobi and Gauss-Seidel methods). It provides examples demonstrating the application of these methods to solve systems of equations and also addresses the conditions under which iterative methods can converge successfully. Additionally, it covers the use of the Gauss-Jordan method for finding the inverse of a matrix.

Uploaded by

satabdipuchi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Topic : Unit-II

Subject Code : HMMS18007


Subject Name : NUMERICAL METHODS
Delivered by : Prof.Dr.S.Kopperundevi
Simultaneous linear algebraic equations for its solutions , especially,
in the fields of science and engineering . In lower classes , we have
solved such equations by cramer’s rule (determinant methods) or
by matrix methods . These methods become tedious when the
number of unknowns in the system is large . After the availability of
computers , we go to numerical methods which are suited for
computer operations . These numerical methods are of two types
namely :
(i) Direct (ii) Iterative(Indirect)
We will study a few methods below:
Solution of Simultaneous Linear Algebraic Equations
Direct methods are
1.Gauss – Elimination Method
2.Gauss – Jordan elimination Method
Iterative (Indirect)Methods are
1.Gauss- Jacobi Method
2Gauss – seidal Method
Example1
Solve the system of equation by (i) Gauss elimination Method (ii) Gauss-Jordan method
X + 2y + z =3,2x + 3y + 3z =10,3x – y + 2z = 13.
Solution:
Gauss elimination Method:
1 2 1  x   3 
    
2 3 3   y   10 
3  1 2    13 
  z   
AX  B
1 2 1 3
A, B   2 3 3 10
3  1 2 3
Now, We will make the matrix A upper triangular.
1 2 1 3
A, B   2 3 3 10
3 1 2 13
1 2 1 3
 0 1 1 4
0  7 14
R2  (  2) R1
andR3  (  3) R1

Now Take b22= -1 as the pivot and make b32 as zero.


1 2 1 3
A, B   0 1 1 4 R32 ( 7)
0 0  8  24

From this we get


X + 2y + z = 3
-y + z = 4
-8z = -24
Z = 3,y = -1, x = 2 by back substitution.
(ii)Gauss – Jordan Method:
1 2 1 3
( A, B )  0 1 1 4
0 0  8  24
1 0 3 11
 0 1 1 4 R12 ( 2)
0 0  8  24
1 0 3 11
1
 0 1 1 4 R3 ( )
8
0 0 1 3
1 0 0 2
 0 1 0 1 R13 (3), R23 (1)
0 0 1 3
x 2, y 1, z  3
x 2, y  1, z 3
Example 2:
Solve the system by Gauss – Elimination Method:
2x + 3y – z = 5;4x + 4y -3z = 3 and 2x- 3y + 2z = 2.
Solution:
The system is equivalent to
 2 3  1  x   5 
    
 4 4  3  y   3 
 2  3 2  z   2 
    
AX B
2 3 15
A, B   4 4 33
2 3 2 2
Step 1:
Taking a11 = 2 as the pivot, reduce all elements below that to zero.

2 3 1 5
A, B   0  2  1  7 R21 ( 2), R31 ( 1)
0 6 3 3

Step 2:
Taking the element -2 in the position (2,2) as pivot , reduce all elements below
that to zero.

2 3 1 5
A, B   0  2  1  7 R32 ( 3)
0 0 6 18
Hence 2x + 3y – z = 5
-2y- z = -7
6z = 18
Z =3,y = 2,x =1.by back substitution

Example 3:
Solve the following system by Gauss – Jordan method.
5x1 + x2 + x3 + x4 = 4; x1 +7x2 + x3 + x4 = 12; x1 + x2 + 6x3 + x4 = -5;
x1 + x2 + x3 + 4x4 = -6
Solution:
Interchange the first and the last equation,so that the coefficient
of x1 in the first equation is 1.Then we have
1 1 1 4 6
1 7 1 1 12
( A, B ) 
1 1 6 15
5 1 1 1 4
1 1 1 4  6
0 6 0  3 18
 R21 ( 1), R31 ( 1), R41 ( 5)
0 0 5 3 1
0  4  4  19 34
1 1 1 4  6
0 1 0  0 .5 3  1
 R2  
0 0 5 3 1  6
0  4  4  19 34
To make the pivot as 1
1 0 1 4.5  9
0 1 0  0.5 3
 R12 (  1), R42 (4)
0 0 5  3 1
0 0  4  21 46
1 0 1 4.5  9
0 1 0  0.5 3  1
 R3  
0 0 1  0.6 0.2  5
0 0  4  21 46
1 0 0 5.1  9.2
0 1 0  0.5 3
 R13  1, R43 (4)
0 0 1  0.6 0.2
0 0 0  23.4 46.8
1 0 0 5.1  9.2
0 1 0  0.5 3  1 
 R4  
0 0 1  0.6 0.2  23. 4 
0 0 0 1 2
1 0 0 0 1
0 1 0 0 2   3  1
 R34   , R24    , R14 5.1
0 0 1 0 1  5   2
0 0 0 1 2
x1 1, x 2 2, x3  1, x 4  2.
Inverse of Matrix by using Gauss – Jordan Method:
Example 1:
Using Gauss Jordan method ,Find the inverse of the matrix A.
2 2 3
 
2 1 1
1 3 5
 
2 2 3 1 0 0
A, I   2 1 1 0 1 0
1 3 5 0 0 1
3 1
1 1 0 0
2 2 R1
 2 1 1 0 1 0 R1 
2
1 3 5 0 0 1

3 1
1 1 0 0
2 2
 0  1  2  1 1 0
7 1
0 2  0 1
2 2
R2  R2  2 R1 andR3  R3  R1
3 1
1 1 0 0
2 2 R2
 0 1 2 1  1 0 R2 
7 1  1
0 2  0 1
2 2
 1  1
1 0 0 0
2 2
 0 1 2 1  1 0
 1 5
0 0  2 1
2 2
R1  R1  R2 & R3  R3  2 R2
1 1
1 0 1 0
2 2
 0 1 2 1 1 0 R3  R3 ( 2)
0 0 1 5  4  2

1 0 0 2 1 1
 0 1 0 9 7 4
0 0 1 5  4  2
1
R1  R1  R3 andR2  R2  2 R3
2
 2  1  1
 
HenceA 1   9 7 4 
 5  4  2
 
2 2 3  2 1  1  1 0 0
1
    
AA  2 1 1   9 7 4   0 1 0
1 3 5   5  4  2   0 0 1 

AA  1 I
Indirect Methods:
All the previous methods seen in solving the system of
simultaneous algebraic linear equations are direct methods.
Now we will see some indirect methods or iterative methods.
This iterative methods is not always successful to all systems of
equations. If this method is to succeed, each equation of the
system must possess one large coefficient and the large
coefficient must be attached to a different unknown in that
equation. This condition will be satisfied if the large coefficients
are along the leading diagonal of the coefficient matrix. when
this condition is satisfied , the system will be solvable by the
iterative method. The system,
a11x1 + a12x2 + a13x3 = b1
a21x1 + a22x2 + a23x3 = b2
a31x1 + a32x2 + a33x3 = b3
will be solvable by this method if
a11  a12  a13
a 22  a 21  a 23
a33  a31  a32

In other words , the solution will exist (iteration will converge)if the
absolute values of the leading diagonal elements of the coefficient
matrix A of the system AX = B are greater than the sum of absolute
values of the other coefficients of that row. The condition is sufficient
but not necessary.
The indirect methods are
1.Gauss Jacobi Method
2.Gauss seidel Method
Example 1:
Solve the following system by Gauss – Jacobi and Gauss – seidel methods:
10x – 5y – 2z =3;4x -10y + 3z = -3;x + 6y + 10z = -3.
Solution:
Here , we see that the diagonal elements are dominant.
Hence , the iteration process can be applied.
 10  5  2 
That is, the coefficient matrix  4  10 3  is diagonally dominant, since
 
1 6 10 

10   5   2 ,  10  4  3 and 10  1  6
Gauss – Jacobi method.

Solving for x,y,z we have


1
x  (3  5 y  2 z )............................(1)
10
1
y  (3  4 x  3 z ).............................( 2)
10
1
z  (  3  x  6 y )................................(3)
10

First iteration:

Let the initial values be (0,0,0)

Using these initial in (1),(2),(3),we get


1
x  3  5(0)  2(0) 0.3
(1)

10
1
y  3  4(0)  3(0) 0.3
(1)

10
1
z   3  (0)  6(0)  0.3
(1)

10
Second iteration:

Using these values in (1),(2),(3),we get


1
x ( 2 )  3  5(0.3)  2(  0.3) 0.39
10
1
y ( 2 )  3  4(0.3)  3(  0.3) 0.33
10
1
z ( 2 )   3  (0.3)  6(0.3)  0.51
10
Third iteration:

Using these values in (1),(2),(3),we get


1
x ( 3)  3  5(0.33)  2( 0.51) 0.363
10
1
y (3)  3  4(0.39)  3( 0.51) 0.303
10
1
z ( 3)   3  (0.39)  6(0.33)  0.537
10
Fourth iteration:
Using these values in (1),(2),(3),we get

1
x ( 4 )  3  5(0.303)  2( 0.537) 0.3441
10
1
y ( 4 )  3  4(0.363)  3( 0.537) 0.2841
10
1
z ( 4 )   3  (0.363)  6(0.303)  0.5181
10
Fifth iteration:

Using these values in (1),(2),(3),we get


1
x (5)  3  5(0.2841)  2( 0.5181) 0.33843
10
1
y (5)  3  4(0.3441)  3( 0.5181) 0.2822
10
1
z (5)   3  (0.3441)  6(0.2841)  0.50487
10

Sixth iteration:
Using these values in (1),(2),(3),we get

1
x ( 6 )  3  5(0.2822)  2( 0.50487) 0.340126
10
1
y ( 6)  3  4(0.33843)  3( 0.50487) 0.283911
10
1
z ( 6 )   3  (0.33843)  6(0.2822)  0.503163
10
Seventh iteration:
Using these values in (1),(2),(3),we get

1
x ( 7 )  3  5(0.283911)  2( 0.503163) 0.3413229
10
1
y ( 7 )  3  4(0.340126)  3( 0.503163) 0.2851015
10
1
z ( 7 )   3  (0.340126)  6(0.283911)  0.5043592
10
Eighth iteration:
Using these values in (1),(2),(3),we get
1
x (8)  3  5(0.2851015)  2( 0.5043592) 0.34167891
10
1
y  3  4(0.3413229)  3( 0.5043592) 0.2852214
(8)

10
1
z   3  (0.3413229)  6(0.2851015)  0.50519319
(8 )

10
Ninth iteration:
Using these values in (1),(2),(3),we get
1
x (9 )  3  5(0.2852214)  2( 0.50519319) 0.341572062
10
1
y (9 )  3  4(0.34167891)  3( 0.50519319) 0.285113607
10
1
z (9)   3  (0.34167891)  6(0.2852214)  0.505300731
10

Hence correct to 3 decimal places, the values are

x = 0.342 , y = 0.285 , z = -0.505


Gauss – Seidel method:
Initial values y = 0 , z = 0.
First iteration:
1
x (1)  3  5(0)  2(0) 0.3
10
1
y  3  4(0.3)  3(0) 0.42
(1)

10
1
z (1)   3  (0.3)  6(0.42)  0.582
10
Second iteration:
1
x ( 2 )  3  5(0.42)  2(  0.582) 0.3936
10
1
y ( 2 )  3  4(0.3936)  3(  0.582) 0.28284
10
1
z ( 2 )   3  (0.3936)  6(0.28284)  0.509064
10
Third iteration:

1
x ( 3)  3  5(0.28284)  2(  0.509064) 0.3396072
10
1
y ( 3)  3  4(0.3396072)  3(  0.509064) 0.28312368
10
1
z ( 3)   3  (0.3396072)  6(0.28312368)  0.503834928
10

Fourth iteration:
1
x ( 4)  3  5(0.28312368)  2( 0.503834928) 0.34079485
10
1
y ( 4)  3  4(0.34079485)  3( 0.503834928) 0.285167464
10
1
z ( 4)   3  (0.34079485)  6(0.285167464)  0.50517996
10
Fifth iteration:
1
x ( 5)  3  5(0.285167464)  2( 0.50517996) 0.34155477
10
1
y (5)  3  4(0.34155477)  3( 0.50517996) 0.28506792
10
1
z ( 5)   3  (0.34155477)  6(0.28506792)  0.505196229
10

Sixth iteration:
1
x ( 6 )  3  5(0.28506792)  2( 0.505196229) 0.341494714
10
1
y ( 6)  3  4(0.341494714)  3( 0.505196229) 0.285039017
10
1
z ( 6 )   3  (0.341494714)  6(0.285039017)  0.5051728
10
Seventh iteration:
1
x ( 7 )  3  5(0.285039017)  2( 0.5051728) 0.3414849
10
1
y ( 7 )  3  4(0.3414849)  3( 0.5051728) 0.28504212
10
1
z ( 7 )   3  (0.3414849)  6(0.28504212)  0.5051737
10

Hence x = 0.3414 , y = 0.2850 , z = -0.5051

You might also like