Skip to content

Commit 175cfe8

Browse files
committed
Website build
1 parent c47e337 commit 175cfe8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2716
-2408
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 74daf348061de8c86e648bcb0a9328f8
3+
config: de2db627028eb0abe8fcc7f699961f36
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
555 KB
Binary file not shown.

exercises.html renamed to L0_setup.html

Lines changed: 260 additions & 236 deletions
Large diffs are not rendered by default.

L1_preliminaries.html

Lines changed: 82 additions & 63 deletions
Large diffs are not rendered by default.

L2_QR_factorisation.html

Lines changed: 38 additions & 38 deletions
Large diffs are not rendered by default.

L3_analysing_algorithms.html

Lines changed: 79 additions & 140 deletions
Large diffs are not rendered by default.

L4_LU_decomposition.html

Lines changed: 56 additions & 54 deletions
Large diffs are not rendered by default.

L5_eigenvalues.html

Lines changed: 82 additions & 38 deletions
Large diffs are not rendered by default.

L6_krylov.html

Lines changed: 60 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
21
<!DOCTYPE html>
32

4-
<html>
3+
<html lang="en" data-content_root="./">
54
<head>
65
<meta charset="utf-8" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
87

9-
<title>6. Iterative Krylov methods for \(Ax=b\) &#8212; Computational linear algebra course 2022.0 documentation</title>
10-
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
11-
<link rel="stylesheet" type="text/css" href="_static/fenics.css" />
8+
<title>6. Iterative Krylov methods for \(Ax=b\) &#8212; Computational linear algebra course 2023.0 documentation</title>
9+
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
10+
<link rel="stylesheet" type="text/css" href="_static/fenics.css?v=16c5e00f" />
1211
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
13-
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
14-
<script src="_static/jquery.js"></script>
15-
<script src="_static/underscore.js"></script>
16-
<script src="_static/doctools.js"></script>
12+
<script src="_static/documentation_options.js?v=f1ab3ab9"></script>
13+
<script src="_static/doctools.js?v=888ff710"></script>
14+
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
1715
<script src="_static/proof.js"></script>
1816
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
1917
<link rel="index" title="Index" href="genindex.html" />
2018
<link rel="search" title="Search" href="search.html" />
19+
<link rel="next" title="cla_utils package" href="cla_utils.html" />
2120
<link rel="prev" title="5. Finding eigenvalues of matrices" href="L5_eigenvalues.html" />
2221
<!--[if lte IE 6]>
2322
<link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
@@ -48,7 +47,7 @@
4847
<div class="body" role="main">
4948

