311 and 937 1 t 1 1 t 1 1 r t r

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r( ) = (p( ) )TAp( ) = 0 6= : (9.3.13) Proof. This has essentially been proven by the prior developments. An algorithm for the conjugate gradient method is presented in Figure 9.3.3. Some comments on the algorithm follow: 1. Equation (9.3.9b) was used to modify the expression (9.3.7) for . 2. The procedure requires storage for the nonzero elements of A and for x( ) , p( ) , and r( ) . An additional vector is needed to store the product Ap( ) . Thus, storage costs remain modest relative to the direct methods of Section 9.1. 3. The procedure requires a matrix multiplication (Ap( ) ) and computation of two inner products ((r( ) )T r( ) and (p( ) )T Ap( ) ) per step. 4. Unlike SOR methods, there are no acceleration parameters to determine. 38 Solution Techniques for Elliptic Problems procedure conjugate gradient p(0) = r(0) = b ; Ax(0) =0 while not converged do = (r( ))T r( ) =(p( ) )T Ap( ) ( +1) = x( ) + p( ) x r( +1) = r( ) ; Ap( ) = (r( +1) )T r( +1) =(r( ))T r( ) p( +1) = r( +1) + p( ) = +1 end while Figure 9.3.3: Conjugate gradient algorithm. The conjugate gradient method is both a direct and an iterative method as indicated by the following theorem. Theorem 9.3.2. Let A be a positive de nite, symmetric, N N matrix. Then the conjugate gradient method converges to the exact solution in no more than N steps. Proof. By Theorem 9.3.1, the residuals r( ) , = 0 1 : : : N ; 1, are mutually orthogonal. Since the space is N -dimensional, the residual r(N ) must be zero hence, the method converges in N steps. While convergence is achieved in N steps, the hope is to produce acceptable approximations of x in far fewer than N steps when N is large. Practically, convergence may not be achieved in N steps when round-o errors are present. Example 9.3.2 ( 5], Section 14.2). Consider the solution of Laplace's equation on a square region with x = y = h. Let the Dirichlet boundary conditions be prescribed so that the exact solution is u(x y) = ex sin y: Solutions were calculated using SOR and conjugate gradient iterations until the change in the solution in the L2...
View Full Document

This document was uploaded on 03/16/2014 for the course CSCI 6840 at Rensselaer Polytechnic Institute.

Ask a homework question - tutors are online