<<

Orthogonal Method for Linear Systems. Preconditioning

Henar Herrero1, Enrique Castillo1,2 and Rosa Eva Pruneda1

1 Departamento de Matem´aticas, Universidad de Castilla-La Mancha, 13071 Ciudad Real, Spain. 2 Departamento de Matem´atica Aplicada y Ciencias de la Computacin, Universidad de Cantabria, Santander, Spain.

Abstract. The complexity of an orthogonal method for solving linear systems of is discussed. One of the advantages of the orthogonal method is that if some equations of the initial linear system are modified, the solution of the resulting system can be easily updated with a few extra operations, if the solution of the initial linear system is used. The advantages of this procedure for this updating problem are compared with other alternative methods. Finally, a technique for reducing the condition number, based on this method, is introduced.

1 Introduction

Castillo et al [1] have introduced a pivoting transformation for obtaining the orthogonal of a given . This method is applied to solve a long list of problems in including systems of linear equations. Nowa- days interest is focussed on iterative methods [2], [3], [4], [5] because they are more suitable for large systems. However, they present some difficulties such as conditioning, and for some problems a direct method can be more satisfactory. The direct methods arising from this transformation have complexityidentical to that associated with the Gaussian elimination method (see Castillo et al [1]). However, theyare speciallysuitable for updating solutions when changes in rows, columns, or variables are done. In fact, when changing a row, column or vari- able, a single step of the process allows obtaining (updating) the new solution, whithout the need of starting from scratch again. Therefore a drastic reduction in computational effort is obtained. The paper is structured as follows. In Section 2 the pivoting transformation is introduced. In Section 3 this transformation is applied to find the general solution of a linear system of equations. In Section 4 the main advantage of the method, i.e., the updating of solutions, is analyzed. In Section 5 the complexity of the method related to its updating facilities is studied. Finally, in Section 6 an strategyto reduce the condition number based on this orthogonal procedure is given.

P.M.A. Sloot et al. (Eds.): ICCS 2002, LNCS 2330, pp. 374−382, 2002.  Springer-Verlag Berlin Heidelberg 2002 Orthogonal Method for Linear Systems 375

2 Pivoting Transformation

The main tool to be used in this paper consists of the so called pivoting trans- Vj {vj vj } formation, which transforms a set of vectors = 1,..., n into another set Vj+1 {vj+1 vj+1} of vectors = 1 ,..., n by   vj j  k/tj; if k = j, vj+1 tj k =  vj − k vj  (1)  k j j ; if k = j, tj

j  j  where tj =0andtk; k = j are arbitraryreal numbers. Note that the set { j j ··· j } t1,t2, ,tn defines this transformation. In what follows the vectors above are considered as the columns of a Vj . This transformation can be formulated in matrix form as follows. Given a Vj vj vj vj matrix = 1,..., n ,where i ,i =1,...,n, are column vectors, a new matrix Vj+1 is defined via

Vj+1 VjM−1 = j , (2)

M−1 where j is the inverse of the matrix

T Mj =(e1,...,ej−1, tj, ej+1,...,en) , (3) and ei is the ith column of the identitymatrix. In this paper this transformation is asociated with a vector aj, so that the of tj is defined by

tT aT Vj j = j . (4)

j  M M−1 Since tj =0,thematrix j is invertible. It can be proved that j is the identitymatrix with its jth row replaced by t∗ 1 − j − j − j − j j = j t1,..., tj−1, 1, tj+1,..., tn . tj

This transformation is used in well-known methods, such as the Gaussian elimination method. However, different selections of the t-values lead to com- pletelydifferent results. In this paper this selection is based on the concept of , and a sequence of m transformations associated with a set of vectors {a1,...,am} is assumed. The main properties of this pivoting transformation can be summarized as follows (see [6]):

1. Given a matrix V, the pivoting transformation transforms its columns with- out changing the linear subspace theygenerate, i.e., L(Vj ) ≡L(Vj+1). 376 H. Herrero, E. Castillo, and R.E. Pruneda

2. The pivoting process (2) with the pivoting strategy(4) leads to the orthog- onal decomposition of the linear subspace generated bythe columns of Vj a a  0 j aT vj with respect to vector j.Let j = be a vector and let tk = j k; k = j  1,...,n.Iftj =0,then aT Vj+1 eT j = j . (5) j In addition, the linear subspace orthogonal to aj in L(V )is {v ∈LVj |aT v } L vj+1 vj+1 vj+1 vj+1 ( ) j =0 = 1 ,..., j−1, j+1,..., n ,