5049
<section id="iterative-krylov-methods-for-ax-b">
51-
<h1><span class="section-number">6. </span>Iterative Krylov methods for <span class="math notranslate nohighlight">\(Ax=b\)</span><a class="headerlink" href="#iterative-krylov-methods-for-ax-b" title="Permalink to this headline"></a></h1>
50+
<h1><span class="section-number">6. </span>Iterative Krylov methods for <span class="math notranslate nohighlight">\(Ax=b\)</span><a class="headerlink" href="#iterative-krylov-methods-for-ax-b" title="Link to this heading"></a></h1>
5251
<details>
5352
<summary>
5453
Supplementary video</summary><div class="video_wrapper" style="">
@@ -72,7 +71,7 @@ <h1><span class="section-number">6. </span>Iterative Krylov methods for <span cl
7271
matrix-vector multiplication in some way; this is called a
7372
“matrix-free” implementation.</p>
7473
<section id="krylov-subspace-methods">
75-
<h2><span class="section-number">6.1. </span>Krylov subspace methods<a class="headerlink" href="#krylov-subspace-methods" title="Permalink to this headline"></a></h2>
74+
<h2><span class="section-number">6.1. </span>Krylov subspace methods<a class="headerlink" href="#krylov-subspace-methods" title="Link to this heading"></a></h2>
7675
<details>
7776
<summary>
7877
Supplementary video</summary><div class="video_wrapper" style="">
@@ -93,7 +92,7 @@ <h2><span class="section-number">6.1. </span>Krylov subspace methods<a class="he
9392
onto the Krylov subspace.</p>
9493
</section>
9594
<section id="arnoldi-iteration">
96-
<h2><span class="section-number">6.2. </span>Arnoldi iteration<a class="headerlink" href="#arnoldi-iteration" title="Permalink to this headline"></a></h2>
95+
<h2><span class="section-number">6.2. </span>Arnoldi iteration<a class="headerlink" href="#arnoldi-iteration" title="Link to this heading"></a></h2>
9796
<p>The key to Krylov subspace methods turns out to be the transformation
9897
of <span class="math notranslate nohighlight">\(A\)</span> to an upper Hessenberg matrix by orthogonal similarity
9998
transforms, so that <span class="math notranslate nohighlight">\(A=QHQ^*\)</span>. We have already looked at using
@@ -212,7 +211,7 @@ <h2><span class="section-number">6.2. </span>Arnoldi iteration<a class="headerli
212211
</div></blockquote>
213212
</section>
214213
<section id="gmres">
215-
<h2><span class="section-number">6.3. </span>GMRES<a class="headerlink" href="#gmres" title="Permalink to this headline"></a></h2>
214+
<h2><span class="section-number">6.3. </span>GMRES<a class="headerlink" href="#gmres" title="Link to this heading"></a></h2>
216215
<details>
217216
<summary>
218217
Supplementary video</summary><div class="video_wrapper" style="">
@@ -304,7 +303,7 @@ <h2><span class="section-number">6.3. </span>GMRES<a class="headerlink" href="#g
304303
</div>
305304
</section>
306305
<section id="convergence-of-gmres">
307-
<h2><span class="section-number">6.4. </span>Convergence of GMRES<a class="headerlink" href="#convergence-of-gmres" title="Permalink to this headline"></a></h2>
306+
<h2><span class="section-number">6.4. </span>Convergence of GMRES<a class="headerlink" href="#convergence-of-gmres" title="Link to this heading"></a></h2>
308307
<details>
309308
<summary>
310309
Supplementary video</summary><div class="video_wrapper" style="">
@@ -388,8 +387,8 @@ <h2><span class="section-number">6.4. </span>Convergence of GMRES<a class="heade
388387
What do you observe? What is it about the three matrices that
389388
causes this different behaviour?</p>
390389
</div></div></section>
391-
<section id="preconditioning">
392-
<h2><span class="section-number">6.5. </span>Preconditioning<a class="headerlink" href="#preconditioning" title="Permalink to this headline"></a></h2>
390+
<section id="preconditioned-gmres">
391+
<h2><span class="section-number">6.5. </span>Preconditioned GMRES<a class="headerlink" href="#preconditioned-gmres" title="Link to this heading"></a></h2>
393392
<details>
394393
<summary>
395394
Supplementary video</summary><div class="video_wrapper" style="">
@@ -398,24 +397,24 @@ <h2><span class="section-number">6.5. </span>Preconditioning<a class="headerlink
398397
over the last 30 years. Typically, the matrices that we want to solve
399398
do not have eigenvalues clustered in a small number of groups, and so
400399
GMRES is slow. The solution (and the challenge) is to find a matrix
401-
<span class="math notranslate nohighlight">\(M\)</span> such that <span class="math notranslate nohighlight">\(Mx = y\)</span> is cheap to solve (diagonal, or triangular, or
402-
something else) and such that <span class="math notranslate nohighlight">\(M^{-1}A\)</span> <em>does</em> have eigenvalues clustered
403-
in a small number of groups (e.g. <span class="math notranslate nohighlight">\(M\)</span> is a good approximation of <span class="math notranslate nohighlight">\(A\)</span>, so
404-
that <span class="math notranslate nohighlight">\(M^{-1}A\approx I\)</span> which has eigenvalues all equal to 1). We call
405-
<span class="math notranslate nohighlight">\(M\)</span> the preconditioning matrix, and the idea is to apply GMRES to
400+
<span class="math notranslate nohighlight">\(\hat{A}\)</span> such that <span class="math notranslate nohighlight">\(\hat{A}x = y\)</span> is cheap to solve (diagonal, or triangular, or
401+
something else) and such that <span class="math notranslate nohighlight">\(\hat{A}^{-1}A\)</span> <em>does</em> have eigenvalues clustered
402+
in a small number of groups (e.g. <span class="math notranslate nohighlight">\(\hat{A}\)</span> is a good approximation of <span class="math notranslate nohighlight">\(A\)</span>, so
403+
that <span class="math notranslate nohighlight">\(\hat{A}^{-1}A\approx I\)</span> which has eigenvalues all equal to 1). We call
404+
<span class="math notranslate nohighlight">\(\hat{A}\)</span> the preconditioning matrix, and the idea is to apply GMRES to
406405
the (left) preconditioned system</p>
407406
<blockquote>
408407
<div><div class="math notranslate nohighlight">
409-
\[M^{-1}Ax = M^{-1}b.\]</div>
408+
\[\hat{A}^{-1}Ax = \hat{A}^{-1}b.\]</div>
410409
</div></blockquote>
411410
<p>GMRES on this preconditioned system is equivalent to the following algorithm,
412411
called preconditioned GMRES.</p>
413412
<ul class="simple">
414-
<li><p>SOLVE <span class="math notranslate nohighlight">\(M\tilde{b}=b\)</span>.</p></li>
413+
<li><p>SOLVE <span class="math notranslate nohighlight">\(\hat{A}\tilde{b}=b\)</span>.</p></li>
415414
<li><p><span class="math notranslate nohighlight">\(q_1 \gets \tilde{b}/\|\tilde{b}\|\)</span></p></li>
416415
<li><p>FOR <span class="math notranslate nohighlight">\(n=1,2,\dots\)</span></p>
417416
<ul>
418-
<li><p>SOLVE <span class="math notranslate nohighlight">\(Mv = Aq_n\)</span></p></li>
417+
<li><p>SOLVE <span class="math notranslate nohighlight">\(\hat{A}v = Aq_n\)</span></p></li>
419418
<li><p>FOR <span class="math notranslate nohighlight">\(j=1\)</span> TO <span class="math notranslate nohighlight">\(n\)</span></p>
420419
<ul>
421420
<li><p><span class="math notranslate nohighlight">\(h_{jn}=q_j^*v\)</span></p></li>
@@ -440,13 +439,45 @@ <h2><span class="section-number">6.5. </span>Preconditioning<a class="headerlink
440439
</div><div class="proof-content">
441440
<p>Show that this algorithm is equivalent to GMRES applied to the
442441
preconditioned system.</p>
443-
</div></div><p>The art and science of finding preconditioning matrices <span class="math notranslate nohighlight">\(M\)</span> (or
444-
matrix-free procedures for solving <span class="math notranslate nohighlight">\(Mx=y\)</span>) for specific problems
442+
</div></div><p>The art and science of finding preconditioning matrices <span class="math notranslate nohighlight">\(\hat{A}\)</span> (or
443+
matrix-free procedures for solving <span class="math notranslate nohighlight">\(\hat{A}x=y\)</span>) for specific problems
445444
arising in data science, engineering, physics, biology etc. can
446445
involve ideas from linear algebra, functional analysis, asymptotics,
447446
physics, etc., and represents a major activity in scientific computing
448447
today.</p>
449448
</section>
449+
<section id="knowing-when-to-stop">
450+
<h2><span class="section-number">6.6. </span>Knowing when to stop<a class="headerlink" href="#knowing-when-to-stop" title="Link to this heading"></a></h2>
451+
<p>We should stop an iterative method when the error is sufficiently small.
452+
But, we don’t have access the the exact solution, so we can’t compute the
453+
error. Two things we can look at are:</p>
454+
<ul class="simple">
455+
<li><p>The residual <span class="math notranslate nohighlight">\({r}^k=A{x}^k-{b}\)</span>, or</p></li>
456+
<li><p>The pseudo-residual <span class="math notranslate nohighlight">\({s}^k = {x}^{k+1}-{x}^k\)</span>,
457+
which both tend to zero as <span class="math notranslate nohighlight">\({x}^k\to{x}^*\)</span> provided that <span class="math notranslate nohighlight">\(A\)</span> is
458+
invertible.</p></li>
459+
</ul>
460+
<p>How do their sizes relate to the size of <span class="math notranslate nohighlight">\({e}^k={x}^k-{x}^*\)</span>?</p>
461+
<div class="math notranslate nohighlight">
462+
\[\begin{split}{e}^k = &amp; {x}^* - {x}^k \\
463+
= &amp; A^{-1}(A{x}^*-A{x}^k) \\
464+
= &amp; A^{-1}({b}-A{x}^k) \\
465+
= &amp; A^{-1}{r}^k,\end{split}\]</div>
466+
<p>so <span class="math notranslate nohighlight">\(\|e^k\| \leq \|A^{-1}\|\|r^k\|\)</span>.</p>
467+
<p>The relative error <span class="math notranslate nohighlight">\(\|e^k\|/\|x^*\|\)</span> satisfies</p>
468+
<div class="math notranslate nohighlight">
469+
\[\frac{\|e^k\|}{\|x^*\|}
470+
= \frac{\|A^{-1}r^k\|}{\|x\|}
471+
\leq \|A^{-1}\|\frac{\|r^k\|}{\|x\|}
472+
\leq \|A^{-1}\|\|A\|\frac{\|r^k\|}{\|b\|},\]</div>
473+
<p>so the relative error is bounded from above by
474+
the condition number of <span class="math notranslate nohighlight">\(\|A\|\)</span> multiplied by
475+
the relative residual <span class="math notranslate nohighlight">\(\|r^k\|/\|b\|\)</span>. If the condition
476+
number is large, it is possible to have a small residual
477+
but still have a large condition number.</p>
478+
<p>Similar results hold for the pseudoresidual, but are
479+
more complicated to show for the case of GMRES.</p>
480+
</section>
450481
</section>
451482

452483

@@ -457,8 +488,8 @@ <h2><span class="section-number">6.5. </span>Preconditioning<a class="headerlink
457488
<div class="clearer"></div>
458489
</div>
459490
<div class="footer" role="contentinfo">
460-
&#169; Copyright 2020-2022, Colin J. Cotter.
461-
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.2.0.
491+
&#169; Copyright 2020-2023, Colin J. Cotter.
492+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
462493
</div>
463494
</body>
464495
</html>

0 commit comments

Comments
 (0)