Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JSchoeberl committed Mar 12, 2024
1 parent a07efc9 commit 54a7e38
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
19 changes: 15 additions & 4 deletions _sources/iterative/conjugategradients.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,20 @@
"id": "assisted-lounge",
"metadata": {},
"source": [
"In Saad, \"Iterative Solvers\", the Preconditioned Conjugate Gradient method\n",
"is Algorithm 9.1, page 277. The inner products are reformulated by recursions which have better stability with respect to roundoff errors."
"In [Saad, \"Iterative Solvers\"](https://www-users.cse.umn.edu/~saad/IterMethBook_2ndEd.pdf), the Preconditioned Conjugate Gradient method\n",
"is Algorithm 9.1, page 277. The inner products are reformulated by recursions which have better stability with respect to roundoff errors.\n",
"\n",
"\n",
"> Given $x_0$ <br>\n",
"> $r_0 = b - A x_0$ <br>\n",
"> $p_0 = C^{-1} r_0$ <br> \n",
"> for $k = 0, 1, 2, \\ldots$ <br>\n",
"> $\\qquad \\alpha_j = \\frac{r_k^T w_k}{p_k^T A p_k}$ <br>\n",
"> $\\qquad x_{k+1} = x_k + \\alpha_j p_k$ <br>\n",
"> $\\qquad r_{k+1} = r_k - \\alpha_j A p_k$ <br>\n",
"> $\\qquad w_{k+1} = C^{-1} r_{k+1}$ <br>\n",
"> $\\qquad \\beta_k = \\frac{r_{k+1}^T w_{k+1}}{r_k^T w_k}$ <br>\n",
"> $\\qquad p_{k+1} = w_{k+1} + \\beta_k p_k$<br>\n"
]
},
{
Expand Down Expand Up @@ -180,7 +192,6 @@
" \n",
" wrn = InnerProduct(w, r)\n",
" err = sqrt(wrn)\n",
" # print (\"Iteration\",it,\"err=\",err)\n",
" if callback: callback(it,err)\n",
" if err < tol * err0: break\n",
" \n",
Expand All @@ -206,7 +217,7 @@
"a = BilinearForm(grad(u)*grad(v)*dx+10*u*v*dx).Assemble()\n",
"f = LinearForm(x*y*v*dx).Assemble()\n",
"gfu = GridFunction(fes)\n",
"pre = a.mat.CreateSmoother() "
"pre = a.mat.CreateSmoother(GS=False) "
]
},
{
Expand Down
23 changes: 17 additions & 6 deletions iterative/conjugategradients.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 54a7e38

Please sign in to comment.