# Iterative methods for solving linear systems

Initial Publication Date: September 21, 2022

## Summary

Students will learn Jacobi, Gauss-Seidel and SOR methods for solving linear systems. Students are also asked to generate the iterative matrices, decide about the convergence and compare the results obtained with each one of these methods.

Key words: linear equations, iterative methods, Jacobi, Gauss-Seidel, SOR

Used this activity? Share your experiences and modifications

## Learning Goals

Study objectives. Students are expected to learn iterative methods for solving linear algebraic equations (i.e., the problem: Ax=b). Specifically, students learn the Jacobi, Gauss-Seidel and SOR methods. Students are also asked to compare the results from these three methods.

Computer objectives. Students are expected to learn the MATLAB functions: diagonal, triu, tril and eig for calculating the iterative matrix and its spectral ratio.

## Context for Use

Numerical solution of algebraic linear equations using iterative methods is one of the topics included in the Numerical Methods course that is taught to different engineering careers at Universidad Nacional Experimental del Táchira (UNET), Venezuela.

For teaching this topic, I begin by explaining the fundamentals, then I do a practical activity and finally I send practical problems (such as the example provided here) as homework.

## Description and Teaching Materials

This activity can be set as in-class practical activity or as homework problem. Whatever the case, prior to this activity students should understand the mathematical reasoning behind each one of the iterative methods. Likewise, they should be able to design their own m-functions or at least able to modify the given m-files.

The best approach I have found to do this activity is divide the class into groups of 3-4 students.

Each group discuss the problem, calculate the iterative matrix for each method, decide about the convergence and choice the parameters needed to feed the functions (Jacobi.m or SOR.m) that approximate the solution of the problem.

Finally, the groups share their work (in class or in a forum), discuss the obtained solution and analyze the results. For this, each group must provide the script where they generated the iterative matrices and called the Jacobi and SOR functions to solve the problem.

Assignment (Acrobat (PDF) 80kB Sep21 22)
Jacobi method (Matlab File 726bytes Sep21 22)
Gauss-Seidel and SOR methods (Matlab File 694bytes Sep21 22)

## Teaching Notes and Tips

Students need to be familiar with matrix notation and how to represent and manipulate linear algebraic equations. In particular, how to switch from the linear system to the compact matrix form: Ax=b.

## Assessment

Students submit their final results including the script for each one of the three iterative methods.

## References and Resources

Numerical Analysis, Richard l.Burden, J. Douglas Faires, Ninth Edition.
Numerical Methods for Enginnering, Steven C. Chapra, Raymond P. Canale, Sixth Edition.