We discuss the results for a small example that can be easily repeated. The unsymmetric matrix is of dimension and it is tridiagonal. The diagonal entries are , the codiagonal entries are , .
We use Algorithms 7.18 and 7.19 for the computation of the eigenvalues closest to the target value . Since these eigenvalues are located in the interior of the spectrum, we expect some advantage from Algorithm 7.19, which is designed for interior eigenvalues. Indeed, as we will see, the usage of harmonic Ritz values leads to an advantage here.
We have carried out the experiments in MATLAB. The input parameters have been chosen as follows. The starting vector has been chosen with random entries (with in MATLAB). The tolerance is . The subspace dimension parameters are , . The correction equations in (27) of Algorithm 7.18 and (34) of Algorithm 7.19 have been solved approximately with five steps of GMRES.
We show graphically in Figure 7.5 the norm of the residual vector as a function of the iteration number. Each time when the norm is less than , then we have determined an eigenvalue in acceptable approximation, and the iteration is continued with deflation for the next eigenvalue. The left picture represents the results obtained with Algorithm 7.18, and we see that there is no convergence detected within Jacobi-Davidson steps. In the right picture we see the results for Algorithm 7.19, and now eigenvalues have been discovered within iterations.