Tutorial

This tutorial teaches Jacobi’s method, the Gauss–Seidel method and successive over-relaxation (SOR) for \(Ax = b\), and how to verify your code: to show, with evidence, how its convergence relates to the theory on specified test problems. Work through the sections in order; each one ends with something to do.

Section

Topic

0

Setting up Python and running verify.py for the first time

1

Linear systems: direct and iterative methods

2

Jacobi’s method: write jacobi_sweep

3

Primer: the iteration matrix and the spectral radius

4

Gauss–Seidel and SOR: write gauss_seidel_sweep and sor_sweep

5

Comparing the methods: sweeps, size and the choice of \(\omega\)

6

When the methods fail

7

Residual, error and when to stop

8

Reading your report and choosing a project brief

What you need: a computer with Python 3.10 or later, NumPy, SciPy and Matplotlib. Plan several sessions; setup, tutorial and project time depend on your background. The code and reports work offline after installation; section 0 explains how to prepare formatted tutorial material for offline reading.

What you should know already: matrices and vectors, eigenvalues, and basic Python (variables, loops, functions, and NumPy arrays). Unit A1 is helpful but not required.

What you hand in: your student folder (including steps.py, student_info.txt and completed CONTRIBUTION.md), your verification report, and the agreed assignment or project write-up. For a project brief, also submit the experiment scripts or notebooks, any additional inputs, and the command and working directory that reproduce a named figure or table.

Further reading: Driscoll and Braun’s Fundamentals of Numerical Computation, Python edition provides additional explanations and examples. Your lecturer’s course text should guide the depth of theory expected.