Gerot Hoffma Faddejev Algorithm for Eigevalues ad Eigevectors Cotets. Itroductio. Faddejev algorithm / Geeral. Example / Diagoal matrix with distict eigevalues 4. Example / Matrix with complex eigevalues 5. Example / Matrix with equal eigevalues 6 4. Rotatio matrices / Geeral 7 4. Rotatio matrices / Eigevalues ad eigevectors 8 5. Newto-Bairstow algorithm 9 6. Refereces 0
. Itroductio May tass i physics, mechaics ad computer graphics result i the so-called eigevalue problem for matrices. Give is a quadratic matrix with x elemets, which are here real umbers. The matrix is for the geeral case ot symmetric. () Ax x ( ) ( A I) x 0 ( ) det( A I) 0 ( 4) ( A I) 0 Equatio () is a homogeeous system of liear equatios for uows. No-trivial solutios ca be expected if the determiat () is zero. This delivers primarily a polyomial fuctio f(). The eigevalues are foud as the roots of f()0, which is called the characteristic equatio. Equatio () results for each eigevalue i equatio (4) for the eigevector x. A eigevector ca be multiplied by ay factor. A uit eigevector has the Euclidia orm oe. Complex eigevectors are here ormalized for oe real value oe. The author is programmig a library for liear algebra ad related topics i PostScript, for simplicity called the Matrix Library [6], [7]. PostScript is geerally based o sigle float precisio - a rather limitig fact. Programmig umerically algorithms is hampered by lacig structures as i Fortra, Pascal or C. PostScript is used because of excellet graphics ad typographical quality for vector graphics. It is ot expected that highly complex tass of liear algebra have to be hadled. O this occasio, the author remembered the otherwise hardly ow algorithm by Leverrier, improved by Faddejev []. This is here simply called Faddejev algorithm. Just a few matrix operatios deliver the determiat, the iverse matrix ad the coefficiets of the characteristic equatio. Oce the roots are foud - here by Newto-Bairstow [] - the eigevectors are calculated by usig itermediate matrices from the previous process. Solvig the eigevalue problem via the characteristic equatio is owadays ot cosidered as professioal. Oe of the better alteratives is the R-Algorithm []. Programmig this i PostScript for o-symmetric matrices with possible complex solutios is for the author practically impossible. O the other had, for small matrices, without ay symmetry, for real or complex distict eigevalues ad eigevectors, the Faddejev method is straightforward. Practical problems arise for simple cases, e.g. the calculatio of the eigevalues for a x idetity matrix. The three eigevalues are all. A vector base of three liearly idepedet eigevectors ca be costructed, but it caot be foud by umerical calculatios. Faddejev s boo cotais a major bug, cocerig the eigevector extractio. The problem could be solved - slow but safe, if the tas is ot affected by geeral problems lie multiple eigevalues, cocerig the liearly idepedet vector base. This documet shows a couple of examples.
. Faddejev algorithm / Geeral Some simple matrix operatios deliver the ecessary iformatios for the calculatio of the determiat, the iverse matrix ad the coefficiets of the characteristic equatio. Oce the roots are foud (eigevalues), it should be possible to extract the respective eigevectors from a matrix, which is easily calculated, based o previous itermediate results. Ufortuately, the situatio is ot as simple as explaied by Faddejev. Faddejev algorithm for a matrix A: I is a idetity matrix. tr meas trace : tr( A) i a ii A A p tr( A ) / A AB p tr( A )/ B A p I A......... B A p I AB p tr( A )/ B A p I Always valid: B 0 Determiat ad iverse matrix: det A ( ) p If p 0 : A B / p Characteristic equatio: f( ) (- ) [ p p... p p ] 0 The eigevalues are the roots of the characteristic equatio. They ca be multiple. For istace 5 ad triple :,,,, 4 5 The matrix cotais eigevectors for i colums: I+ B +... + B Faddejev assumes for differet eigevalues, that each colum of ca be used as the respective eigevector. This is ot always true. Horer recursio for the eigevector matrix ( i to -):,0 I i, i, + Bi,
. Faddejev algorithm / Diagoal matrix with distict eigevalues A diagoal matrix with diagoal values,, delivers the eigevalues,,. The roots of the characteristic equatio are foud i a upredictable order. The matrix cotais ideed for each eigevalue the respective eigevector: it is the oly oe o-zero colum. I a program oe caot chec for o-zero. Alteratively, the colum with the largest orm is selected. Faddejev says, that ay colum ca be used. This is correct, if the matrix does ot cosist of diagoal elemets or diagoally arraged blocs. Faddejev algorithm, arraged for maual calculatios ( ) : p tr( A )/ p tr( A )/ p tr( A )/ B A p I B A p I B A p A A A AB A AB I 0 0 0 0 0 p 6 p p 6 5 0 6 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 6 0 0 8 0 0 6 0 0 0 9 0 0 6 Determiat ad iverse matrix: det A ( ) p 6 6 0 0 A B / p ( 6 / ) 0 0 0 / 0 0 0 0 0 / Characteristic equatio: p f( ) (- ) [ p... p p ] [ 6 + 6] 0 Eigevalues, assumed to be foud by this arbitrary order: Eigevector matrix ad ormalized eigevectors: I+ B 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +... + B 0 0 5 0 6 0 0 4 0 0 0 + 0 0 0 0 0 0 0 0 0 5 + 6 0 0 4 + 0 0 0 + 4
. Faddejev algorithm / Matrix with complex eigevalues For complex eigevalues the eigevectors are complex as well. The orm for searchig the largest eigevector is based o the Euclidia orm of the absolute values of the complex umbers (squareroot of the sum of the squares of all real ad imagiary umbers). For istace i oe ca use the first or the secod colum. Normalizatio is based o value for the real part of oe compoet. Faddejev algorithm, arraged for maual calculatios ( ) : p tr( A )/ p tr( A )/ p tr( A )/ B A p I B A p I B A p A A A AB A AB I 0 0 0 p p 4 p 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Determiat ad iverse matrix: det A ( ) p / / A B / p ( / ) 0 / / 0 0 0 0 0 Characteristic equatio: f( ) (-) [ p p... p p ] [ + 4 ] 0 Eigevalues, assumed to be foud by this arbitrary order: + j j Eigevector matrix ad ormalized eigevectors: I+ B +... + B 0 0 0 0 0 0 0 0 0 0 0 0 0 + + 0 0 0 0 + 0 0 + 0 0 0 + 0 j 0 0 j 0 + 0 j j 0 0 0 0 0 j j 0 0 0 0 5
. Faddejev algorithm / Matrix with equal eigevalues The example below shows i fact two cases. For all values the eigevalues are the same, ad two of them are equal. For,, the eigevectors caot be foud safely. For 0 two liearly idepedet eigevectors exist, but they caot be calculated. For 0 both eigevectors are equal. They ca be calculated, but they do ot form a liearly idepedet vector base. Faddejev algorithm, arraged for maual calculatios ( ) : p tr( A )/ p tr( A )/ p tr( A )/ B A p I B A p I B A p A A A AB A AB I 0 0 0 0 p 4 p 5 p 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 Determiat ad iverse matrix: det A ( ) p A B / p ( / ) 0 0 0 0 0 0 0 0 / Characteristic equatio: f( ) (- ) [ p p... p p] [ 4 + 5 ] 0 Eigevalues, two are equal: Eigevector matrix ad ormalized eigevectors: I+ B +... + B 0 + ( ) 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 0 0 ( A I) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ( A I) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ( A I) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
4. Rotatio matrices / Geeral Geeral rotatio matrices are built by multiplyig sigle axis matrices. The resultig compoud matrices are uder all circumstaces orthoormal: the determiat is oe, colums are orthoormal, ad rows as well. The iverse matrix is easily foud by trasposig. A arbitrary D rotatio by three Euler agles ca be replaced by a sigle axis rotatio. The rotatio axis is calculated either by the eigevector for the eigevalue or the formula below. The axis is udefied for 0 ad 80. Sigle axis rotatio matrices: Coordiate trasformatios about x-axis, y-axis ad z-axis: x Xx x Yx x Z x X Y Z 0 0 cos( α) si( α) 0 i( α) cos( α) cos( β) 0 i( β) 0 0 si( β) 0 cos( β) cos( γ) si( γ) i( γ) cos( γ) 0 0 0 y 4 y z 4 z x 4 x Coordiate trasformatio, Aircraft Euler agles: x4 A4x Compoud rotatio matrix, usig ψyaw, θpitch ad φroll : A X () φ Y () θ Z ( ψ) 4 4 A 4 cos( θ)cos( ψ) cos( θ)si( ψ) i( θ) cos( φ)si( ψ) + si( φ)si( θ)cos( ψ) cos( φ)cos( ψ) + si( φ)si( θ)si( ψ) si( φ)cos( θ) si( φ)si( ψ) + cos( φ)si( θ)cos( ψ) si( φ)cos( ψ) + cos( φ)si( θ)si( ψ) cos( φ)cos( θ) The Euler theorem says: Each rotatio i D by a matrix R ca be replaced by a equivalet sigle axis rotatio with a agle η about a axis. The trasformatios were itroduced above as coordiate trasformatios. T 4 For a rotatio we have to use the iverse (trasposed) matrix R A. Agle ad axis: η arccos[ 05. ( r + r + r )] 05. r r r r si( η) r r A rotatio matrix has always oe eigevalue For si( η). is the ormalized eigevector for. 0 the axis is udefied. This happes for η 0 ( o rotatio) ad η 80. 7
4. Rotatio matrices / Eigevalues ad eigevectors A sigle rotatio about the z-axis shows already some fudametal features of rotatio matrices. For better uderstadability the stadard eigevalue equatios are show as well. Faddejev algorithm for a rotatio matrix: Rotatio about the z-axis, usig c cos( ψ) ad s si( ψ) p + c p ( + c) p ( + c) c s 0 0 s ( + c) 0 c 0 0 0 0 0 0 c 0 0 0 0 0 c ( + c) s 0 s c 0 ( + c) 0 0 0 0 0 0 0 c 0 0 Determiat ad iverse matrix: det A ( ) p c s A B / p c 0 A 0 0 Characteristic equatio: T f( ) (- ) [ p p... p p] [ ( + c) + ( + c) ] 0 Eigevalues, two are cojugate complex: c+ js c js Eigevector matrix ad ormalized eigevectors: I ( + c) + c s( ) + B+... + B (( ) ( + c) + c 0 0 0 c + 0 0 0 0 0 0 0 ( c) 0 0 c js( c) s( c) js j( c) ( c) js ( c) + js js( c) 0 ( c) + js j( c) 0 0 j 0 0 0 0 0 0 0 s 0 s + js( c) s( c) + js s+ j( c) ( c) + js ( c) js s + js( c) 0 ( c) js s+ j( c) 0 0 j 0 0 0 0 0 s 0 ( A I) c c s c 0 s c 0 0 0 0 0 0 0 0 0 c js ( A I) s c 0 s js 0 0 0 j 0 0 0 0 ( c) js 0 s 0 c js (A I) s c 0 s js 0 0 0 j 0 0 0 0 ( c) + js 0 s 0 8
5. Newto-Bairstow algorithm The Newto-Bairstow algorithm [] fids all roots of a polyomial with real coefficiets. Polyomial with degree with real coefficiets: fx ( ) a x +a x +... a x + a 0 Fid all roots x...x for fx ( ) 0 Fid a quadratic divisor: px ( ) x rx Solve quadratic equatio, usig the Hoffma algorithm [8]. Results are two, oe or o roots. This algorithm is protected agaist divisio overflow. Two roots are either real or cojugate complex. Fid the reduced polyomial with degree m : gx ( ) bm x +... + bx+ b0 Repeat steps util m. The iteratio is executed by a double Horer algorithm [7]. 9
5. Refereces [] D.K.Faddejev ud W.N.Faddejeva Numerische Methode der lieare Algebra R.Oldebourg Verlag Müche, Wie / 979 [] H.R.Schwarz Numerische Mathemati B.G.Teuber Stuttgart / 99 [] R.Zurmühl ud S.Fal Matrize ud ihre Aweduge, Teil Spriger- Verlag Berli... / 984 [4] J.Hosche ud D.Lasser Grudlage der geometrische Dateverarbeitug B.G.Teuber Stuttgart / 99 [5] G.Hoffma Euler Agles ad Projectios http://docs-hoffma.de/euler600.pdf [6] G.Hoffma PostScript Tutor http://docs-hoffma.de/pstutor00.pdf [7] G.Hoffma Matrix Library http://docs-hoffma.de/matrixlib.txt Reame as *.eps [8] G.Hoffma Solutios for a uadratic Equatio http://docs-hoffma.de/quadequ040600.pdf This doc http://docs-hoffma.de/faddejev0007.pdf Jauary 6, 0: www.fho-emde.de/~hoffma/ replaced by docs-hoffma.de/ Gerot Hoffma September 9 / 007 Jauary 6 / 0 Website Load Browser / Clic here 0