You are on page 1of 1

MSU-Iligan Institute of Technology

College of Engineering
Mechanical Engineering and Engineering Sciences Department
ES 84 Numerical Methods
Laboratory Exercise 10
Gauss-Seidel Method
Write a Scilab program named GaussSeidel_<YOUR LAST NAME>.sce with function name seidel() that
will solve for the solution matrix (unknown vector) given a coefficient matrix, a constant matrix (right-hand side
vector), and other parameters using Gauss-Seidel Method. When writing your program, follow the given
specifications listed below
Input Parameters:
Coefficient Matrix
Constant Matrix
Initial Values
(Error Criterion/Stopping Criterion)
Output Parameters:
Solution Matrix
Number of iterations
| | (Absolute Relative Approximate Error Computations for each unknown in each iteration)
Conditions:
- Include Partial Pivoting to solve the problem with division by zero.
- The program should check whether the input matrices are dimensionally compatible.
- Program should detect if coefficient matrix is a square matrix.
- Program should check if the initial values are complete.
- Program should check if the system is diagonally dominant.
- Maximum number of iterations should be 1000. When reached, abort the calculation then display, Slowly
converging. Change initial values.
- Program should solve the system using the Gauss-Seidel Method.
Optional Stuff (for additional points):
- Please provide sample interactions showing the functionalities of your program. You can comment these
sample interactions at the bottom part of your program.
EXTRA CREDIT/ADDITIONAL BONUS IF YOU CAN IMPLEMENT
Additional Input Parameter:

(Lambda/Weighing Factor)
Additional Condition:
- If 0<Lambda<1 then display Under-relaxation Method. If 2>Lambda>1 then display Over-relaxation
Method. Lambda should not be equal to 0 and 1, if false then abort and display Change Lambda. 0<Lambda<1 for
under-relaxation, 1>Lambda>2 for over-relaxation. Max value for Lambda is 2, if false, abort then display
Maximum value for Lambda is 2.

You might also like