L vj+1 and its complement is ( j ). In other words, the transformation (2) gives the generators of the linear subspace orthogonal to aj and the generators of its complement. 3. Let L{a1,...,an} be a linear subspace. Then, the pivoting transformation (2) can be sequentiallyused to obtain the orthogonal set to L{a1,...,an} L V1 j a vj in a given subspace ( ). Let ti be the of j and i .Then j  assuming, without loss of generality, that tj = 0, the following is obtained tj tj L Vj L vj − 1 vj vj vj − n vj ( )= 1 j q,..., q,..., n j q tq tq L vj+1 vj+1 L Vj+1 = 1 ,..., n = ( ),

and L a a ⊥ ≡{v ∈LV1 |aT v aT v } L vj+1 vj+1 ( 1,..., j) ( ) 1 =0,..., j =0 = j+1,..., n .

In addition, we have

aT vj+1 ∀ ≤ ∀ r k = δrk; r j; j, (6)

where δrk are the Kronecker deltas. 4. The linear subspace orthogonal to the linear subspace generated byvector aj is the linear space generated bythe columns of Vk; for any k ≥ j +1with the exception of its pivot column, and its complement is the linear space generated bythis pivot column of Vk. 5. The linear subspace, in the linear subspace generated bythe columns of V1, orthogonal to the linear subspace generated byanysubset W = {ak|k ∈ K}

is the linear subspace generated bythe columns of V , > maxk∈K with the exception of all pivot columns associated with the vectors in W ,and its complement is the linear subspace generated bythe columns of V , > maxk∈K which are their pivot columns.

The following theorem shows how the orthogonal transformation can be used, not onlyto detect when a vector is a of previous vectors used in the pivoting process, but to obtain the coefficients of such combination. Orthogonal Method for Linear Systems 377

Theorem 1 (Linear combination). Let L{a1,...,an} be a linear subspace. j Applying sequentially the pivoting transformation (2), if tk =0for all k = j,...,n, then the aj vector is a linear combination of previous vectors used in the process, aj = ρ1a1 + ...+ ρq−1aj−1, (7) j a • vj vj where ρi = ti = j i ,and i is the corresponding pivot column associated with the vector ai, for all i =1,...,j− 1. j Proof. If tk =0forallk = j,...,n, ⊥ ⊥ aj ∈L {a1,...,aj−1} ≡L{a1,...,aj−1}, (8) then ∃ ρ1,...,ρj−1, such that aj = ρ1a1 + ...+ ρj−1aj−1. For i =1,...,n,we calculate the dot product a • vj a a • vj a • vj a • vj j i =(ρ1 1 + ...+ ρq−1 q−1) i = ρ1( 1 i )+...+ ρj−1( j−1 i )(9) a • vj a • vj  and using property4 of Section 2, i i =1and k i =0forallk = i, k = − a • vj 1,...,j 1, we obtain j i = ρi.

3 Solving a linear system of equations

Consider now the complete system of linear equations Ax = b:

a11x1 +a12x2 + ··· +a1nxn = b1 a21x1 +a22x2 + ··· +a2nxn = b2 ··· ··· ··· ··· ··· (10)

am1x1 +am2x2 + ···+amnxn = bm

Adding the artificial variable xn+1, it can be written as:

a11x1 +a12x2 + ··· +a1nxn −b1xn+1 =0 a21x1 +a22x2 + ··· +a2nxn −b2xn+1 =0 ··· ··· ··· ··· ··· ··· (11) am1x1 +am2x2 + ···+amnxn −bmxn+1 =0 am1x1 +am2x2 + ···+amnxn −bmxn+1 =0 xn+1 =1 System (11) can be written as:

T (a11, ···,a1n, −b1)(x1, ···,xn,xn+1) =0 T (a21, ···,a2n, −b2)(x1, ···,xn,xn+1) =0 ································· ··· (12) T (am1, ···,amn, −bm)(x1, ···,xn,xn+1) =0

T Expression (12) shows that (x1,...,xn,xn+1) is orthogonal to the set of vectors:

T T T {(a11,...,a1n, −b1) , (a21,...,a2n, −b2) ,...,(am1,...,amn, −bm) }. 378 H. Herrero, E. Castillo, and R.E. Pruneda

Then, it is clear that the solution of (11), is the orthogonal complement of the linear subspace generated bythe rows of matrix

A¯ =(A|−b), (13) i.e., the column -b is added to the matrix A :

T T T ⊥ L{(a11,...,a1n, −b1) , (a21,...,a2n, −b2) ...,(am1,...,amn, −bm) }

Thus, the solution of (10) is the projection on IRn of the intersection of the orthogonal complement of the linear subspace generated by

