# TITLE: Eigenvalues # AUTHOR: Roy F.A. Maclean # EMAIL: rfamgm at gmail # WEB: http://www.spiderpixel.co.uk/caspro # DATE: 20th February 2002 # MAKE: CASIO # MODEL: 9850 # SIZE: 343 # Notes: # This program calculates the real eigenvalues of a matrix using the iterative # power method with deflation. If the program doesn't produce an answer it # is because the method isn't converging fast enough or at all. # If the eigenvalues are complex then the method won't converge. # To use this program go into matrix editor mode and input a square matrix # into Mat A. Then run the program. You will be prompted to enter a number # representing how many decimal places you want the result to be accurate to. # The more decimal places the slower the longer the program will take. # example: enter the matrix [ -4 14 0 ] # [ -5 13 0 ] # [ -1 0 2 ] into matrix A. # # Now run the program and enter 5 at the prompt. # The program will display each eigenvalue, press EXE to continue. # In this case the results are 6.000009239, 3.000007693, 1.999983068 # The program has stopped after 5 decimal places are calculated. # To get a more accurate result, run the program again and enter 10 at # the prompt. This time the result will be: 6,3,2 but it will take longer. # The commands to type can be found with the guide below: # <> not equal shift vars f6 f3 f2 # -> assign on keyboard # => implies shift vars f3 f3 # _ display shift vars f5 (triangle symbol) # List optn f1 f1 # Dim optn f1 f3 # Max( optn f1 f6 f2 # Seq( optn f1 f5 # List->Mat( optn f1 f2 # Mat optn f2 f1 # Mat->List( optn f2 f2 # Trn optn f2 f4 # Identity optn f2 f6 f1 # Ran# optn f6 f3 f4 # Break shift vars f2 f3 # If, IfEnd If-menu: shift vars f1 # For, To, Next For-menu: shift vars f1 f6 # Lbl, Goto Jump-menu: shift vars f3 @@ Program "EIGENVAL" ?->T Mat A->Mat E Lbl 0 0->F Dim Mat E List Ans[1->D D=1=>Goto 3 Seq(Ran#,X,1,D,1->List 1 List->Mat(List 1)->Mat B Lbl 1 Mat EMatB->Mat C Mat->List(Mat C,1->List 1 Max(List 1->E Abs (E-F)<10^-T=>Goto 2 E->F (1/E)Mat C->Mat B Goto 1 Lbl 2 E_ Mat->List(Mat B,1->List 1 For 1->B To D List 1[B->V If V=Max(List 1 Then B->J Break IfEnd Next Trn Mat E->Mat D Mat->List(Mat D,J->List 1 List->Mat(List 1)->Mat D Mat E-EMat B((1/EV)Trn Mat D->Mat D Identity (D-1->Mat E For 1->R To D For 1->C To D R<>J=>C<>J=>Mat D[R,C]->Mat E[R-(R>J,C-(C>J Next Next Goto 0 Lbl 3 Mat E[1,1_ "END"