You are on page 1of 3

APPLIED COMPUTATIONAL METHODS

WEEK-3 ASSIGNMENT
NITHANTHA SHOURYA R
12ME92
This code solves the system of equations by iterative methods. It is a single code which gives user the freedom of
entering any size of matrix. The solution methods include Jacobi, gauss siedal and SOR method. The diagonal
dominance is first checked. The following figure shows the output window.
The solution method chosen is SOR.
It displays solution by SOR method further it iterates for the optimum value for w (relaxation) from 0.5 to 1.99
(accuracy of 2 places of decimal) and stops when the successive value of w requires higher number of iterations.
To solve the same problem with default matrices, Jacobi method needed 15 iterations, gauss seidal and SOR method
would require 8 iterations.

Solution by Jacobi method:

The above table shows the values of absolute error between successive iterations for each
variable, in this case X1 X2 and X3. The error limit is 10^-6.

When the user chooses SOR method for solution, the code iterates for the optimum value of
w.
The above table shows the w values (column 1) against the number of iterations required
(column 2).
The output window also displays the optimum value of w, which is 1 in this case.

You might also like