T T T {(a11,...,a1n, −b1) , (a21,...,a2n, −b2) ,...,(am1,...,amn, −bm) }. and the set {x|xn+1 =1}. To solve system (12) we apply the orthogonal to the A rows with V1 ≡L v1 v1 v1 e e 1,..., n+1 where i = i; i =1,...,n+1,and i is the vector with all zeroes except for the ith component, which is one. If we consider the j−th of system (11), i.e., aj x = bj, after pivoting with the corresponding associated vector, we can obtain the solution of this equation, Xj, Xj ≡ x ∈ Vk| ∧ aT • x xn+1 =1 j =0,k= j +1,...m . (14)

In fact, we consider the solution generated bythe columns of the corresponding table except the column used as pivot (see Section 2, property5), and we impose the condition xn+1 =1. Xm ≡L vm vm After this sequential process we have 1 ,..., nm , and then the solution of the initial system becomes vm L vm vm ˆnm + ˆ1 ,...,ˆnm−1 , (15) where vˆ is the vector obtained from v byremoving its last component (see table 2 for an example). L vm vm When ˆ1 ,...,ˆnm−1 degenerates to the emptyset, we have uniqueness of solution. For this to occur, we must have m = n and |A|=0;thatis,the coefficients matrix must be a square nonsingular matrix. If we are interested in obtaining the solution of anysubsystem,we will take the intersections of the corresponding solutions of each equation. Note that we have to keep the orthogonal and the complement set in each step for this process to be applied.

4 Modifying equations

Once the redundant equations have been detected in a system of linear equations, which is easyusing the orthogonal method for solving the system (see Theorem 1), we can suppose without lost of generality, that the linear system is not Orthogonal Method for Linear Systems 379 redundant. In this section we show how to update the solution of this system after modifying one equation, with only one extra iteration of the orthogonal method. Consider a not redundant initial linear system of equations Ax = b,and use the proposed method to solve it, but keeping the complement spaces. If the jth equation is modified, to obtain the new solution, the orthogonal subspace corresponding to the new equation is needed, instead of the orthogonal to the old equation. Since the orthogonal method can be started with anyspace V, the last table of the initial process can be taken as the initial table for solving the modified system and the modified equation can be introduced to make the extra pivoting transformation. Using as pivot the pivot column associated with the modified row, and taking into account properties 1 and 4 from Section 2, the solution of the modified system is obtained.

5Complexity

Castillo et al [1] have studied the number of operations required bythe orthogo- nal method for solving a linear system of equations. The conclusion of this study is that when this method is used for obtaining the final solution of a linear sys- tem of equations and in each step the complement space is removed, the number of operations is the same as the number of operations required for the Gaussian elimination method, that is, around 2n3/3 operations (see [7]). The aim in this section is to studythe number of operations of the complete process, keeping the complement space, in order to allow the updating of solutions after modifying an equation, and to compare this results with de Gaussian process. The number of operations required to solve a linear system of equations with the Gaussian elimination method (see [8]) is 2n3/3+(9n2 − 7n)/6, and with the orthogonal method it is (2n3 − 5n +6)/3 (see Ref.[1]). However, the number of operations of the orthogonal method keeping the complement space is 2n3 − n. When an equation is modified, an extra iteration is required to update the solution, which implies 4n2 − 2n extra operations. If several modifications in the original system are needed with the Gaussian elimination method we have to repeat the complete process each time to obtain the new solution. However, with the orthogonal method we need to make the complete process onlyonce (2 n3 − n operations) and one update for each mod- ification (4n2 − 2n operations). Then, the number of total required operations when the size of the system is n and the number of updates is k,is 2n3 − n +[k(4n2 − 2n)] for the orthogonal method, and k[(2/3)n3 +(9n2 − 7n)/6] for the Gaussian elimination method. ¿From these formulas we can conclude that for k>3 the number of oper- ations required bythe orthogonal method is smaller and then, it outperforms 380 H. Herrero, E. Castillo, and R.E. Pruneda

Table 1. Required number of products and sums for making an extra iteration of the orthogonal method.

Extra iteration

Products or divisions Sums

Dot Products n2 n(n − 1)

Normalization n –

Pivoting n(n − 1) n(n − 1)

Total 2n2 2(n2 − n) the Gaussian elimination method. This fact can be useful for nonlinear problems solved bymeans of iterations on linear approaches, i.e., for Newton methods.

6 Reducing the condition number

