2025 Week 3 - Linear systems 2, iterative solvers
Overview
Iterative solvers improve an initial estimate by reducing the residual, trading the robustness of direct methods such as LU for potentially lower memory use and better scaling on large sparse systems. The lecture compares Jacobi, Gauss-Seidel, and SOR with Krylov methods, explains why conjugate gradient suits symmetric positive definite matrices and GMRES handles more general systems, then presents preconditioning techniques including diagonal scaling, ILU, additive Schwarz, and multigrid.
Key takeaways
- For Ax = b, the residual r = Ax − b is the central convergence diagnostic, but reliable stopping decisions should consider both residual tolerances and changes in the solution.
- Jacobi is easier to parallelize because each update uses the previous vector; Gauss-Seidel reuses new values immediately and often converges faster, while SOR adds a tunable relaxation factor.
- Conjugate gradient is designed for symmetric positive definite systems and uses A-conjugate directions; in exact arithmetic it reaches the solution in at most n steps for an n-dimensional system.
- GMRES is the practical Krylov alternative for systems that are not SPD, and preconditioning can drastically reduce its iteration count, as in the example that fell from about 1,200 iterations to 10 with ILU fill level 20.
- Sparse structure is decisive for performance: dense LU scales as O(n³), while sparse direct methods, matrix-free products, and iterative solvers can exploit structure to reduce memory and computation.
- Preconditioners are approximations, not universal fixes: their setup and application cost, fill-in, memory use, and compatibility with the underlying physics all affect whether they improve a solve.
Chapters
- Gaussian elimination and LU are direct methods that reach a solution in a fixed sequence of steps.
- Dense direct solves scale roughly as O(n³), while sparse structure can make specialized solvers substantially more efficient.
- Direct solvers are usually the robust starting point; iterative methods refine an initial guess but may fail to converge.
- Iterative methods can reduce memory demands and solve large sparse systems faster when they converge.
- There is no universal size threshold for switching from LU: performance depends on the matrix, physics, and a proven solver setup.
- A practical workflow is to monitor direct-solver memory use and consider iterative methods if it approaches roughly 90 to 95 percent.
- For a candidate solution x, the residual is r = Ax − b; a small residual indicates that the equations are nearly satisfied.
- Iterative solvers stop when residual-based criteria reach a specified tolerance, but absolute and relative tolerances each have limitations.
- Scaling an equation by a constant changes the absolute residual, so a single absolute threshold may not reflect solution quality.
- A solver can also monitor changes in x, but a stalled solution does not necessarily mean the true solution has been found.
- The L2 norm combines vector components by squaring, summing, and taking a square root; the L-infinity norm tracks the largest component.
- Component scaling matters in multiphysics systems because a small aggregate norm can hide a substantial change in one variable.
- Stationary methods split A into lower, diagonal, and upper parts and repeatedly apply an update based on that fixed split.
- The component-wise idea is to adjust one unknown so its equation is consistent with the current values of the others.
- Jacobi, Gauss-Seidel, and successive over-relaxation are presented as foundational methods, although Krylov methods are more common in modern solvers.
- Jacobi calculates each new component from the entire previous iterate, then replaces the old vector after completing a full pass.
- A zero vector is a common initial guess for a linear solve.
- Diagonal dominance supports convergence because the diagonal coefficient outweighs the other entries in its row.
- Gauss-Seidel updates components in place, using newly calculated values immediately as it moves through the rows.
- That reuse often makes Gauss-Seidel converge in fewer iterations than Jacobi.
- Jacobi’s independent component updates are easier to parallelize; Gauss-Seidel’s sequential dependencies require more communication between workers.
- Successive over-relaxation (SOR) modifies each Gauss-Seidel update using a parameter omega.
- Omega equal to 1 recovers Gauss-Seidel; values below 1 under-relax, while values above 1 over-relax.
- A well-chosen omega can reduce iteration counts, but selecting it effectively depends on the system.
- A plotted diagonally dominant example shows Jacobi reaching its solution in 12 iterations, Gauss-Seidel in 6, and SOR in 5.
- The plotted contours represent residual values for Ax = b, and the solver paths differ as their update rules change.
- For a four-unknown example, the direct LU solve was faster than the stationary iterations, illustrating that convergence alone does not guarantee lower runtime.
- In the lecture’s dense-matrix timing example, a 5,000-unknown Gauss-Seidel solve took about 830 milliseconds versus 3.4 seconds for LU.
- At 10,000 unknowns, the demonstration reported about 23 seconds for LU and 3.43 seconds for Gauss-Seidel.
- Dense LU decomposition scales as O(n³); sparse direct solvers can exploit sparsity, but a generic dense solver does not automatically do so.
- Krylov subspace methods construct a sequence of directions that span an approximation to the solution.
- A basis represents vectors using independent directions; orthogonal vectors make projections and coordinate calculations simpler.
- An n-dimensional problem needs at most n independent basis vectors, though useful Krylov methods can often converge with far fewer.
- A symmetric positive definite (SPD) matrix defines a convex quadratic surface, with the solution corresponding to its minimum.
- For symmetric A, the quadratic function ½xᵀAx − bᵀx has gradient Ax − b, the residual.
- A symmetric but indefinite system can produce a saddle-shaped surface, so the minimum-based interpretation used by conjugate gradient no longer applies.
- Steepest descent follows the negative gradient, which for the quadratic system is the negative residual direction.
- The step length can be chosen by minimizing the quadratic along that direction.
- On a narrow valley, successive steepest-descent steps can zigzag and undo progress, motivating directions that account for earlier steps.
- Conjugate gradient chooses directions that are mutually orthogonal under the A-weighted product, rather than necessarily orthogonal in the ordinary dot product.
- A-conjugate directions prevent later updates from undoing earlier progress on an SPD system.
- The demonstration reaches the solution of a two-dimensional example in two steps, consistent with the exact-arithmetic bound of at most n steps.
- Roundoff can erode the conjugacy of search directions over many iterations, so implementations may periodically restart the method.
- The lecture notes that solver output may show residual changes near restart intervals, often around every 30 iterations.
- Krylov algorithms need the action of A on a vector, not necessarily an explicitly stored matrix, enabling matrix-free methods.
- Conjugate gradient is the preferred specialized method when A is symmetric positive definite.
- GMRES is presented as the general-purpose alternative when the system is not SPD.
- GMRES builds an orthogonal basis, but its convergence can be less reliable without preconditioning.
- A preconditioner transforms a poorly behaved system into a related system that is easier for an iterative method to solve.
- Poorly separated or nearly dependent directions can cause slow progress or oscillation; improving the system’s conditioning can help.
- No single preconditioner works well for every matrix or physical model, which makes preconditioning a major area of numerical research.
- Left preconditioning applies P⁻¹ to both sides of Ax = b; right preconditioning introduces the transformation on the solution side.
- Two-sided preconditioning can preserve symmetry in cases where maintaining that property is important.
- A preconditioner must be nonsingular to preserve the original system’s solution.
- The ideal preconditioner would be A⁻¹, turning the system into one with identity-like behavior, but computing it defeats the purpose of solving the system.
- Practical preconditioners approximate the effect of A⁻¹ while balancing setup cost, application time, memory, sparsity, and parallelism.
- Although P may be sparse, P⁻¹ is generally dense, so implementations apply the preconditioner without explicitly storing its inverse.
- A Jacobi preconditioner uses the diagonal of A, whose inverse is inexpensive to apply by dividing by each diagonal entry.
- In the finite-difference example, diagonal preconditioning reduced the condition number from about 1,000 to 32.
- Incomplete LU (ILU) limits fill-in to control storage; SciPy’s sparse tools can pair an ILU operator with GMRES, and the example reduced convergence from about 1,200 iterations to 10 using ILU with fill level 20.
- Additive Schwarz divides a mesh into overlapping subdomains, solves local pieces, and combines their contributions.
- Domain decomposition lets separate processors handle different regions, with overlap helping coordinate the local solutions.
- Multigrid moves between coarse and fine meshes to correct errors at different scales and can achieve near-linear convergence when the method suits the problem.
- Use parallel LU when memory permits; use conjugate gradient for SPD systems and GMRES for more general systems.
- For a well-known physics problem such as fluid dynamics, a specialized solver or physics-based preconditioner may outperform a general-purpose choice.
- When using additive Schwarz, the lecture gives local chunks of roughly 10,000 to 100,000 degrees of freedom as a practical scale and notes that geometric multigrid can be highly effective when applicable.
Transcript excerpt
0:00 Uh so th those uh announcements will be coming down soon. I'll post those on A2L that way everybody has them. I I got feedback last year that it was a bit weird having like the teams and A2L as sources of information. So I'll try and keep everything on to A2L. Is that is that better? Okay. Can do. Okay. Iterative methods. Uh Gaussian elimination LU decomposition all those are direct solvers. And what that means is that they they will find the solution in a set number of steps. Right? So when we were doing the Gaussian elimination, you take your pivot row, you subtract by the next one, you eliminate that. You take that one, you subtract by the next one, you eliminate that. B. We talked about it. And for dense matrices that scales terribly, right? It scales order and
0:49 cubed. for sparse matrices especially like banded and things like that and like structured sparse matrices it um it becomes faster and significantly faster and on the assignment you you have that you can see like like that working um but generally speaking for large enough systems it gets to be a bit problematic they are however the most robust right so again with console you know your direct solvers and the the modern direct solvers are kind of like your go-to I would say safely until you're at the point where you've nailed down the physics and the equations and you're like fine-tuning stuff. So again in console almost all the time are the solvers that we use where the direct solvers in few exceptions on your reports maybe you had like multifysics and then you had um like navier stoopes
1:36 along with uh heat transport and this and this and this console underneath the
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Numerical Methods for Engineering.