INFORMATICA 1/1982 ALGORITHMS FOR THE SOLUTION OF THE GENERALIZED EIGENVALUE PROBLEM Z. BOHTE, J. GRAD UDK: 521.643.5 INSTITUTE OF MATHEMATICS, PHVSICS AND MECHANICS JADRANSKA 19, LJUBLJANA, VUGOSLAVIA ln this paper we deal with generajized eifenvaluii problem of matrix A(z) the elemcnts oi uhicli ni' j)olynomials iu z. Tlio well known iterative metliods of Muller, lluuton and Lagaerre for finu.ini; tli^ zeros of funetion f(s') = det A(z) arv analysed. UtcomponitioiiG of matrix A(z) and its aori vat.i V'=i: ave introducetl in ordtr to E;implify the coiuputatiouL; of the values of f(z) and its first and seeond derivatives. Coitiparative analysi:; giveu some indicators about the rate of converiifiicu, computer timt; and accuracy of the computed feifenvaluns for eacli of t:he mui-tiod used. Tliu cinr>lyv.'.--a methods provcd generally to be s:;table, economical and easily applicable. FOR'1'RAII subroulines and cjii exaniple of main calling, pro^raričme are added for Mullur*s and Lafuerre'c inothods wli.icn piovcii L be mor'e efficient tlian Uev;ton's. ALCORITMI ZA RnSLVANJi: TOSPLOSLNEGA PRObLJiMA I.ASTMIli VKKDNOSTI. V članku je obraviidvario miipiuriino rvševanje posploženega problenia lastnih vruilnosti .-.a matriko A(.z) z eleiiiKfiti,- ki t;o JJO l inoini G[:>f 11it= clnssiical cipc:nvalue j.roblem, for instaiice, <,i alpori thni i_'lj, it is not economical to r^duoe tlie problem (1) to the standard fonn (3). Moreovor, niany practical pi'Cblenr; ljkc "flutter" problem in aorodynamicE, ;iro :uiu)i that botli A arul A are sjnpular afid ttio o in '• reduction to the standard forro causes fui'ttit;r difficulties [.3]. It is therefore considered as mor>i ativantči^uu to work directly witli the matrix (7) \n all casi;S. Thu most naLuivil approach i:; to 44 determine the neroes of the polynomial f(z ) = det A(z) (M) using some of the many well known methods. There are some efficient and stable algorithms for tlie evaluation of the determinant of the matrix, for instance, Gaussian elimination with pivoting [Vf . It has been believed so far that the evaluation of the' derivative of the determinant involves much more work than the evaluation of the determinant does, and therefore the interpolation methods which require only function values had been suggested for the solution of the algebraic equation f(z ) => 0 (5) see [3J , [VJ . The most popular of these methods is Muller's method {_HJ of successive quadratic interpolation. The prejudice against the methods which require the derivatives of the function is probably based on the fact that the derivative of the determinant is a sum of n determinants. However, there can be found in [l] a formula for the logarithmic derivative of the determinant which together with its derivative enable us to solve (5) by using Newton's' or Laguerre's method efficiently. In this paper algorithms for the solution of the generalized^igenvalue problem (1), based on Muller"s', Newton's and Laguerre"s methods are described and compared with regard to: (i) the number of operations (multiplications and divisions) involved in iteration step, (ii) the number of iterations, and (iii) the computer time used. The computations were performed on a number of typical exampl.es. Muller^s method Muller's method for the solution of the equation (5) as described ,in [V| is the following iterative process. From the three previous consecutive approximations Co a root of (5): zr_2> zr_j> zr> the parabola through the points ) is formed arid its zero which is the closest fo z^ is accepted as the next approximation, say zr+1> to a root. The asymptotic rar.e of convergence to a simple root in of ordtr 1.84 and at each iteration step^ only orie new function value is required. It is necesuary to use complex arithmetic ChroughouC. The algorithm i3 as follows. Fbr r=2, 3, ... we calculate hr s 2r " zr-l' kr = hr/hr-l' 6r = fr-2kr " fr-ldr + Vkr zr+l - fr-ldr (b) The sign in the denominator of (6) is chosen ao as to give the corr< absolute magnitude. as to give the correction to z the smaller The choice of the first three approximations is left to the user. There are no pi'oofs of the global convergGnce of the iterative process. In this case we have to calculate the value of f = f(z) = det A(z) at each iteration step what can be done most efficiently by triangular decompouition of the matrix A(z) using partial pivotinj; as follows. For the given value of z we first calculate the elements of the matrix A s A(z) (7) what requires m.n operations. Then we decompose A into the forin PA = LU (8) where L is unit lower triangular matrix, U is upper triangular matrix, and P is tlie corresponding permutation matrix Q»'J . 'fhis step requires n /3 - n/3 operations. Finally we compute f = ± det U = t u^u«. ... u 11 22 nn what requires n-1 operations. Togother we must perform opM = m.n2 + n3/3 + 2n/3-l operations for the calculation of f. Newton^s methocl The well known Newton's method for the solntion of (5) is the iterative process' At each iteration ntop we evaluate ttie corriiction of the current approxiraation to a root as the reciprocal of the logar'i thinic derivative of the function. From |l|, | 2*1 wu have the formula f'(z)/f(z) = triA'* (z)l\'(z)) - tr X (0) 45 where A'(z) denotes the derivative of the matrix A(z) with respect to z. An efficent algorithm for calculating the expression (9) is as follows. First we calculate the matrices A = A(z), B = A'(z) (10) • 2 which requires (2m-l)n operations. Then we decompose A as in (8) obtaining PA = LU (11) which requires n /3 - n/3 operations, compute the matrices Y and X which satisfy Vi = PB (12) UX = Y . (13) As we need only the trace of X, we can use formulae fori=n, n-1, . j+1 ij andk=l,2, i. These two steps require together (n /2 - n /2) + 3 • 2 ' + (n /6 + n /2 + n/3) bperations. So we can calculate f(z)/f(z) = .. with = (2m - (15) (16) operations. Although the asymptotic rate of convergence of the Newton's method to a simple root is 2 there seem to be little advantage in using Newton*s method against Muller's..There appear to be almost three times as many operations per iteration step in Newton's method than in Muller's. S^ -- t' (zr)/f(zr) S2 = (f (zr)2 - f(zr)f"(zr))/f(zr)2 The sign in the denominatpr is chosen so as to give the correction to zr the smaller absolute magnitude. The form of S^ which is suitable for numerical evaluation iB defined by (9) and (10) - (1Š), while the formula for S2 is derived from (9) by differentiation, see 1.2] , Sj = ^((A^U^A^z^,))7) - tMA-^z^A"!^)) (17) The algorithm for evaluation of S_ demands in addition to the starting operations for S^, i.e. (10) and (11), the following computations: We must first calculate the matrix C = A"(z) (18) 9 with additional (m-2)n operations. Then we calculate the trace of the matrix W = A C by steps . \ • LZ = PC : (19) UW = Z . tr W (2 0.) (21) 3 2 ' which require (n /2 - n /2) + 3 2 + (n /6 + n /2+n/3) + (n - 1) operations. The first term in (17) is found by calculating first the full matrix X by (12) and (13) with 3 •' 2 n operations and then the trace of X as tr«') = x, . (22) 2 which requires additional n operations. At each iteration step we must perform = (3m - 3)n 2n operations for the calculation of S- and S«. This number is almost twice as large as (16) for the Newton's method. Laguerre^s method The quite famous Laguerre's mcthod requires apart from the function value also tlie values of its first two derivatives. The aBymptotic rate of convergence to a simple root is 3. Perhaps the most attractive feature from the users point of view is its stability in global convergence for any value of thu firnt approximation. The iterative process is defined Iy [M| zr+l = zr " n/(Sl * ((n"1)tn for r=l,2, ..., where '2 Numerical tests - The programmes in FORTRAN programming language were written for all threa algorithms and tested on CDC CYBLR 72 computer. Single precision complex arithmetic wds used with t=M8, where t is the number of significant digits in the mantissa of a binary floating- point number. The iterative process was stopped after either the cotnputed correction of the computed approximation to the eigenvalue was less than or equal to e or ^^|uiiI — e> ^or 1 < i < n, occured in (8) or (11). The value for e was chosen as 10.1! A(z)|| „. 2~ . The implicit deflation of f(z) was applied in the programmes in order to prevent the iterative process to converge to one of the previously computed eigenvalues, say x., x_, ..., x . This introduces the following modifications of algorithms: A(z) = f(z) into f(z)/ n (z-x i f'(z)/f(z) into f (z)/f(z)- into into m .- l (z-x.) S,- 2 l (z-x.) i=l ^ i' m = 1 -1 -2 (23) .-1 and (24) (25) Some typioal examples of (1) were computed with multiple eigenvalues either of finite value or in the infinity. The values of the parameters m and n of A(z) were on intervals 1 < m < 2 and 3 < n < 12 respectively. No breakdown of the iterative process occured regardless the algorithm used. All three methods proved to be stable and accurate. It was found that the previous computed .eigenvalue and the values round it were the most suitable starting values for computing the next eigenvalue. In the table Muller No T Newton No T Laguerre No T 1 2 3 4 5 6 7 8 55 0 11 0 3 0 1G 1 .57 .13 .04 .17 . 02 41 3 some changes in the subroutines are necessary as explained at the end of the prograrames. -1.09579878411 -1.08865049880 ± 1.04888469390 i -0.541227886923 ±1.51715942168 i z6 - z14 a» K . 107, |K| »1 The last nine eigenvalues lie in the infinity. Muller's and Laguerre's methods were also tested on DEC 1091 computer with t=27. In one case w)ien some of the elements of A(z) differed up to 10 in their absolute values Muller's method failed to compute correctly some of the. eigenvalues while all the eigenvalues obtained by Laguerre's method were correct. References 1. BODEVJIG, E. Hatrix Calculus. North-Holland Publishing Company, Amsterdarn, 1959. .2. B0HTE, Z. On Algorithms for the Calculation of Derivatives of the Determinant. Proc. • ALGORITHMS 79 Symposium on Algorithms, Strbske Pleso, Czechoslovakia, 1979, pp. ;nr-iio. 3. PETERS, G., AND WILKINSON, J.H. Ax = >Bx and the Generalized Eifenproblem. SIAM J. Numer. Anal. 7, 4(1970), 479-492. 4. W:LKINSON, J.H. The Algobraic Ligunvalue Problem, Clarendon Pross, Oxford, 1965. 5. LAHCASTER, P. Lanibda-matriceu and Vibrating Systems. Pergamon Press, Oxford, London, Edinburgh, New York, Toronto, Paris, . Braunschweig, 1966. The subroutines LIGEHM and EIGFNL are completely selfcontained (EIGENM is composed of four subroutines EIGENM, F, ALAMDA, LU and EIGENL is composed of ten subroutines EIGEML, ALAMDA, LU, DERIVl, DERIV2, L0WER, UPPER, UPPER2, TRACE, TRX5Q) and communication to them is solely through their argument lists and . C0MM0N statements. The entrace to the subroutine EIGENM is achieved by C0MM0N /HATRIX/ AO(ND.ND), AHND.ND), A2(ND, 1ND) CALL EIGENM (M, N, ND, T, INDIC, LAM, PERMUT, 1A, L, U) The entrance to the subroutine EIGENL is achieved by C0MM0N /MATRIX/ AOCND, ND), AKND.ND), A2CND, 1ND), A3(ND,ND) CALL EIGINL (M, N, ND, T, INDIC, LAM, PERMUT, 1A, D, L, U) - The nieaning of the parameters is described in>. the following lines. The elementE of. matrices A ,A. ,A», ..., A in (2) are to be stored in tbe first N rowe and columns of the two diinensional arrays A0, Al, A2, A3,... . M, vihere M > 1, is the degree of ž-matrix A(z) in (2). N, wh«:re K ; 1, is the order of matrices Ao' V A2 AM- . • ND, where ND > N, defines the first dimension of the two dimensional arrays A0, Al, A2 ,.. .., A,D,L,U and the dimenaion of tlie one dimensional array PERMUT. Dimension of the one di.niensional arrays IMUIC and LAM must be equal to or greatar than ND*M. '1' is the number of biriary digits in the 48 mantissa of a single precision floating- point number. T is of integer type. The array INDIC indicates the sucoess of the subroutine as:follows value of INDIC(I) e.igenvalue (I) .0 not found after 100 iteration steps 1 found LAM is one dimensional complex array. The computed eigenvalues will be found in the first N*M places. The arrays PERMUT, A, D, L, U is the working storage. The main (calling) programme should contain the following declaration statements INTEGER, M,N,T,INDIC,PERMUT ' REAL A0,Al,A2,A3 C0MPLEX LAM,A,L,U C0MM0H /MATRIX/ AO(ND.ND), AKND.ND), 1A2(HD,ND),'A3(ND,ND). DIMENSI0N INDIC (ND*M),LAM(ND*M).PERMUT l(fft)),A(ND,ND+l),L)DEN0M1 1 = DEN0M2 KR = -2.O*FR*DR/DEN0M1 HR = HR*KR GR = ZR ZR = ZR+HR FRM2 = FRMl FRHl = FR CALL F(ZR,FR,EPS,I,IND,M,N,ND,T,LAM, 1 PLRMUT.A.L.U) C IF(IMD.EQ.1)G0 T0 7 IF(CABS(ZR-GR).LE.1O.*EPS)G0 T0 7 C C c PA = LU WHERE L IS UNIT L0WER TRIANGULAR MATRIX, . U IS UPPER TRIAMGULAR MATRIX AHD P IS THE C0RRESP0NDING PERMUTATI0N MATRIX 3, some of the statements must be replaced with other stat.enients as shown below for the case 1) Statements REAL AO,A1,A2,A3 C0MM0N /MATRIX/ A0(ND.ND),Al(ND.ND), 1A2(ND,HD),A3(ND,MD) in the main programme, EIGKNM, ALAMDA, LIGLNL, DERIVl and DERIV2 by REAL AO,A1,A2,A3,A4,A5 C0MM0H /MATRIX/ A0(ND,WD),A1(ND,ND), ; 1A2(ND,HD),A3(ND,ND),A4(ND.HD),A5(ND.ND) 2) Statement C0HPLi:X Z2.Z3 in ALAMDA.DERIVl and DERIV2 by C0MPLEX 7.2,2 3 ',?M ,Z5 3) Statemcnt C0NTINUL (i) in ALAMDA by ZM = Z**4 25 = 7,**b (ii) in DERIVl by •• ZH = H.*2**3 Z5 = 5.*Z**4 (iii) in DERIV2 by ZM = 4 . *3 . *Z**2' Z5 = 5. *i\. ftZ**3 ^) Statement G0 T0(1,2,3),K in ALAMDA by G0 T0(1,2.,3,M ,5) ,K 5) Statement G0 T0(2,3),K in DLKIVl by G0 T0C2,3,4,5),K 6) Statement G0 T0(3,3),K in DLRIV2 by G0 T0(3,4,5),K 7) Statement 33 C0IJTINUE in ALAMDA, DERIVl aiul DERIV2 by G0 T0 3 3 . i* AIJ = AIJ+A4(IjJ)*Z4 G0 T0 3 3 5 AIJ = AIJ+A5CI,J)ftZ5 33 C0NTINUE 5. Main - calling programme In the following liries an example of a possible calling programme for subroutines EIGENH and EIGENL is presented. It finds the eigenvalues of A(z) in (2) with ms3 and nsl2. The programme stops after reading value zero for n. INTEGER INDIC,PERMUT,M,N,T,I,J,K,MN,MP1 REAL AO,A1,A2,A3 C0MPLEX LAM,A,L,U C0MM0N /MATRIX/ A0(12,12),A1(12,12) , 1A2(12,12),A3(12,12) EQUIVALEMCE (A(l),L(1),U(1)) DIMENSI0N INDIC(36),LAM(36),PERMUT(12) , 1A(12,13),L(12,13),U(12,13) C0MPLEX D • DIMENSI0N D(12,12) C 1 READ 2,N,M,T 2 F0RHATOI5) 3 F0RMAT(8F1O.O) IF(N.EQ.O)G0 T0 12 C THE PR0GRAMME ST0PS AFTER READING ZER0 C F0R N. MIJ = M*N MPl = M+l D0 B 1=1,MPl G0 T0 (4,5,6,7),I H READ 3,((A0(K,J),J=l,tO,K=l,N) G0 T0 8 5 READ 3,((A1(K,J),J=1,N),K=1,M) G0 T0 8 6 REAO 3,((A2(K,J),J=1,N),K=1,N) G0 T0 8 7 RLAD 3 ,((A3(K,J),J = 1,H),K = 1,N) 8 C0MTIKU1: 54 PRINT 9,((A0(K,J),J=l,N),K=l,N) 9 F0RMAT (1H .6E16.7) PRINT 9,((A1(K,J),J = 1,N)-,K=1,N) IF(M.GT.1)PRINT 9,((A2 CALL EIGENM(M,N,12,T,INDIC,LAM,Pi:RMUT, 1A,L,U) PRINT 1 10 F0RMAT(1HO,1OX,6H INDIC,10X,9HREAL PART, 112X,10H IMAG,PART,///(1H ,12X,I2,5X, lEl-9.12,fX,E19.12)) D0 11 1=1,MN LAM(I) =0.0 11 C0NTINUE CALL EIGENL(M,N,12,T,INDIC,LAM,PERMUT, 1A,D,L,U) PRINT10,(INDIC(I),LAM(I),I=l,MN) G0 T0 1 12 C0NTINUE END CENIK OGLASOV Ovitek - notranja stran (za lethik 1982) 2 stran 28 .000 din 3 stran 21.000 din Vmesne strani (za letnik 1982) 1/1 stran 13.000 din 1/2 strani T 9.000 din Vmesne strani za posamezno številko 1/1 stran 5.000 din 1/2 strani 3.300 dln Oglasi o potrebah po kadrih (za posamezno številko) 2.000 din Razen oglasov v klasičnl obliM so zaželjene tudi krajše poslovne, strokovne in propagandne informacije in članki. Cene objave tovrstnega materiala se bodo določale spo- razumno. ADVERTIZING RATES Cover page (for all issues of 1982) 2nd page 1300 % 3rd page 1000 % Inside pages (for alt issues of 1982) 1/1 page 790 $ 1/2 page 520 $ Inside pages (Individual issues) 1/1 page 260 $ 1/2 page 200 % Rates for classified advertlzing: each ad • 66 $ In addition to advertisment, we welcome short business or product news, notes and artlcles. The related cliarges are negotiable.