You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The <aclass="reference internal" href="cla_utils.html#cla_utils.exercises2.solveQ" title="cla_utils.exercises2.solveQ"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises2.solveQ()</span></code></a> function has been left
697
+
<p>The <codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises2.solveQ()</span></code> function has been left
698
698
unimplemented. Given a square unitary matrix <spanclass="math notranslate nohighlight">\(Q\)</span> and a vector <spanclass="math notranslate nohighlight">\(b\)</span>
699
699
it should solve <spanclass="math notranslate nohighlight">\(Qx=b\)</span> using information above (it is not expected
700
700
to work when <spanclass="math notranslate nohighlight">\(Q\)</span> is not unitary or square). The test script
<aclass="reference internal" href="cla_utils.html#cla_utils.exercises3.householder" title="cla_utils.exercises3.householder"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises3.householder()</span></code></a> to use the <codeclass="docutils literal notranslate"><spanclass="pre">kmax</span></code>
712
712
argument. You may make use of the built-in triangular solve
triangular matrix algorithms briefly later). The test script
715
715
<codeclass="docutils literal notranslate"><spanclass="pre">test_exercises3.py</span></code> in the <codeclass="docutils literal notranslate"><spanclass="pre">test</span></code> directory will also test this
716
716
function.</p>
@@ -840,7 +840,7 @@ <h2><span class="section-number">2.7. </span>Application: Least squares problems
840
840
by forming an appropriate augmented matrix <spanclass="math notranslate nohighlight">\(\hat{A}\)</span>, calling
<aclass="reference external" href="http://scipy.github.io/devdocs/reference/generated/scipy.linalg.solve_triangular.html#scipy.linalg.solve_triangular" title="(in SciPy v1.10.0.dev0+1685.9578695)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">scipy.linalg.solve_triangular()</span></code></a> to solve the resulting upper
843
+
<aclass="reference external" href="http://scipy.github.io/devdocs/reference/generated/scipy.linalg.solve_triangular.html#scipy.linalg.solve_triangular" title="(in SciPy v1.10.0.dev0+1989.d4a75c8)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">scipy.linalg.solve_triangular()</span></code></a> to solve the resulting upper
844
844
triangular system, before returning the solution <spanclass="math notranslate nohighlight">\(x\)</span>. The test
845
845
script <codeclass="docutils literal notranslate"><spanclass="pre">test_exercises3.py</span></code> in the <codeclass="docutils literal notranslate"><spanclass="pre">test</span></code> directory will also
<li><p>Finding an eigenvector <spanclass="math notranslate nohighlight">\(v\)</span> of <spanclass="math notranslate nohighlight">\(A\)</span> with eigenvalue <spanclass="math notranslate nohighlight">\(\lambda\)</span> (you can use <aclass="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.linalg.eig.html#numpy.linalg.eig" title="(in NumPy v1.23)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">numpy.linalg.eig()</span></code></a> for this),</p></li>
500
500
<li><p>Choosing a perturbation vector <spanclass="math notranslate nohighlight">\(r\)</span>, and perturbation parameter <spanclass="math notranslate nohighlight">\(\epsilon>0\)</span>,</p></li>
501
501
<li><p>Comparing the Rayleigh quotient of <spanclass="math notranslate nohighlight">\(v + \epsilon r\)</span> with <spanclass="math notranslate nohighlight">\(\lambda\)</span>,</p></li>
502
-
<li><p>Plotting (on a log-log graph, use <aclass="reference external" href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.loglog.html#matplotlib.pyplot.loglog" title="(in Matplotlib v3.5.3)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">matplotlib.pyplot.loglog()</span></code></a>) the error in estimating the eigenvalue as a function of <spanclass="math notranslate nohighlight">\(\epsilon\)</span>.</p></li>
502
+
<li><p>Plotting (on a log-log graph, use <aclass="reference external" href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.loglog.html#matplotlib.pyplot.loglog" title="(in Matplotlib v3.6.0)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">matplotlib.pyplot.loglog()</span></code></a>) the error in estimating the eigenvalue as a function of <spanclass="math notranslate nohighlight">\(\epsilon\)</span>.</p></li>
503
503
</ol>
504
504
<p>The best way to do this is to plot the computed data values as points,
505
505
and then superpose a line plot of <spanclass="math notranslate nohighlight">\(a\epsilon^k\)</span> for appropriate
@@ -773,7 +773,7 @@ <h2><span class="section-number">5.8. </span>The pure QR algorithm<a class="head
<aclass="reference internal" href="cla_utils.html#cla_utils.exercises9.get_C100" title="cla_utils.exercises9.get_C100"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises9.get_C100()</span></code></a>, and
775
775
<aclass="reference internal" href="cla_utils.html#cla_utils.exercises9.get_D100" title="cla_utils.exercises9.get_D100"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises9.get_D100()</span></code></a>. You can use
776
-
<aclass="reference external" href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.pcolor.html#matplotlib.pyplot.pcolor" title="(in Matplotlib v3.5.3)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">matplotlib.pyplot.pcolor()</span></code></a> to visualise the entries,
776
+
<aclass="reference external" href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.pcolor.html#matplotlib.pyplot.pcolor" title="(in Matplotlib v3.6.0)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">matplotlib.pyplot.pcolor()</span></code></a> to visualise the entries,
777
777
or compute norms of the components of the matrices below the diagonal,
778
778
for example. What do you observe? How does this relate to the structure
779
779
of the four matrices?</p>
@@ -1012,7 +1012,7 @@ <h2><span class="section-number">5.11. </span>The practical QR algorithm<a class
1012
1012
<p>This is very cheap, we just read off the bottom right-hand corner
1013
1013
from <spanclass="math notranslate nohighlight">\(A^{(k)}\)</span>! This is called the Rayleigh quotient shift.</p>
1014
1014
<p>It turns out that the Rayleigh quotient shift is not guaranteed to
1015
-
work in all cases, so there is an alernative approach called the
1015
+
work in all cases, so there is an alternative approach called the
1016
1016
Wilkinson shift, but we won’t discuss that here.</p>
Copy file name to clipboardExpand all lines: L6_krylov.html
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -364,13 +364,15 @@ <h2><span class="section-number">6.4. </span>Convergence of GMRES<a class="heade
364
364
well-conditioned, and <spanclass="math notranslate nohighlight">\(p(x)\)</span> is small for all <spanclass="math notranslate nohighlight">\(x\in \Lambda(A)\)</span>. This
365
365
latter condition is not trivial due to the <spanclass="math notranslate nohighlight">\(p(0)=1\)</span> requirement. One
366
366
way it can happen is if <spanclass="math notranslate nohighlight">\(A\)</span> has all eigenvalues clustered in a small
367
-
number of groups. Then we can find a low degree polynomial that passes
368
-
through 1 at <spanclass="math notranslate nohighlight">\(x=0\)</span>, and 0 near each of the clusters. Then GMRES will
369
-
essentially converge in a small number of iterations (equal to the
370
-
degree of the polynomial). There are problems if the eigenvalues are
371
-
scattered over a wide region of the complex plane: we need a very
372
-
high degree polynomial to make <spanclass="math notranslate nohighlight">\(p(x)\)</span> small at all the eigenvalues and
373
-
hence we need a very large number of iterations.</p>
367
+
number of groups, away from $0$. Then we can find a low degree
368
+
polynomial that passes through 1 at <spanclass="math notranslate nohighlight">\(x=0\)</span>, and 0 near each of the
369
+
clusters. Then GMRES will essentially converge in a small number of
370
+
iterations (equal to the degree of the polynomial). There are problems
371
+
if the eigenvalues are scattered over a wide region of the complex
372
+
plane: we need a very high degree polynomial to make <spanclass="math notranslate nohighlight">\(p(x)\)</span> small at
373
+
all the eigenvalues and hence we need a very large number of
374
+
iterations. Similarly there are problems if eigenvalues are very close
0 commit comments