AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 1 NO. () A Comparson of Two Equvalent Real Formulatons for Complex-Valued Lnear Systems Part : Results Abnta Munankarmy and Mchael A. Heroux Department of Computer Scence College of Sant Benedct South College Avenue St. Joseph, Mnnesota 6 USA Receved May 1, Accepted October, ABSTRACT Many teratve lnear solver packages focus on real-valued systems and do not deal well wth complex-valued systems, even though precondtoned teratve methods typcally apply to both real and complex-valued lnear systems. Instead, commonly avalable packages such as PETSc and Aztec tend to focus on the real-valued systems, whle complex-valued systems are seen as a late addton. At the same tme, by changng the complex problem nto an equvalent real formulaton (ERF), a real valued solver can be used. In ths paper we consder two ERF s that can be used to solve complex-valued lnear systems. We nvestgate the spectral propertes of each and show how each can be precondtoned to move egenvalues n a cloud around the pont (1,) n the complex plane. Fnally, we consder an nterleaved formulaton, combnng each of the prevously mentoned approaches, and show that the nterleaved form acheves a better outcome than ether separate ERF. [Ths artcle s the second part of a sequence of reports. See the December ssue for Part 1 Edtor.] I. OVERVIEW OF PROBLEMS AND SOLUTION METHODS We started our computaton wth small dmenson matrces and then proceeded to larger dmensoned matrces [1]. For the larger matrces, our computatonal problems come from three applcaton areas, namely, molecular dynamcs, flud dynamcs, and electromagnetc models. The frst two problems lsted n Table 1 have smple trdagonal matrces. The next three are dagonal matrces that we generated n a specal way: start a dagonal matrx wth all real values and then change one value at a tme to a complex value untl all dagonal values are complex. Patterns were then sought for the rate of convergence. Fgures 1 and show the dfferences n teraton count of the dfferent formulatons [1]. Fgures 1 and nvolve matrces wth consecutve dagonal values such as (1,,,,, 1). Here, the K1 formulaton started wth smaller teratons and then ncreased to larger teratons, whch means that when all the dagonal values were complex, the K1 soluton was not as attractve as when they were real. The K formulaton behaves the other way. It starts wth larger teratons and then decreases as more dagonal values become complex. Hence, t gave a better soluton for complex values. Fgure shows the graph of dfferent teraton counts of the dfferent formulatons where the dagonal values were non-consecutve. Smlar reactons occurred n ths case, however, the K1 formulaton gave a constant soluton that was stable. Fgure shows the stablty of matrx K 1. The sxth and seventh problems lsted n Table 1 come from data sets whose detaled applcatons we are unfamlar wth. The last three problems come from electromagnetc models. The man use of these problems to see how dagonal values affected the K1 formulaton. 1
AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 1 NO. () Problem Dmenson Number of Descrpton Non-zeros B 1 8 Smple trdagonal matrx B 1 6 Smple trdagonal matrx M1 1 1 1 by 1 dagonal matrx wth consecutve dagonal values from 1 to 1 M by dagonal matrx wth consecutve dagonal values from 1 to Md by dagonal matrx wth values (1,,,, 1, 1, 1, 11,,, 1) MD 1 18 Computatonal Chemstry Model I, Sherry L, LBL/NERSC MD 1 1 Computatonal Chemstry Model II, Sherry L, LBL/NERSC Vm1mg 1 8 Electromagnetc Models Vm1mg1 1 8 Electromagnetc Models Vm1mgd 1 8 Electromagnetc Models Table 1. Test Problem Descrptons. MATLAB results were obtaned usng Verson..1 []. In partcular, we used the bult-n functons lunc, whch we have descrbed n Secton VII of our prevous paper [1], gmres and gmres1. lunc computes an ncomplete LU factorzaton of a gven sparse matrx. It performs the ncomplete LU factorzaton of the gven matrx wth drop tolerance that s a non-negatve scalar. The drop tolerances we used were, 1. e -, and 1. e -. gmres or gmres1 solves a lnear system usng the generalzed mnmum resdual method (GMRES) wth precondtonng provded by the ILU precondtoner computed by lunc []. We also used a dagonal precondtoner for problems MD, MD, vm1mg and vm1mgd, where the ILU precondtoner dd not help determne whch formulaton would be best []. II. RESULTS For the frst set of results n Table a, that s, problems B and B, we found that smaller dmensoned matrces, when real values are larger than magnary values, then the matrces K 1, K, and K 1 all converged to a soluton wth the same teratons. We thus could not prefer one formulaton to another. Snce these were only 1 by 1 matrces, we dd not bother to see how the precondtoner would affect the results. The matrces of problems M1, M, and Md were all started wth all real dagonal values, wth a subsequent change to magnary one at a tme. Tests were performed for each matrx when all the dagonal values were complex. Fgures 1,, and show the changes n teraton wth dfferent dagonal values. For M1, wth all the dagonal values real, the K1 formulaton was better than the K formulaton; however, the K was better than the K1 when all the dagonal values were complex. Smlar outcomes were found n the cases of the other two problems, M and Md. In general, our results show that the K1 formulaton gves a better soluton than K1 or K when complex lnear problems are solved usng ERF s. In fact, n these cases the K1 and K formulatons gve the same results. Ths pont s amplfed when we notce that matrces K 1 and K are symmetrc. The result of usng matrx K 1 were consstent for any dagonal values. It dd not matter how many real or complex values were n the dagonal of the matrx. For problem MD, we computed the spectrum of the orgnal and the precondtoned matrces usng the MATLAB lunc functon. Fgure shows the dstrbuton of the egenvalues of the orgnal complex matrx and Fgure shows the
AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 1 NO. () Problem Tolerance C Iteratons K 1 Iteratons K Iteratons K 1 Iteratons B 1 e -6 1 B 1 e -6 1 M1 1 e -6 NA M 1 e -6 Md 1 e -6 1 6 1 1 vm1mg 1 e -6 68 NA vm1mg1 1 e -6 1 8 NA 8 vm1mg 1 e -6 Table 1. MATLAB test results usng GMRES ( ) wthout precondtonng. Problem Tolerance C Iteratons K 1 Iteratons K Iteratons K 1 Iteratons Md 1 e -1 1 NA 118 vm1mg 1 e -1 6 6 18 18 vm1mgd 1 e -1 6 18 Table. MATLAB test results usng GMRES ( ) wth Dagonal Precondtonng. Problem Tolerance C Iteratons K 1 Iteratons K Iteratons K 1 Iteratons Md 1 e - Table. MATLAB test results usng GMRES ( ) wth lunc (droptot) Precondtonng. egenvalues of the K matrx. As expected, the egenvalues of the K formulaton matrx are the egenvalues of the complex matrx plus ther reflecton about the real axs. For ths problem, the ILU precondtoner dd not help us dstngush between the formulatons, so the dagonal precondtoner was used. The number of teratons by formulaton s shown n Table. In general, the K1 formulaton gave the better answer. However, the comparson was not complete snce the K formulaton was not avalable. (The matrx K was sngular, wth dagonal elements of zero, and thus not approprate for use n precondtonng.) For problem Md n Table, we could not use the dagonal precondtoner because of the large matrx sze, and so the lunc precondtoner nstead. Table shows that all formulatons have the same result, somethng that we beleve cannot be true. We thnk that ths smlarty arses due to nsuffcent memory. The last three problems n Table 1 were nterestng to observe. For vm1mg, real values were larger than magnary; hence the matrx K 1 was dentcal to K 1. Obvously the results for these two methods should be the same, and that s what we found (Table 1). The matrx K could not be test because of ts zeros along the dagonal. The precondtoner dd not work n ths problem because of the non-structured array of a unt lower trangular matrx. We should note that the precondtoner fals f the dagonal has values of the unt lower or upper trangle have any zeros. For vm1mg1, a smlar result was observed. However, for vm1mg, the results were dfferent. Here the dagonal values of the complex matrx had ts magnary part larger than ts real part. Hence the matrx K 1 was smlar 1
AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 1 NO. () Fgure 1. Graph of Iteraton Count (vertcal axs) versus Number of Dagonal Terms wth Non- Zero magnary parts (horzontal axs) for each of the formulatons, usng a 1 1 dagonal matrx wth consecutve values for the dagonal elements, as descrbed n the text. Fgure. Graph of Iteraton Count (vertcal axs) versus Number of Dagonal Terms wth Non- Zero magnary parts (horzontal axs) for each of the formulatons, usng a dagonal matrx wth consecutve values for the dagonal elements, as descrbed n the text.
AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 1 NO. () Fgure. Graph of Iteraton Count (vertcal axs) versus Number of Dagonal Terms wth Non- Zero magnary parts (horzontal axs) for each of the formulatons, usng a dagonal matrx wth non-consecutve values for the dagonal elements, as descrbed n the text. to matrx K. We could use a precondtoner get better results. We used a dagonal precondtoner, and Tables 1 and show the results. Wth the precondtoner, K was found to be better than K1 (see Table ). K1 was smlar to K as the matrces produced from these formulatons were smlar. However, to see how much better the K1 formulaton would be, we made a small change n the orgnal problem vm1mg, namng ths new fle vm1mgd. We changed half the dagonal entres n the complex matrx C such that half of them now had real parts larger than ther magnary parts. The results of problem vm1mgd clearly show that formulaton K1 s better than formulaton K1 or formulaton K used alone (see Table ). C1 s the name we gave ths new C matrx generated n the adjustment to problem vm1mg (see below). It should be compared wth matrx C of secton III of Munankarmy and Heroux () [1]. = C 1 1 18 8 8 16 8 1 6 6 1 6 1 8 6 1 1 1
AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 1 NO. () Fgure. Egenvalues of the orgnal complex matrx n problem MD, wth magnary components graphed on the vertcal axs and real parts of the egenvalues graphed on the horzontal axs. Fgure. Egenvalues of the K formulaton matrx n problem MD, wth magnary components graphed on the vertcal axs and real parts of the egenvalues graphed on the horzontal axs.
AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 1 NO. () Fgure 6. Egenvalues of the new complex trdagonal matrx C1, wth magnary components graphed on the vertcal axs and real parts of the egenvalues graphed on the horzontal axs. Fgure. Egenvalues of the K1 formulaton matrx usng C1, wth magnary components graphed on the vertcal axs and real parts of the egenvalues graphed on the horzontal axs.
AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 1 NO. () Fgure 8. Egenvalues of the K formulaton matrx from C1, wth magnary components graphed on the vertcal axs and real parts of the egenvalues graphed on the horzontal axs. III. CONCLUSIONS REFERENCES In ths report and the prevous paper [1], we presented a comparson of two real equvalent formulatons for complex-valued lnear systems. In addton, we also presented what we termed the nterleaved formulaton, K1. Our results show that n cases where the magnary components of matrx elements are larger than ther respectve real parts, then the K formulaton provdes a more effcent method of soluton. Challengng problems requre a hgh-qualty precondtoner for rapd convergence. Such precondtoners move egenvalues n a cloud around pont (1,) n the complex plane. Ths shows that the requrement of a hgh-effcency precondtoner provdes the best soluton and dmnshes the convergence dfferences between a true complex teratve solver and the K1, K, and K1 formulatons. Fnally, our results ndcate that formulaton K1 s at least as effcent as ether the K1 or K formulatons. More research s needed before a stronger statement can be made. 1. Abnta Munankarmy and Mchael A. Heroux, A Comparson of Two Equvalent Real Formulatons for Complex-Valued Lnear Systems, Part I: Introducton and Method Am. J. Undergrad. Res., Vol. 1, No. (December ), pp. 1-6.. MathWorks. See the MATLAB homepage at http:// www.mathworks.com. Youcef Saad and Martn H. Schultz, GMRES: A generalzed mnmal resdual algorthm for solvng nonsymmetrc lnear systems, SIAM J. Sc. Statst. Comput., Vol., No. (july 186), pp. 86-86.. M. Baertschy, T. N. Rescgno, W. A. Issacs, X. L, and C. W. McCurdy, "Electron-mpact onzaton of atomc hydrogen", Physcal Revew A, Vol. 6, p. 1 (January 18, 1). 6