Numerical Analysis

Foundations and Exercises

TANAKA, Kazuaki (田中 一成)

Global Center for Science and Engineering, Waseda University

Before We Start

📥
Please pull the latest course materials repository.
Already cloned
cd materials
git pull
Today's materials:
050/5th.qmd slides — logistics and assignments
050/linear-equations-handout.qmd 📘 shared handout for Lectures 5 and 6
050/linear-equations-handout.html rendered shared handout

Today’s Main Material

LECTURE 5
Linear Systems I: Introduction to Stationary Iterative Methods
Use the shared Lectures 5--6 handout. Today we focus on Sections 1--8.
Today's scope
  • systems of linear equations and conditioning
  • direct methods vs iterative methods
  • Jacobi method and Gauss-Seidel method
  • basic implementation and numerical observation of residuals

Reminder — Previous Assignments

Ex 3.0--3.3 and Ex 4.0--4.3 are due May 14 (Thu), 23:59 JST.
Ex 3.2 video pair work will be handled in class when announced.

Exercise 5.0 — Evolve the Shared Handout with AI

Repository: same as Ex 5.1   |   Submit: linear-equations-handout.qmd (your edited copy)   |   Deadline: May 21 (Thu), 23:59 JST

While studying the shared Lectures 5–6 handout, insert at least 3 Q&A blocks of your own using the protocol in AI_TUTOR.md.

For Ex 5.0, focus on Sections 1–8.

Exercise 5.1 — Understanding Matrix Condition Numbers

Repository: Ex 5 — GitHub Classroom   |   Edit: ex5-1.qmd   |   Deadline: May 21 (Thu), 23:59 JST

Your tasks are:

  • use a concrete \(2\times 2\) matrix example to explain geometrically what a large matrix condition number means (hint: it may help to draw how a matrix transforms the unit circle or the unit square \([0,1]^2\)),
  • create well-conditioned and ill-conditioned \(2\times 2\) matrices,
  • create \(10\times 10\) matrices with good and bad matrix condition numbers,
  • run the same perturbation experiment for those matrices and compare how strongly the well-conditioned and ill-conditioned matrices amplify input errors.

Exercise 5.2 — Direct Solvers: solve vs inv

Repository: same as Ex 5.1   |   Edit: ex5-2.qmd   |   Deadline: May 21 (Thu), 23:59 JST

Using the matrices from Ex 5.1, compare numpy.linalg.solve(A, b) and numpy.linalg.inv(A) @ b in terms of:

  • computation time,
  • relative residual,
  • relative error of the solution,
  • matrix condition number,
  • and what these functions do internally.

Optional extension: investigate scipy.linalg.solve(A, b, assume_a="gen"), including how the assume_a keyword argument lets SciPy use extra matrix structure such as symmetric positive definiteness.

Exercise 5.3 — Stationary Iterative Methods

Repository: same as Ex 5.1   |   Edit: ex5-3.qmd   |   Deadline: May 21 (Thu), 23:59 JST

Implement two stationary iterative methods for solving \(Ax=b\).

At this point in the course, you are not expected to give a convergence analysis. The goal is to understand how the Jacobi and Gauss-Seidel updates work, run them on prepared examples, and observe when their behavior is similar or different.

In this report, you will:

  1. implement the Jacobi method,
  2. implement the Gauss-Seidel method,
  3. test both methods on the prepared systems,
  4. compare the number of iterations and residual histories.

Assignments and Preparation

1

Accept the Ex 5 GitHub Classroom link when announced.

  • One repository will contain Ex 5.0, 5.1, 5.2, and 5.3
  • The handout is shared with Lecture 6: 050/linear-equations-handout.qmd
  • Deadline: May 21 (Thu), 23:59 JST