Docsity

Iterative Matrix Methods - Lecture Slides | PETE 604, Study notes of Engineering

Toggle sidebar
bg1
CHAPTER 5
Iterative Matrix Methods
• Some Basics of Linear Algebra
• Conjugate Gradient Methods in Reservoir Simulation
• Method of Steepest Descent
• Classical Conjugate Gradient Method
• Generalized Conjugate Residual Method
• ORTHOMIN Method
• Convergence Acceleration
• Watt's Conjugate Gradient Method
• Appendix A - Derivation of -
α
• Appendix B - Some Computer Programs
• Numerical Examples of Convergence Methods
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32

Partial preview of the text

Download Iterative Matrix Methods - Lecture Slides | PETE 604 and more Study notes Engineering in PDF only on Docsity!

CHAPTER 5

Iterative Matrix Methods

  • Some Basics of Linear Algebra
  • Conjugate Gradient Methods in Reservoir Simulation
  • Method of Steepest Descent
  • Classical Conjugate Gradient Method
  • Generalized Conjugate Residual Method
  • ORTHOMIN Method
  • Convergence Acceleration
  • Watt's Conjugate Gradient Method
  • Appendix A - Derivation of - α
  • Appendix B - Some Computer Programs
  • Numerical Examples of Convergence Methods

Iterative Matrix Methods

Some Basics of Linear Algebra

Inner Product of Vectors. Let

u = u 1 i + u 2 j +u 3 k and v = v 1 i + v 2 i+ v 3 k (1)

be vectors in three dimensional vector space, where i, j and k represent the coordinate vectors. The vectors u and v can be written as column vectors,

u

u u u

1 2 3

, v (2)

v v v

1 2 3

The standard inner product (sometimes called the dot product) of the above vectors in three dimensional space is determined as

(u, v) = uT^ v = u vT^ (3)

and is also given by

(u,v) = (^) u v i=

n

Σ i^ i

where n is the dimension of the vector space (equal to 3 in the above case). uT^ is the transpose of the "matrix" u, obtained by interchanging the rows and columns of u. Standard inner product is also denoted as u. v.

Example

Let u and v be column vectors in two dimensional vector space such that,

u = −

, v =

Substituting for the vectors,

a (^) 1 a (^) 2 a (^) 3 a 4

We now have four simultaneous equations of the form:

(1)a 1 + (1)a 2 + (0)a 3 + (0)a 4 = 0 (1)a 1 + (0)a 2 + (0)a 3 + (1)a 4 = 0 (0)a 1 + (1)a 2 + (1)a 3 + (0)a 4 = 0 (0)a 1 + (0)a 2 + (1)a 3 + (1)a 4 = 0

Solving as we usually do, we get

a 1 = 1, a 2 = -1, a 3 = 1 and a 4 = -1.

and the expression is

v 1 - v 2 + v 3 - v 4 = 0.

Thus we have found values for the constants, not all equal to zero, to satisfy the condition for linear independence of vectors. We conclude that the given vectors are linearly dependent , even though each pair is linearly independent.

Example

Check for linear independence of the following set of vectors

u =

, v =

The vectors are dependent since v can be expressed in terms of u as:

v = 2u

Orthgonality of Vectors. By definition, two vectors are orthogonal to each other if their standard inner product, or dot product, is equal to zero, i.e.

(u, v) = u • v = 0 (8)

Example

Check for orthogonality between vectors u and v in a two dimensional vector space, where

u = −

, v =

The inner product is equal to

(u,v) = (^) u v i=

n

Σ i^ i

Thus the vectors u and v are orthogonal to each other.

Definition : p is A conjugate if (p, Ap) = 0, i.e., p is orthogonal to Ap where A is a matrix.

Construct a vector, p 2 , orthogonal to p 1 , given v. using the Gram-Schmidt method. Given two linearly independent vectors p 1 and v , construct a vector p 2 orthogonal to p 1. Thus the inner product of p 1 and p 2 is (p 2 , p 1 ) = 0. Let p 2 be a linear combination of v and p 1.

p 2 = v + βp 1 (9)

Substituting for p 2 in the condition for orthogonality,

(v + βp 1 , p 1 ) = 0

(v, p 1 ) + β(p 1 , p 1 ) = 0

Solving for β,

(v, p ) ( p , p )

1 (^1 1) (10)

where β is the scaling factor multiplying the vector p 1 in order to find a vector p 2 orthogonal to it.

Example 4

Solving the above expression for β,

(Av, Ap ) ( Ap , Ap )

1 (^1 1) (15)

p 2 = v + βp 1 (16)

Example

Using the vectors given in the above example and the coefficient matrix

A =

