0% found this document useful (0 votes)
21 views2 pages

Gauss Numerical Methods

The document describes the numerical methods of Gauss Jacobi and Gauss Seidal for solving systems of linear equations. It provides a specific example with the equations 5x+2y+z=12, x+4y+2z=15, and x+2y+5z=20, detailing the iterative calculations for both methods. The results of the iterations for each method are presented, showing the convergence of the solutions.

Uploaded by

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

Gauss Numerical Methods

The document describes the numerical methods of Gauss Jacobi and Gauss Seidal for solving systems of linear equations. It provides a specific example with the equations 5x+2y+z=12, x+4y+2z=15, and x+2y+5z=20, detailing the iterative calculations for both methods. The results of the iterations for each method are presented, showing the convergence of the solutions.

Uploaded by

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

(*Gauss Jacobi and Gauss Seidal Methods are used to solve the system of linear equations

numerically. Consider the system of linear equations 5x+2y+z=12,x+4y+2z=15,


x+2y+5z=20, first we solve it by Jacobi Method. The Formula for Jacobi Method is
xn+1 =D-1 b-(L+U)xn  *)

5 2 1
In[ ]:= A= 1 4 2 ;
1 2 5
5 0 0
d= 0 4 0 ;
0 0 5
0 0 0
l= 1 0 0 ;
1 2 0
0 2 1
u= 0 0 2 ;
0 0 0
12
b= 15 ;
20
0
x0 = 0 ;
0
Doxn+1 = LinearSolved, b - l + u.xn ;
Printxn , "=", N[MatrixForm[xn ]], {n, 1, 8}
2.4
x= 3.75
10.
-1.1
x2 = -1.85
2.02
2.736
x3 = 3.015
4.96
0.202
x4 = 0.586
2.2468
1.71624
x5 = 2.5761
3.7252
0.62452
x6 = 1.45834
2.62631
1.2914
x7 = 2.28071
3.29176
0.829362
x8 = 1.78127
2.82943

(* Now we solve another system with Gauss Seidal Method. The Formula is
xn+1 =l-1 b-u.xn *)
2 Gauss Numerical Methods.nb

10 1 1
In[ ]:= A= 2 10 1 ;
2 2 10
10 0 0
l= 2 10 0 ;
2 2 10
0 1 1
u= 0 0 1 ;
0 0 0
12
b= 13 ;
14
0
x0 = 0 ;
0
Doxn+1 = LinearSolve[l, b - u.xn ];
Printxn , "=", N[MatrixForm[xn ]], {n, 1, 8}
2.4
x= 3.75
10.
-0.175
x2 = 0.335
1.368
1.0297
x3 = 0.95726
1.00261
1.00401
x4 = 0.998937
0.99941
1.00017
x5 = 1.00003
0.999962
1.
x6 = 1.
0.999999
1.
x7 = 1.
1.
1.
x8 = 1.
1.

You might also like