The file contains the Matlab/Octave source code for the computational example of the Arnoldi algorithm.
The Arnoldi algorithm converges faster to the leading eigenvalues, but the converge rate to the other requested eigenvalues is slower. Hence, it is a common practice to compute a larger number of eigenvalues than the actual sough number, to use the extra values as an error buffer (Lehoucq et al., 1998; Tuckerman and Barkley, 2000). In the present example, the four leading eigenvalues are sought. Therefore, the method is assembled to compute twice as many eigenvalues and eigenvectors (k = 8), but only the first four are reported and used in the computation of the errors and convergence residue.
Calls all the different subroutines in the required order to compute the eigenvalues and eigenvectors of a diagonal matrix Mii = −i/2. In this case, the size of the matrix is m = 50 and four eigenpairs are requested, but twice as many are actually computed but not reported, to reduce the error, as recommended by Tuckerman and Barkley (2000).