find a vector p 2 such that Ap 2 is orthogonal to Ap 1.

Av = =

Ap 1 = =

The scaling factor

(Av, Ap ) ( Ap , Ap )

1 1 1

The vector p 2 is

p 2 = v + βp 1

⎥ +^ −^

Construct a vector, p 3 , orthogonal to vectors p 1 and p 2. Given another vector v such that p 3 is a linear combination of v, p 1 and p.

p 3 = v + β 1 p 1 + β 2 p 2. (17)

We know that the three vectors p 1 , p 2 and p 3 are mutually orthogonal to each other, thus

(p 3 , p 1 ) = 0

(p 3 , p 2 ) = 0

(p 2 , p 1 ) = 0

Substituting for p 3 in the first condition,

((v+ β 1 p 1 + β 2 p 2 ), p 1 ) = 0 (18)

or

(v,p 1 ) + β 1 (p 1 , p 1 ) + β 2 (p 2 , p 1 ) = 0 (19)

In the above expression, the term containing β 2 is equal to zero as (p 2 , p 1 ) = 0. We now have the scaling factor β 1 in terms of the vectors as:

(p,p )

(v,p) =- 1 1

1

Similarly, substituting for p 3 in the second condition, we obtain an expression for β 2

(p ,p )

(v,p) =- 2 2

2

Example

Conjugate Gradient Methods in Reservoir Simulation

[Taken from notes by R. Chick Wattenbarger (1985)]

This section discusses the conjugate gradient (CG) and conjugate residual (CR) methods used in reservoir simulation. The conjugate gradient method was introduced in 1952 by Hestenes and Stiefel, as an iterative technique for solving systems of linear equations. CG methods initially received a great deal of attention, but interest lessened in favor of successive overelaxation (SOR). During the 1970's, the CG and CR methods gained popularity in reservoir simulation as the petroleum industry attempted to simulate increasing difficult problems.^2

Reservoir simulators model the behavior of petroleum reservoirs by solving partial differential equations that mathematically describe the relevant physical processes occurring in the reservoir. These partial differential equations are usually solved using finite differences. The finite difference solution creates a system of equations that may be expressed in the matrix form:

Ax = b ,

where A is an NxN real matrix, x is the unknown solution vector, b is a real vector and N is the number of equations be solved. In reservoir simulation these matrices are sparse (containing mostly zero elements), banded and conventionally diagonally dominant and nearly symmetric. The methods used to solve these problems are generally classified as either direct or iterative.

Direct methods usually employ some form of guassian elimination. The work and storage requirements of direct methods are proportional to the matrix bandwidth. The matrix bandwidth is determined by a some product of the problem's two smallest dimensions, and is large enough in many problems to make direct methods impractical. The advantage of direct methods is that they always solve the matrix problem. The D4 ordering technique is a popular direct method in reservoir simulation.

Iterative methods are well suited to solving many reservoir simulation problems because they take advantage of the sparseness of the matrix being solved. The work requirement is proportional to the number of iterations required times the number of equations being solved. Iterative methods usually require less storage and less work than direct methods, but may fail to converge. Because iterative techniques can be solved to any tolerance of accuracy and direct methods are subject to roundoff error, the relative accuracy these techniques is not a central issue.

Initially the standard iterative methods used in reservoir simulation were the Strongly Implicit Procedure (SIP) and the Successive Over Relaxation (SOR) method. For best results these methods require the trial and error choice of iteration parameters. These techniques work well for the type of problems encountered in early simulation of nearly homogeneous reservoirs using the IMPES (implicit pressure, explicit saturation) formulation. These problems produced positive definite, nearly symmetric matrices. However, for non-homogeneous problems with high transmissibility ratios, SIP and SOR may fail to converge or converge very slowly.

Conjugate gradient methods have become popular in reservoir simulation because, though essentially iterative, they are guaranteed to converge after N iterations. For this reason CG methods are called semi-iterative. The CG method proposed by Watts (1981), is a means of handling the non-homogeneous, but nearly symmetric problems resulting from the IMPES formulation.^5

With the increased interest in EOR recovery, more difficult problems had to be solved. Thermal problems in particular, are solved with formulations that yield ill-conditioned, highly non- symmetric matrices. Because the early CG methods required a symmetric A matrix, a number of variations have been developed. The most prominent of these are the conjugate residual (CR) methods. The basis of the CG and CR method is described on the following pages.

Classification of Iterative Matrix Solution Techniques. Given

Ax = b

