Professional Documents
Culture Documents
Eigenvalue
4.1 Introduction
Equations of the type
Ax j..1x (4 1)
often occur in practice, for example in the analysis of oscillatory systems.We have to
find a vector x which, when multiplied by A yields a scalar multiple of itself. This
multiple is called an'eigenvalue'or'characteristic value'of A and we shall seethere are
N of these for a matrix of order N. Physically they might represent frequenciesof
, oscillation. There are also N vectors X;, oDe associatedwith each of the eigenvalueslt.
'eigenvectors' or 'characteristic vectors'. Physically they might
These are called
represent the mode shapesof oscillation.
A specific example of eq. 4.1 might be
l'
[ ;
which can be rewritten
- ). -24
l{,.}:{l}
18
-2-l 0 (4.3)
18 -17-A
[ ;
equationsis only possibleif the
A non-trivialsolutionof this setof linearsimultaneous
determinantof the coefficients is zero
t6- I -24 18
3 -2-,1 0 -0 (4.4)
-9 18 -r7-),
Expandingthe determinantgives
7 3+ 3 A 2- 3 6 7 + 3 2 : o (4.s)
JI
E I G E N V A L U EE Q U A T I O N S 93
(1 -4 \( -l xt+8) :0 ( 4.6)
and so the eigenvaluesof our matrix arc 4, I and - 8.
Note that for arbitrary matrices A the characteristic polynomial is likely to yield
imaginary as well as real roots. We shall restrict our discussion to matrices with real
eigenvaluesand indeed physical constraints will often mean that matrices of interest are
'positive
symmetric and definite' (seeChapter 2) in which case all the eigenvaluesare
red and positive.
Having found an eigenvalue,its associatedeigenvector can, in principle, be found
by solving a set of linear simultaneous equations. For example, for the caseof .1: I in
eq.4.6
:,:
[: ::]{1,]{l} (4.7)
-'i,z :{;}
Carrying out the first stageof a Gaussianeliminationgives
[" -;:]{',}
As we knew already from the zero determinant the system of equations exhibits linear
dependenceand all we can say is that the ratio of x2 to x3 is 2: 1. Similarly we find the
ratio of x, to x, is 1: I and so any vector with the ratios x1:x2 ix3:)1)' 1 is an eigen-
vector associatedwith the eigenvalue ,1.: l.
^:[:i;] (4.e)
*,r,t - {
{.
^-rrr,--l t (4.10)
x(3)r
respectively.
'orthogonality' one to the other. That is, the dot
These vectors are said to exhibit
product x(r)rx(r)#0 but the dot products x(l)rx(2)and x(1)rx(3)are both zero. This
proporty will be found to be possessedby the eigenvectorsof all symmetric matrices.
We can also note that the three eigenvectorsin eq. 4.10have been scaledor'normalised'
such that J>y--rr?:1. This is convenientbecauseit means that the dot products
1i1" *tt)rrs(t) are equal to one. Other normalisations are possible, for example so as
to make lxil-o,: l.
!r iterative'methods which are perhaps the most obvious of all. Just as we did in Chapter
3 for iterative substitution in the solution of nonlinear equations, a guessis made for
Ii x on the left-hand side of eq.4.1, the product Ax is formed, and compared with the
right-hand side.The guessis then iteratively adjusted until agreementis reached.In the
following sections we shall deal with these classesof methods in reverse order,
beginningwith vector iteration.
I tu -24 r8l
-2
I i 1 8 - t 7oJl
L-e {i,}:,{i'} (4.2)
EIGENVALUE OUATIONS 95
[ 'u -24
-2
''l f 'l | 'oJ [ 'o')
| : ol{r}:( r):ro( o.r) (4.1I )
L - n 1 8- n ) [ ' . J[ - ' . J [ - o ' J
wherewe havenormalisedthe resultingvectorby dividingby the largestabsoluteterm
in it to givelx;l-",:1. The normalisedx is thenusedfor the next roundof iteration.
This round gives
-24 ,'l 'ol
[ 'u
3 -2 0
[ 0 . r [-orl
2.8
[-orzsI
0.4375 (4.r2)
| | i ):1 l:6.4 { )
[-e 18-n) [-orj I uo) [ 'o )
and the next gives
-24 "l .]
'u f-orzs [ ,, I
[ -,:_,;l f-ooszs
I
li""J (4.r3)
L; t?1"'J:l_i"l:-'l
and finally:
Simple uariables
N Number of equations
TOL Convergence tolerance
ITS Maximum number of iterations allowed
ITERS Current number of iterations
ICON Convergencecriterion in cHEcoN
BIG The eigenvalue
PARAMETER restriction
IN>N
PROGRAM P4]-
PARAMETER (IN=20)
f;
i
1000
2000
wRrTE (6,2OOO) rrERS
FoRMAT (Er.2.4)
FoRMAT (I5)
STOP
END
Input and output for the programare shown in Figs 4.1(a)and (b) respectively. The program
readsin the numberof equationsto be solvedfollowed by the coefficientmatrix and the initial
guessed eigenvector.The tolerancerequiredof the iteration processand themaximumnumberof
iterationscompletethe data set. After a matrix-vectormultiplication using library routine
MvMULT,the neweigenvector is normalisedso that its largestcomponentis 1.0.The cHEcoN
subroutinethen checksifconvergencehas becn achievedand updatesthe eigenvector.Ifmore
iterationsare rcquired,the programreturns to the MvMUlTlquq4e and the processis repeated.
After convergence, the eigenvector is normalisedso that J!;!= rr? : 1.Figure4.1(b)showsthat
convergen@ to the'largest'eigenvalue-8 is achievedin 19 iterations.SubroutinesPRINTA
and pRlNtv outputarraysand vectorsrespectively to the requiredchannel(in thiscaseIctt:6).
-
E I GE N V A L U EE O U A T I O N S q7
Array size N
3
Array ( A 0 ,J ) ,J : I , N ) , I : 1 ,N
16.0 -24.0 18.0
3.0 -2.0 0.0
- 9.0 I 8.0 - 17.0
Initial vector x0(I), I: I, N
1.0 1.0 1.0
Tolerance TOL
l.E-5
Iteration limit ITS
100
}4ATRIX A
.1600E+02 -.2400E+02 .18008+02
. 3OOOE+o1 -.2OOOE+o1 .0000E+oo
-.9000E+o1 .1800E+o2 . 17OOE+O2
I,ARGEST EIGETWALUE
-. 8000E+o1
CORRESPONDING EIGEIWECTOR
-.43648+00 .2182E+00 87298+OO
ITERATIONS TO COWERGENCE
19
4.4.1 Shiftediteration
The rate of convergenceof the power method dependsupon the nature of the
eigenvalues. For closelyspacedeigenvalues,convergence can be slow. For example,
4.9
takingtheA matrixof eq. and using Program 4.1with xsr: { I I 1),convergenceto
A:4.7071is only achievedafter26 iterationsfor a toleranceof 1 x 10-5. The deviceof
'shifting'is basedon the solution of the modifiedproblem
PROGRAM
P42
c
C SHIFTED ITERATION USING THE POWERMETHOD
c
C ALTER NEXT LINE TO CHANGEPROBLEMSIZE
c
PARAMETER(IN=20)
c
R E A LA ( r N , r N ) , x o ( r N ) , x l ( r N )
c
R E A D( 5 , * ) N , ( ( A ( I , J ) , J : 1 , N ) , I : 1 , N ) , S H I F T
v i R I T E ( 6 ,* ) ( | * * * * * * * * * * * * * * * S H T F T E DI T E R A T T O N* * * * * * * * * * * * * * * |)
W R I T E ( 6 *, )
W R I T E ( 6 , * ) ( , } , [ . A T R I XA ' )
C A L L P R I N T A( A , I N , N , N , 6 )
WRITE(6,*)
wRrTx(6,*) (,sHIFrr)
wRrrE(6,10oo) sHrFT
IfRITE(6, *)
D O 1 0 I : 1 , N
10 A(I,I) = A(r,I) - SHIFT
READ(5.*) (x0(I),I:1,N)
READ (5,*) TOL,ITS
ITERS = O
1 C A L L M V M L I L T ( A ,r N , X O , N , N , X 1 )
BIG = O.0
DO 2 f : 1,N
2 IF (ABs(x1(I) ).GT.ABs(BIG) ) BIG : xr.(I)
DO 3 I : 1.N
3 x1(I) = xI(I)/BIG
C A L L C H E C O N( X 1 , X 0 , N , T O L , r C O N )
ITERS:ITERS+1
rF (rcoN.EQ.o .AND. ITERS.LT.ITS) GO TO 1
StM = 0.0
DO 4 I = 1,N
lr 4 SUM = SIIM + X1 (I)**2
S L J M= S Q R T ( S W )
DO 5 I : I,N
5 x1(I) = X1(I)/stty
WRITE(6, *) ('ErGElntALUEf )
wRrTE (6,1000) BrG + SHrFT
W R I T E( 6 , * )
wRrTE(6,*) ( ' C O R R E S P O N D T N GE I G E N V E C T O R ')
CALL PRTNTV(Xr,,N,6)
I{RITE(6,*)
wRrTE(6,*) ( T T T E R A T I O N S T O C O i T E R G E N C E r)
WRITE (6,20O0) rTERS
L000 FoRMAT (812.4)
2000 FoRMAT (15)
STOP
END
A useful feature of shifted iteration is that it enables the reAdy calculation of the smallest
eigenvaluefor systemswhoseeigenvalues areall positive.The powermethodcan first be usedto
computethe largesteigenvalue, and this can then be usedas the shift,implying that convergence
will be to the unshiftedeisenvalueclosestto z€ro
-
E I G E N V A L UE
EO U A T I O N S 99
Array size N
Array (A 0, J),J: I, N ) ,r : 1 , N
4.0 0.5 0.0
0.5 4.0 0.5
0.0 0.5 4.0
Shifr SHIFT
3.5
Initial vector xql),I:l,N
1.0 1.0 1.0
Tolerance TOL
l.E-5
Iterationlimit ITS
a
100
Fig. a.2(a) Input data for Program4.2
*********l***rr S H I I T I ' E DI T E R A T I O N * * * * * * * * * * * * * * *
},TATRIX A
.4OOOE+o1 .5OOOE+OO . OOOOE+OO
. 5000E+oo .4000E+o1 .50008+oo
. ooooE+oo .5000E+oo .4000E+o1
SHIFT
.35008+O1
EIGEWALUE
.47078+O1
CORRESPONDING EIGEA/ECTOR
.soooE+oo .?071E+00 .5000E+oo
ITERATTONS TO CO}WERGENCE
I
(A-PI)-tx:=j-x (4.16)
/.- p
-
wherep is a scalarshiftand l" is an eigenvalueof A. The eigenvectors of (A - pI) t are
the sameof thoseof A, but it can be shown that the eigenvalues of (A-pI)-t are
- -I of A that is
I lQ - il. Hence,the largesteigenvalue of (A pI) leadsto theeigenvalue
closestto p. Thus, if the largest eigenvalue of (A-pI)-t it lr, then the required
eigenvalue of A is givenby 1:(llfi+p. For small matrices it would be possible just to
invert(A-pI) and to usethe inverseto solveeq.4.16iterativelyin exactly the same
algorithmas wasusedin Program4.1.Howeverwe saw'in Chapter2, that in general
1OO C H A P T E R4
( A - p l ) x o: ; i t , (4.r7)
in the inverseiteration we have to compute
(A-pI)-t*o:*r.
(A - pI)(seeChapter2)usingtheappropriatelibrarysubroutine
By factorising (lurec)
we can write
(A-pI):LU (4.18)
and so
(LLf-rxo:yt (4.le)
or
U_rL_t*o:*, (4.20)
If now we let
Lyo: xo or y o: L - 1 x o (4.21)
and
t
t
!
pro@sseswe saw in Chapter 2, for which subroutines suBFoR and susgnc were
developed.
By altering p in a systematicway, all the eigenvaluesof A can be found by this
method.
['
t ,
t l
Example 4.1
l-i )1
A:1.,I
LJ +)
that is closest to 2.
Solution4.1
B:(A-pI)-t w h e r ep : 2 i n t h i s c a s e .
E I G E N V A L UE O U A T I O N S 101
.':{1,},.,:{:},,r:05
,.t:{-:;,}',.':{-;,}' trz:,5
.
.-t:{-l ll,},*.:{-: ""}' t+:aB.,S
.,:{_l li||},..: i *}, 7,:0e286
{-
I J ur,.,
*u,,,
lteratlons
f-l)
t 'J I
Program43. Shiftedinverseiteration
The programusesexactlythesamenomenclature
asin Program4.2with theadditionalvariable
lengtharrays:
uPrRr Upper triangularfactor of (A -pI)
LowTRI Lower triangularfactor of (A -pt)
PROGRAM P43
C
P R O G R A M4 . 3 SHIFTED INVERSE ITERATTON FOR EIGENVALUE
c CIOSEST TO A GIVEN VALUE
wRrTE(5,*) ('sHrFTr)
wRrTE(6,100o) SHIFT
wRrTE(6,*)
Do 10 I:1,N
-sHrFT
10 A(r, r) =A(r, r)
car,i r.urac (A, uPTRr, Low:tRr, rN' N)
R E A D( 5 , * ) ( X o ( I ) , I = 1 , N )
nnao 1s,*) TOL'ITS
ITERS = 0
CALLVECCOP(XO,Xl,N)
1 CALL SUBFOR(LOWTRT' rN' xl, N)
C A L L S U B B A (CU P T R I ,I N , X 1 , N )
BIG = 0.o
Do 2 I = 1,N :
z in lans(xl(r) ).cr.ABs(Brc) ) Brc X1(r)
DO 3 I = l,N
3 Xl(I) = x1(I)/BIG
CALL CHECON (Xl, X0, N,TOL, rcoN)
ITERS:ITERS+l'
Go ro 1
rr 1rcoH.no.0 -AND. TTERS.LT'ITS)
SIJM : o. o
Do 4 I : 1,N
4 S U M = S U I M+ X l ( I ) * * 2
sttM = sQRT(sw)
DO 5 I = 1,N
s xL(I) = x1(I)/suM
WRITE(6,*) ( ! E I G E N V A L U E CI,OSEST TO SHIFTI )
W R I T E ( 6 , 1 0 0 0 ) 1 - I B I G + SHIFT
W R I T E( 6 , * )
T C o R R E S P O N D I N GEIGENVECTOR I )
WRITE(6, *) (
CALL PRINTV(X1,N,6)
WRITE ( 6, 't ) '
wnrtr ie , "i ( I rrERATroNsro cowERGENcE)
w R r r E ( 5 , 2 O O O )r r E R S
looo FORMAT(El2.4)
2OoO FoRMAT (I5)
STOP
END
Array size N
J
Shift SHIFT
0.0
Initial vector xql),I:1,N
1.0 1.0 1.0
Tolerance TOI-
1.E-5
Iteration limit TTS
100
********** S H T F T E DI T W E R S EI T E R A T I O N * * * * * * * * * * * *
MATRIX A
.4000E+01 .50008+00 . o000E+00
.50008+00 .4000E+o1 .5000E+00
.000oE+oo .5000E+o0 . 4 0 0 0 E + 01
SHIFT
.0000E+00
ITERATIONS TO CONVERGENCE
J b
l2
Lr llfi;l:,{.;} (4.23)
(.i-3)(.r-r):0 9.24)
and so the eigenvaluesare +3 and+1. The eigenvalue*3 is associatedwith the
normalised eigenvector{UJ} UJ2\'and the eigenvalue * I is associatedwith the
eigenvector {UJ2 -llJ2}'. Since the matrix in eq. 4.23 is symmetric, these
104 C H A P T E R4
xrTxr:1
and (4.2s)
xrtx2-0
A * x , : A x r - , 1 , ,x , x r T x , (4.77)
A*xr:Ax, -/,rxrxrrxt
(4.28a)
:,l,rxr-l,1xr:g
A*xr:1-1- (4.28b)
Thus the first eigenvalueof A* is zero, and all other eigenvaluesof A* are the sameas
those of A.
Having'deflated'A to A*, the largesteigenvalueof A* can be found, for exampleby
simple iteration,and thus will equal the secondlargesteigenvalueof A. Following this
fz
n:L t ll
(4.2e)
* 2l
( r )
rnus
ri
h
tI
.lnl
X r X r: 1
t+t
lJ2 )
/
{hr,l"i] (4.30)
and therefore
n.:L;l-l;
f't r-l f7 fa
il
+) (4.3r)
:[ + -il
L-+ +l
E I G E N V A L U EE O U A T I O N S 105
- 1--l:
4J2
t E : --l:
a
4J2
Ax: Y (4.37)
PROGRAM P44
c
PROGRAM 4.4 POWER I1ETHOD FOR A*X:LAMBDA*B*X
c
c ALTER NEXT LINE TO CHANGE PROBLE}T SIZE
c
PA-RAI.{ETER (IN=20)
R E A L A ( I N , I N ) , U P T R I ( I N , I N ) , I . O W T R (I I N , I N ) , X O ( I N ) , X l ( I N ) , B ( I N , I N )
ITERS = 0
CALL VECCOP(X0,Xt,N)
CALL MWULT (B, IN, XO,N, N, X1)
C A L L S U B F O R( L O W T R I , I N , X 1 , N )
C A L L S U B B A C ( U P T R I ,I N , X 1 , N )
BIG = 0.0
DO 2 I = l,N
_
DO
I I ' I A B S=( x 1 ( I ) ) . G r . A B s( B r c ) ) B r c : x 1 ( r )
3 I l,N
xl(I) = x1(I) /BIG
C A L L C H E C O N( X 1 , X O , N , T O L , I C O N )
ITERS=ITERS+1
rF (ICoN.EQ.O .AND. TTERS.LT.ITS) co To 1
SUM= 0.0
DO 4 I = l,N
suM=suM+x1(I)**2
SIJH - sQRT(suM)
Do 5 r = 1,N
x1 (r) = x1 (I) /suH
VfRITE(6,*) ( ISMALLEST ETGEWALUE (I,AMBDA),)
WRITE (5,1OO0) 1.O/BIG
WRITE(6, *)
!{RITE(6,*) ('CoRRESPONDING EIGEWECTOR'
)
CALL PRINTV(Xl,N,6)
WRITE(6, *)
wRrTE(6,*) ('TTERATIONS TO COIWERGENCE')
WRITE (6,2OOO) ITERS
1000 FORMAT (E12.4)
2 0 0 0 FORMAT (rs)
STOP
END
Array size N
Iterationlimit ITS
100
MATRIX A
.8000E+o1 .4000E+01 -. 2400E+02 . 0000E+oo
.4000E+o1 .1600E+02 .00008+00 .4000E+01
- -24008+02 . O0008+OO .19208+03 .24008+02
. ooooE+o0 .4000E+01 -2400E.+02 .800oE+O1
MATRIX B
.66578-01 -- 1667E-01 -. 1000E+00 .0000E+00
-.1667E-01 . 13338+00 ,00008+00 -.1567E-01
-.1000E+oo .0000E+00 .4800E+01 .1000E+00
. ooooE+oo -. 1667E-01 . 1000E+oo .6667E-01
CORRESPONDTNG ETGENVECTOR
.68988+00 . OOO0E+00 .2200E+OO -,6898E+OO
ITERATTONS TO CONVERGENCE
6 t
Ax:lx (4.1)
If the generalised
form ol eq.4.34is encountered,
it is alwayspossibleto convertit into
the standardform. For example,given
Ax:lBx (4.34)
one could think of invertingB (or A) by someprocedureto yield the forms
B- rAx:lx
or (4.38)
I
A- tBx:=x
A
We now have
Cx: l.Lrx (4.43)
By setting
Lrx: y (4.44)
or x: L-ty (4.4s)
eq.4.43becomes
CL-TY: f,Y (4.46)
If we set
CL_T:D (4.4't)
or L- rcr- Dr
using the columnsof Cr
this can be solvedlor Dr by repeatedforward-substitutions
in the form
LDr:Cr (4.48)
Dry:Dy:/y (4.4e)
'standard[orm'
Program45. Conversionof Ax:lBx to
A programdescribingthis processis now presentedusingasdata the sameproblem specification
as was usedin the previous program.The nomenclatureusedis as follows:
Simpleuariables
N Number of equations
Variabielengtharrays
AbB Arrays A and B in Ax: lBx
D Diagonal matrix (vector)in LDLr factorisation
C, E Temporary storage
DD The array D: Dr in eq.4.49
PARAMETERrestTiction
IN>N
110 CHAPTER
4
PROGRAM P45
P R O G R A M4 . 5 COIWERTfoN OF A*X:L,\MBDA*B*X
TO STANDARD FORM
R E A L A ( I N , I N ) , D ( T N ) , B ( T N , I N ) , C ( I N , I N ) , E ( I N ) , D D( I N , T N )
Array size N
J
Array A ( A ( I , J )J, : 1 , N ) ,r : 1 , N
8.0 4.0 -24.O 0.0
4.0 16.0 0.0 4.0
-24.0 0.0 192.0 24.0
0.0 4.0 24.0 8.0
Array B ( B ( r , JJ) ,: t , N I r : 1 , N
0.06667 -0.01667 -0.1 0.0
- 0.01667 0.13333 0.0 _ 0.0166?
-0.1 0.0 4.8 0.1
0.0 -0.01667 0.1 0.06667
Fig. 4.5(a) Input data for Program 4.5
Ax:2x (4.1)
112 C H A P T E R4
I
For the eigenvaluesof A* to be the same as those of A, we have to arrange that the
! transformation matrix has the additional prop€rty
F
l
PTP: I
[-cosa -sinal
l, P:1. (4.56)
I
Lsln q cos ctl
ri
I
Applying this transformation to the A matrix of eq.4.23,we have
in which A* is clearly symmetrical for any value of a. In this casethe obvious value of
a to choose to give an A+ with known eigenvaluesis such as to make A* a diagonal
matrix. Elimination of the off-diagonal terms occurs if
c o s 2 a- s i n 2 q : 0 (4.58)
i n w h i c h c a s et a n a : 1 a n d a : n l 4 , g i v i n g s i n d : c o s , : l l ' / l . T h e resultingdiagonal-
EIGENVALUE
EOUATIONS 113
n.:[;I (4.se)
cosd -sina 0
il
sina cosd 0
(4.60)
0 0 1
0 0 0
l t*l cos a
(4.61)
0
sin a
and so on.
Matrix 4.60wouldannihilatethe terms(1,2)and (2, l) in the originalA matrix after
the transformationvia PrAP whilematrix 4.61would annihilatetermsG 4) and,(4,2).
The effectof the ls and 0sis to leavethe otherrowsand columnsof A unchanged. This
still meansthat oFdiagonal terms which becomezero during one transformation
revertto nonzerovalueson subsequent transformations and so the methodis iterative
as we havecometo expect.
The earliestform of this type of iteration is called 'Jacobi diagonalisation',and it
proceedsby annihilating the largestoff-diagonal term in each rotation.
Generalisingeqs4.57for any symmetricmatrix A we have
^.:[_:'i: -::f
xl [;;"f[:T; (4.62)
Example 4.2
21
A:[4
L2 3J
Solution4-2
AsAisonly2x2,oneiterationshouldbesufficient.WewishtoA
e ltizm: A
i nzar t-e2
^ 2(2)
1u112a:----:--L:4
a:37.98"
Transformation matrix
- -
p : [T' a sinal _ [o.zs820.6ts4l
Lsrnd cosql L0.6154 0.7882-l
A*:PTAT
p,A:[ 0.78820.6154-l
[4
'-l:[ 4.38363.4226f
L-0.61540.7882J
L2 3J L-0.8852l.l338l
-0.6154-l_[5.561 0l
4.38363.42261[0.7882
A.:[
L-0.8852t.t338J10.6154 0.7882JL 0 1.4381
Hencethe eigenvalues are 5.561and 1.438approximately.(The exactsolution to 3
decimalplacesis 5.562and 1.438.)
Simpleoariables
N Number of equationsto be solved
ITS Maximum numberof iterationsallowed
TOL Iteration tolerance
ITERS Current numberof iterations
ALPHA Rotation anglefor transformations
EIGENVALUEEOUATIONS 115
PARAMETER
restriction
IN>N
PROGRAM P46
c
PROGRAM 4.6 JACOBI TRANSFORHATION FOR EIGENVALUES
c OF SYMIIIETRIC HATRICES
PARAHETER (IN=10)
c
REAL A(IN, TN),A1 (IN, IN),P(IN, IN),PT(IN, IN),ENEW(IN), EOLD(TN)
c
PI = 4.*ATAN(l.)
R E A D ( 5 ,* ) N , ( ( A ( I , J ) , J = r , N ) , f = 1 , N )
DO 2 I = 1,N
'
Do 2 J = I,N
2 A(J, r) = A(I,J)
READ (5,*) TOL,ITS
wRrTE(6,*) ('***********r JACOBI ITERATION*******************r)
WRITE(6, *) (r******** F O R S y H M E a R T CI n T R I C E S * * * * * * r * * * * * * * * ' )
I{RITE(6,*)
IJRITE(6, *) ('HATRIX A')
CALL PRINTA (A, IN, N,N, 6)
!{RITE(5,*)
CALL NTJLVEC(EOLD,N)
ITERS = o
99 fTERS - ITERS + 1
BfG : O.
Do 3 I = lril
DO 3 J = f + 1,N
r F ( A B s ( A ( r , J )) . c r . B r c ) T H E N
BIG = ABS(A(I,J) )
HOLD = A(I,J)
IROW = I
rcol, = J
END IF
3 CONTINUE
DEN : A(IRow,IRow) - A(IcoL,IcoL)
IF (DEN.EQ.O.) THEN
ALPHA = PI*.25
IF (HoLD.LT.o.) ALPHA = -ALPHA
ELSE
ALPHA = . S*ATAN(2. *HoLD/DEN)
END IF
CT = coS(ALPHA)
sT = sIN(ALPHA)
CALL NULL(P,IN,N,N)
Do 4 I : 1,N
4 P(I,I) = r.
P(TROW,IROW) = q1
P(ICoL,IcoL) = g1
P(IROW, rCOL) = -5'1'
P(rcol.,IRol.l) = 51
ALPHA = ALPHA*L80./PI
116 C H A P T E R4
C A L L M A T R A N( P T , I N , P , I N , N , N )
C A L L M A T H U L ( P T ,I N , A , I N , A 1 , I N , N , N , N )
C A L L M A T H U L ( A 1 ,I N , P , I N , A , I N . N , N , N )
DO 5 I = 1rN
6 ENEW(I) = A(I,I)
C A L L C H E C O N( E N E W , E O L D , N , T O L , I C O N )
rF (TTERS.LT.TTS .AND. TCON.EQ.O) GO rO 99
WRITE(6.*) ( ' F I N A L T R A N S F O R M A T I O NM A T R I X P ' )
CALL PRINTA(P, IN,N,N, 6)
wRIrE(6, *)
WRITE(6,*) ( ' F I N A L T R A N S F O R M E DM A T R I X A ' )
CALL PRINTA (A, IN,N,N, 6)
ITRITE(6, *)
wRrTE(6,*) (,TTERATTONS TO CONVERGENCE' )
wRrTE(6,1000) rTERS
1000 FoRMAT (15)
STOP
END
Array size N
J
Array (AU,J),J=I,N),I:1,N
(accountingfor symmetry) 10.0 5.0 6.0
20.0 4.0
30.0
Tolerance TOL
t.E-1
I.IATRIX A
.1000E+02 .5000E+01 .5000E+01
.5000E+01 .20008+02 .400oE+o1
.6000E+01 .4000E+01 . 3 0008+02
TTERATTONS TO CONVERGENCE
( l \
l - f
lJ2l
W:(
(4.68)
) r f
lo)
which has the required product. Then
[1 1l
zww':l. |
LI lJ @.69)
o -tl
P:I-2ww':I g'70)
L- I oJ
which has the desired property
P-t:Pr:P
$.71)
l',
I
so that eq. 4.55 is automatically satisfied.
In order to eliminate terms in the first row of A outside the tridiagonal, the vector
w is taken as
t
[ r o o l
t
P':lo t-2w2, -2w2w3
| f+lll
-2w2w3 | -2w32)
L0
When the product Pr APr is carried ou! the first row of the resultingmatrix contains
the three terms
a'Lt:all
ktting
h : a 1 2 w 2 - fa s w 3
E I G E N V A L U E E O U A T I O N S1 1 9
a 1 3- 2 w 3 h : 0 . (4.7s)
Equation 4.67 gives another equation in the w;, namely
w 2 2* w 3 2 : l (4.76)
allowing the w, to be determined. The formulae derived from eq. 4.74 are
r2:etz2*arr' (4.77)
and
2 h 2: r z - e t z . r (4.78)
Instead of computing using w it is convenient to use
I
P:I--; wr (4.80)
lh-
Ineq.4.77 for the determination of r, the sign should be chosensuch that r is of opposite
sign to a12 in this case.
For a general row i, the vector v takes the form
" : { 0 , 0 , 0 , . . . 0 ,e i , i +| - r , e i , i + 2 , . . . a r , ^ \ t (4.8l)
Simple uariables
N Number of equations to be reduced
R See eq. 4.74 or 4.77
rr I
H -2zGeeeq.4.80)
PARAMETER
restriction
IN >N
The input is shownin Fig. 4.7(a).The numberof equationsand upper triangleof symmetric
matrix A arefirst readin. Then N - 2 transformations
aremadefor rowsdesignatedby counter
,I2O
C H A P T E R4
PROGRAM P47
c P R O G R A M4 . 7 H O U S E H O L D E RR E D U C T I O N O F A S Y W E T R I C
MATRTX TO TRIDIAGONAL FORM
K. Values of r, I and v are computed and the vector product required by eq. 4.80 is carried out
using library routine vvMULT. Transformation matrix P can then be formed and two matrix
multiplications using MATMUL complete the transformation. Figure 4.7(b)shows the resulting
tridiagonalised A, whose eigenvalucs would then have to be computed by some other method,
perhaps by vector iteration as previously described or by a characteristic polynomial method as
Array size N
4
Arrai' (Air,J),J:I, N} I:1, N
(accountingfor symmetry) 1.0 -3.0 -L0 1.0
r0.0 - 3.0 6.0
3.0 -2.0
1.0
MATRIX A
.10008+01 -.3000E+01 -.20008+01 .10008+01
-.30008+01 .10008+02 -.3000E+01 .6000E+01
-.2000E+o1 -.30008+o1 .30008+o1 -.20008+o1
.1000E+01 .6000E+01 -.2000E+01 . 10008+01
TRANSFORHED HATRTX A
.10008+01 .37d28+Ol- .8449E_07 _.30178_07
. 37428+Ol .2785E+01 -. 52468+01 . OOOOE+OO
.8449E-07 -.52468+01 .1020E+02 _.44808+01
-.3017E-07 .23848-06 -.4480E+01 .1015E+01
Ak+r_L-rArL (4.85)
showing that L has the property required of a transformationmatrix P. As iterations
proceed,the transformedmatrix At tendsto an upper triangular matrix whoseeigen-
valuesare equal to the diagonalterms.
Example 4.j
'LR'
Perform translormation on the non-svmmetric matrix
l::l
122 C H A P T E R4
Solution4.3
Ao: [4
'l : o-l 3 -l
[t [o
L2 U 10.5 tJ L0 -0.5J
"A ,-Lo 'l[r
: [ 4 -o.sj 0l_[ 5.5 3l
Lo.srl: [-o.zs -05-j
:t I 0l[55 3 I
L-0.045 1l Lo -0.36361
^n,:-Lo 3 l- t ol [s.36s 3 -l
[:t I
-0.3636_J -0.3636J
L-o.o+srl: Lo.oroq
[t ol t-5.365 3 I
:
Lo.oo'rl Lo.oro+ -0.3728)
-l
_ [s.res ,
o.3 [r
ol : s.37433 I
I _o.oorz
-0.3728J
10.0164 10.0031 ll_0.3728)
[
.{3 is nearlyuppertriangular,henceits eigenvalues areapproximately5.37and -0.37
which are exact to 2 decimal places.
Although the method would be implementedin practiceusing specialstorage
strategies,it is illustratedin Program 4.8 for the simplecaseof a squarematrix A.
Simpleuariables
N Number of equationsto be solved
ITS Maximum numberof iterationsallowed
TOL Iteration tolerance
ITERS Current numberof iterations
Variablelengtharrays
A Matrix Ar
L l,ower triangular factor of A
U Upper triangular factor of A
EOLD Prcvious estimateof eigenvalues
ENEW New cstimateof eisenvalues
PARAMETER
restriction
IN>N
PROGRAM P48
c
c PROGRAM 4.8 L-R TRANSFORMATTON FOR EIGE}WALUES
PARAMETER (IN=2o)
R E A L A ( I N , I N ) , U ( T N , I N ) , L ( T N , I N ) , E O L D( I N ) , E N E W ( I N )
Array size N
5
MATRIX A
.20008+01 -.1000E+01 . ooooE+oo
-.10008+01 .20008+01 -.10008+01
. o0008+00 -.10008+01 .1000E+ol
ITERATIONS TO CONVERGENCE
22
',-l
[0, Pz o,l [0, er (4.86)
r ' n : l c , Q zn ' l l o ' e z " I
Lr, 12 ,'.J Lp, Qt ,.1
F t
pt q pt -'l l
lp'p
: l n ' o q ' qo " l : I '
L.tp rtq .tt I
[o f, o,l
and so
AP:PM (4.88)
"J'
EIGENVALUEEOUATIONS 125
To construct the 'Lanczos vectors' p, q and r we note from the first of eqs 4.90 that
zi :vi-dtyi (4.e2)
p :12,'z)'t'
I
!i+r: qzi
Stmple uariables
N Number of equations to be reduced
PARAMETER
restric|ion
IN >N
PROGRAM P49
c
c PROGRAM 4.9 I.ANCZOS REDUCTION OF A SYMMETRIC
c MATRIX TO TRIDTAGONAL FORM
c
c ALTER NEXT LTNE TO CTIANGE PROBLEI.T STZE
PARAMETER (fN:2o)
c
R E A L A ( I N , I N ) , A L P H A( I N ) , B E T A( o : r N - ] . ) , v ( r N ) , yo (rN), y1 (rN), z (rN)
Array size N
4
Array (Atr,J),r: l, N),J:r, N
(accountingfor symmetry) 1.0 -3.0 -2.o 1.0
10.0 - 3.0 6.0
3.0 -2.O
1.0
Startingvector Yr ( r I r :r , N
1.0 0.0 0.0 0.0
HATRTX A
.1000E+01 -.30008+01 -.2000E+01 .1000E+01
-.3000E+01 .1000E+02 -.3000E+o1 .6000E+01
-.20008+01 -.3000E+01 .3000E+01 -.2000E+o1
.1000E+01 .6000E+o1 -- 20ooE+o1 .10ooE+o1
TRANSFORMED HAIN DIAGONAL OF HATRIX A
.1000E+01 .2786E+01 .1020E+O2 .1015E+01
Note that the processis not iterative. Input and output are listed in Figs 4.9(a) and (b)
respectively.The number of equations,N, is first read in, followed by the upper triangle
coefficientsof A which assumessymmetry.The starting vector yr, which is arbitrary as long
as YIyr: l, is then read in and B6 set to 0.
The main loop carriesout cxactlythe operationsof eqs4.92to build up N valuesof a and
the N - I valuesof p which are printedat theend of the program.For the givenstartingvector
yr:{1 0 0 0}r, the tridiagonalisation yieldsthe sameresultas Householder's,but this is not
always the case.
4.8 Characteristicpolynomial
methods
At thebeginningof this chapterweillustratedhow theeigenvalues of a matrix form the
rootsof an nth orderpolynomial,calledthe'characteristicpolynomial'.We pointedout
that the methodsof Chapter3 could,in principle,be usedto evaluatetheseroots,but
that thiswill rarelybe an effectivemethodof eigenvalue
determination.However,there
are effectivemethods which are based on the properties o[ the characteristic
polynomial.Theseareparticularlyattractivewhenthematrix whoseeigenvalues hasto
be found is a tridiagonalmatrix, and so are especiallyappropriatewhenusedin con-
junction with the Householderor Lanczostransformations describedin the previous
section.
Q2 a 0 0 X2 X2
B, P2
0 f , d3 f t o
0 0 o
P3 d'4fo (4.e3)
fr,-,
f,-, qn xr xn
x r - A f r 0 0 0
fl, dz-A f, 0 0
O f, o t-A ft 0
0 0 fl, d+-) flo :0 (4.94)
'
fo-r
F,- t an- )
128 C H A P T E R4
Although we shall not find these roots directly, consider the calculation of the deter-
minant on the left-hand side of eqs 4.94.
I f n : 1 , d e t r ( , l:)a t - ; .
For n:2.
If n:3,
dt-A flt 0
o, -
az-A : ( o . - 1 )l lof ,' - A A) (4.96)
det.(t): fl, fr. , . z _ A 0r'@r-
0 fl, %-A
property
4.8.2 The Sturm s€quence
a
Z - A
l
|
t - Lt
0 0 0
-1 2-A -1 0 0
-l 2-1 -l
0 0 -1 2-1
A5 A4 A3 A2 Ar
3.732
3.618
3.0 3.4r4
2.618 3.0
2.0 2.0 2.0
1.0
r.382 1.0
0.586
0.268
0.382
d e t u( l )
det. (l )
deto(l)
A,. This separationprop€rty is found for all symmetricA and is calledthe 'Strum
sequence' property.
Its mostusefulconsequence is that for any guessed,l.,
thenumberof signchangesin
detr(t)for i : 0, 1,2,...nis equalto thenumberof eigenvalues of A whicharelessthani.
Recallingthat deto(j.): 1.0,wecan se€from Fig. 4.10thefollowingsignchangecounts,
noting that det;(,l):0 is not a change:
2
a
t
I I
Program 4'10. Characteristic polynomial method for symmetric positivc definite tridiagonal
matrices
An example of a program utilising the features of the characteristic polynomial in the
determination of eigenvaluesis listed below. It uses the following nomenclature:
Simple uariables
N Number of tridiagonal rows
J Eigenvalue wanted: J: I for largest, etc, I < J < N
AL Current estimate of root
ALMAX Upper estimate of root
TOL Iteration tolerance
ITS Maximum number of iterations allowed
OLDL Lower estimate of root
NUMBER Number of sign changes of det,(l)
ITERS Current number of iterations
PARAMETER
restriction
IN >N.
Array size N
5
Eigenvalue required J
I
Starting value AL
2,5
UATN DTAGONAL
. 20008+01 - 2000E+01 .2000E+o1 .20008+01 .20008+01
OFF-DIAGONAL
-.1000E+01 -.10008+01 -.100oE+o1 -.10008+01
ITERATIONS TO CO}N'ERGENCE
T7
eq' 4'97 and then the other det,(l) are formed by recursion.The
numberof sign changesis
detectedby SIGN and accumulatedas NUMBER.
The output in Fig.4.llbshows that the largesteigenvalue, namely3.732isslighttyless
than the 12thestimate'sinceNUMBER is recordedas 5, ttrat is,
there'arestill 5 eigenvalues
Iessthan 3'7323.HoweverDET(5) has beenfound in the bisectionp.o*r,
to be of the order
of 0'002'showingthat convergence hasessentially
beenobtained.More effectiveinterpolation
proc€ssesthan bisectioncan of coursebe devised_
4.8.3 Generalsymmetricmatrices,e.g.bandmatrices
Theprinciplesdescribedin the previoussectioncan beapplied
to generalmatrices,but
the simplerecursionformulafor findingdet(,1)no longerapplies.a *"y of computing
det(2) is to factoriseAn, using the techniquesdescribed program
in 2.3, to yierd
Al: LDLr- Theproductof thediagonalelements in D is thedeterminantof A,. Further
usefulinformationthat can be derivedfrom D is that in the
factorisationof A _ l.I, the
numberof negativeelementsin D is equalto thenumberof eigenvalues
smallerthan i.
4.9 Exercises
I Use vector iteration to find the mode corresponding
'{i:}
to the largest eigenvarueof
l:;,;J
[]
Answer:{0.21490.4927O.8433}rcorrespondingto the eigenvalue14.43.
[ 3 -rl
L-r 2)
and its associatedeigenvector.
Answer:3.618associated with {0.8507 -0.5257}r.
lijltl
134 C H A P T E 4R
6 Show that the systemin Exercise5 can be reducedto the 'standard form'
1 -1: 1 1 - l
f
, L z t l
l t 2 3 r l
Ll 2 3 4)
Answer:
- 1 . 7 3 20 0
l --t I
| 1.732 7.667 1.24't 0 |
o t.247 0.e762-0.1237
I |
L o o -o.rz37 o.35zt
I
ltr 2.2sr3o o I
I z.zgtl 1.643 o.zi3sso I
t t '
0 0.2'13ss
0.53e 0.06e43
I |
Lo o 0.06943
0.3182
I
E I G E N V A L U E E O U A T I O N 1S3 5
of the matrix
l0 Find all the eigenvalues
ti::l
Provethat the eigenmodes associated with theseeigenvalues are orthogonal.
A n s w e r7: L : 1 , 7 2 : 5 , 1 r : 5 , a s s o c i a t ewdi t h t h e m o d e s{ 1 0 - l } r , { l 0 l } r a n d { 0 I 0 } r
respectively.
0
0
Lll -1
-l
a