In this section we propose a method for obtaining an equivalent system of linear equations with a verysmall condition number for a full matrix. This kind of matrices appears veryoften when using spectral methods for solving partial differential equations. The idea uses the procedure explained in section 3 for solving a linear system. It is based on detecting that the matrix is ill conditioned when several of the rows of the matrix A are in veryclose hyperplanes, i.e., when tg(ai, aj)  1. The solution consists of rotating one of the vectors, but keeping it into the same hyperplane L(a¯i, a¯j). As an example, let A¯ be the matrix corresponding to the coefficient matrix whit the independent vector added of the following system:

0.832x1 +0.448x2 =1, 0.784x1 +0.421x2 =0. (16)

Using the orthogonal method (pivoting transformation (1)), we can see in the T ⊥ 1 1 T second iteration of Table 2, that L(¯a1 ) = L(v2, v3). When the vector ¯a2 in introduced into the pivoting process, it can be observed that it is almost 1 ⊥ orthogonal to v2, one of the generators of L(¯a1) , and this is the source of ill conditioning character (K(A) = 1755) of the given system. g To solve this problem the vector a2 can be replaced bya π/2 rotation, a2 = g gπ/2(a2), of a2 such that a¯2 =(gπ/2(a2),x23) ∈L(a¯1, a¯2). In this waythe linear ⊥ g ⊥ space L(a¯1, a¯2) is the same as the linear space L(a¯1, a¯2) . g g To calculate a¯2 the linear system a2 = αa1 + βa2 is solved, and then x23 is calculated as x23 = −αb1 − βb2. Orthogonal Method for Linear Systems 381

Table 2. Iterations for solving Eq. (16). Pivot columns are boldfaced.

Iteration 1 Iteration 2

T T 1 1 1 ¯a1 v1 v2 v3 ¯a2 v1 v2 v3

0.832 1 000.784 1 -0.538 -1.202

0.448 0 100.421 0 1 0

–1 0 01 0 0 0 1

0.832 0.448 –1 0.784 –7.92e-004 –0.942

Output

2 2 2 v1 v2 v3

1 -0.538 -438.542

01816.667

00 1

Table 3. Order of the condition number of the matrices equivalent to the Hilbert matrix of size n = 10 rotated in the rows from m to n.

m 9 8 7 6 5 4 3 2

K 1010 108 107 106 104 103 102 102

If this technique is applied to the system (16), the new coefficient matrix is obtained 0.8320 0.4480 A = −0.2261 0.4210 and K(A)=1.9775, i.e., the condition number has been drasticallyreduced. The new independent term becomes b = (1 442.959)T . It is straightforward to prove that the system Ax = b is equivalent to the system (16). In the case of a n × n system, to be sure that all the vectors are in different hyperplanes the following method can be applied: Starting by i = m (1

ag To calculate ¯j the following linear system, with unknowns αi,i=1, ..., j,is solved:

agtj atj atj ¯j = α1¯1 + ... + αj ¯j , where the superscript tj means truncated up to the index j,andthen

xjk = α1a1k + ... + αj ajk.

In this wayone can be sure that anytwo row vectors of the new matrix are in verydifferent hyperplanes and the condition number is reduced. This fact can be observed in table 3 : K(A)=O(1013)fortheHilbertmatrix,whereitcan be seen that if this technique is applied with increasing number of rows, the condition number reduces to K = O(102) when all the rows are involved. References

1. Castillo, E., Cobo, A., Jubete, F., Pruneda, R.E.:Orthogonal Sets and Polar Meth- ods in Linear Algebra: Applications to MatrixCalculations, Systems of Equa- tions and Inequalities, and Linear Programming. John Wiley and Sons, New York (1999) 2. Golub, G.H., van Loan, C.F.: MatrixComputations . Johns Hopkins University Press, London (1996) 3. Axelsson, O.: Iterative Solution Methods. Cambridge University Press, Cambridge (1996) 4. Kelley, C.T.: Iterative Methods for Linear and Nonlinear Equations.SIAM,Phy- ladelphia (1995) 5. Duff, I.S., Watson, G.A. (eds): The state of the art in .Oxford University Press, Oxford (1997) 6. Castillo, E., Cobo, A., Pruneda, R.E. and Castillo, C.: An Orthogonally-Based Pivoting Transformation of Matrices and Some Applications. SIAM Journal on MatrixAnalysis and Applications 22 (2000) 666-681 7. Atkinson, K.E.: An Introduction to Numerical Analysis. Jonhn Wiley and Sons, New York (1978) 8. Infante del R´ıo, J.A., Rey Cabezas, J.M.: M´etodos num´ericos. Teor´ıa, problemas ypr´acticas con Matlab.Pir´amide, Madrid (1999)