we seek x k+1^ = gk(A,b,xk,xk-1,.........xk-(m +1)

such that lim xk+1^ = x k → ∞

Iterative techniques may be classified as follows:

Degree = m Stationary if Gk^ = G for all k Linear if Gk^ = linear function of xi, i = 1,k

First degree (m=1) iterative techniques may be expressed as:

xk+1^ = xk^ + ckpk or xk+1^ = Tkxk^ + qk

The Successive Over Relaxation (SOR) and Strongly Implicit Procedure (SIP) techniques are the most commonly used methods based on this concept.

The following discussion will use the first form with ck^ as a scalar αk. Thus

xk+1^ = xk + α kpk

The significance of this equation may be interpreted as follows. Over the iteration from k to k+1, xk

proceeds in the pk^ direction for a distance αk^ along the surface φ (x). φ (x) is a measure of the error in

xk. The choice of α k^ and pk^ depends on the iterative technique. αk^ is usually chosen to minimize

φ (x) in the pk^ direction. The choice of the direction vector pk^ is often related to the gradient of φ (x).^6

Method of Steepest Descent

Algorithm. At the beginning of the timestep, i.e at the start of iterations , let

x^0 = arbitrary; and ro^ = b - Axo.

For iterations k+1 = 1, 2,..................., the calculations are carried out as follows

pk^ = rk

( ) ( k k )

k k

p Ap

r p ,

The unknown vector and the residual vector are updated as follows:

xk+1^ = xk+ α kpk

rk+1^ = b - Axk+1^ = rk^ - α k^ Apk.

The above steps are repeated until convergence.

Thus, the direction vector pk^ is chosen in the direction of steepest descent, that is pk^ = rk. αk^ is chosen to minimize (e,r) in the pk^ direction where e is the error vector. Although (e,r) and F(x) are minimized locally in the most rapid manner, this method can be very slow, particularly for ill- conditioned matrices. This method tends to overshoot.^2

Conjugate Direction Techniques. The direction vectors p^0 , p^1 , ...pk-1^ are selected to be non-zero and mutually A-conjugate. That is (Api, pj) = 0 for i different of j. The Gram-Schmidt orthogonalization procedure can be used to generate A-conjugate vectors pk^ from any set of linearly independent vectors (vi) i=0, k-1. Hestenes and Stiefel (1952) show that the CG method is equivalent to Gaussian elimination when (v) is chosen as the set of unit base vectors, i.e. (0,0,0,1), (0,0,1,0), .... The conjugate gradient method is a conjugate direction technique with (v) chosen to be equal to the residual vectors.^2

Classical Conjugate Gradient Method

Algorithm. At the beginning of the timestep, i.e at the start of iterations , let

x^0 = arbitrary; and p^0 = r^0 = b - Ax0.

For iterations k+1 = 1, 2,..................., the calculations are carried out as follows

αk^ = (pk,rk) = (rk,rk)

(pk,Apk) (pk,Apk)

The unknown vector and the residual vector are updated as follows:

xk+1^ = xk^ + αk^ pk

rk+1^ = b - A xk+1^ = rk^ - αk^ A pk The magnitude of the scaling factor is determined as

(rk,Apk) = (rk+1,rk+1) βk^ = − (pk,Apk) (rk,rk) The new value of the search direction vector is determined from the previous known value as follows: pk+1^ = rk+1^ +βkpk

A must be symmetric positive definite (SPD). αk^ is chosen to minimize (e,r) or F(x). Thus (e,r) decreases every iteration, but r may not. βk^ is chosen such that (pi, Apj) = 0 for i > j, i.e the direction vector pk^ is A-conjugate to Ap k-1.

The residual vectors r^0 , r^1 ,... are mutually orthogonal. Thus, rk^ = 0 for some k ≤ N. That is, the classical CG method converges in at most N iterations, neglecting roundoff errors. The larger ( αk/ αk-1), the more roundoff errors effect the orthogonality relations. However the CG method is stable with respect to roundoff errors.

The CG method varies from the method of steepest descent in its choice of direction vectors, making the CG method more suited to solve ill-conditioned matrices.^2

ORTHOMIN Method

Algorithm. At the beginning of the timestep, i.e at the start of iterations , let

x^0 = arbitrary; r^0 = b^0 - Ax^0 and p^0 = v^0 = H-1^ r^0

For iterations k+1 =1, 2,..................., the calculations are carried out as follows. First a shift vector is calculated

vk^ = H-1^ rk

where H is an approximation of A, such that H-1^ is approximately equal to A-1. This step is called preconditioning.

αk^ = (rk,Apk) (Apk,Apk)

The unknown vector and the residual vector are updated as follows:

xk+1^ = xk^ + αk^ pk+

rk+1^ = b - A xk+1^ = rk^ - αk^ A pk

The magnitude of the scaling factors are determined as

β j k (^) = − (Av,Apj) (Ap ,Ap )j^ j j = 0, 1, 2,........., k.

The new value of the search direction vector is determined from the previous known values as follows pk+1^ = vk^ + ∑ k^ βkjpj j = max(0,k_m+1)

CR requires large amounts of work and storage. This lead Vinsome to propose a truncated version of CR called ORTHOMIN. Instead of making Apk+1^ orthogonal to all the preceding direction vectors Apj, ORTHOMIN makes Apk+1^ orthogonal only to the last m vectors. This requires less storage and work than the classical CR. However, the convergence is no longer guaranteed in N iterations.^1 ORTHOMIN requires that a shift vector be computed each iteration by preconditioning (approximating x* = A-1r with v = H-1r). The vector v is the shift vector. Any preconditioner can be used which suits the problem being solved. ORTHOMIN is the most commonly method in the industry for large problems.

Convergence Acceleration

The convergence of the CG and CR methods depend on the eigenspectrum of the matrix A. The convergence may be accelerated by solving the equivalent system.

(H-1A)x = H-1b

where H is sparse, easy to factor, and a good approximation of A. The closer H is to A, the faster the convergence. This is called preconditioning, and should reduce the work requirements.^4

For the case where A is symmetric, A may be decomposed as LDLT, where L is a lower triangular matrix, D is a diagonal matrix. For non-symmetric case, A may be factored as LU, where U is an upper diagonal matrix. Generally, these decompositions are not as sparse as A, but since H only needs to be an approximation of A, the factorization only needs to be approximate. Several papers describe decomposition method which retain the sparseness of A to some degree. Most of these methods take advantage of the fact that the magnitude of the element in the decomposition matrices decrease in the direction of the arrows below.

This allows a factorization of the A matrix which has a limited number of bands, the more insignificant bands being set to zero by compensating the remaining bands.^5

Conclusion. The CG methods have gained wide acceptance in the petroleum industry because of their robustness in solving difficult problems. The non-truncated versions of the CG and CR methods are guaranteed to converge within N iterations, but do so slowly. However, of the preconditioning methods, only the ORTHOMIN procedure theoretically guarantees convergence in N iterations. ORTHOMIN and its variations seem to be the most widely used, even though the CG methods have now been adapted to handle non-symmetric matrices. A majority of current research is devoted to developing preconditioning methods for faster, more efficient convergence.

REFERENCES
  1. Eisenstat, S., Elman, H. and Schultz, M.: "Variational Methods for Non- Symmetric Systems of Linear Equations", SIAM Journal of Numerical Analysis, Vol. 20, No. 2, April 1983, p. 345-357.
  2. Jea, K. C. and Young, D.M., "Generalized Conjugate Gradient Acceleration of Non- symetrizable Iterative Methods," Linear Algebra and its Applications, 34, 1980, pp. 159-194.
  3. Vinsome, P., "Orthomin, an Iterative Method for Solving Sparse Banded Sets of Simultaneous Linear Equations," paper SPE 5729 presented at the SPE-AIME Fourth Symposium on Numerical Simulation of Reservoir Performance, Los Angeles, CA (Feb. 1976).
  4. Wallis, J.R., "Incomplete Gaussian Elimination as a Preconditioning for Generalized Conjugate Gradient Acceleration," paper SPE 12265, presented at the Seventh SPE Symposium on Reservoir Simulation, San Francisco, 1983.
  5. Watts, J. W.: "A Conjugate Gradient Truncated Directed Method for the Iterative Solution of the Reservoir Simulation Pressure Equation," SPE Journal, (June 1981) 345-353.
  6. Westlake, J. R.: A Handbook of Numerical Matrix Inversion and Solution of Linear Equations. John Wiley & Sons, Inc. New York, 1968.

Watt's Conjugate Gradient Method

Summary. A pre-conditioning C.G. method for near symmetrical IMPES matrices. Pre- conditioning method efficiently handles coefficient anisotropy.


solving the problem Ax = b

overview

Step 1. construct a symmetric matrix As ≅ A Step 2. rn^ = b - Axn

Step 3. if || rn^ || < tolerance, stop

Step 4. solveAs x* = rnw/ PCG method

Step 5. xn+1^ = xn^ + x*

Step 6. Go To step 2


Step 1. for IMPES A is almost symmetric

i.e. a (^) E (^) i j ≠ awi + 1 j (but almost = )

for our symmetric matrix, AS

let ( a ) ( a )

a a E (^) s w (^) s

E w i j i j

i j s i j = =

1

1 2 Step 4.

Solution of AS x* = rn^ w/ PCG Method

Step 4a. (Preconditioning step)

Approximate H ≈ As

Solve H v = r

v = H-1^ r v is the "shift vector" 19