Using the GUI with Sparse matrices
See also Using the GUI with Dense Matrices.
The software can be downloaded here.
The GUI has been designed to work in conjunction with
the MATLAB version 6 eigs command, which
computes some eigenvalues of a large sparse matrix. The eigs
command calls the Fortran code ARPACK, written
by Rich
Lehoucq, Kristi
Maschhoff, Dan
Sorensen and Chao
Yang. After running eigs for your particular problem, the
GUI is started and the pseudospectra in a region around the eigenvalue
estimates (Ritz values) returned by eigs are computed. This can
then be used to help decide if the eigenvalues returned are accurate
and physically meaningful (see interpretation and examples). Once the GUI has been started, all
computation is done with an upper Hessenberg matrix with dimension the
maximum subspace size (p in eigs). Since this is
generally very much smaller than the size of the original matrix,
computations within the GUI are generally much quicker than equivalent
computations with the original matrix.
The GUI is started automatically after an
eigs computation by default. Several parameters are available
to control the initial look of the pseudospectra computed. They are
listed below, along with their default values. Any options used should
be passed to the eigs command in the same structure as usual.
Full documentation of the operation of the
GUI once it has been started is also available.
Option | Default value | Meaning |
opts.pseudospectra | 1 | Use the GUI (1)
or not (0) after running eigs. |
opts.npts | problem dependent, 15..80
| Number of gridpoints to use (see
Documentation: Mesh). |
opts.levels | problem
dependent | Epsilon levels (logs base 10). |
opts.ax | problem dependent | Axes. |
opts.colour | 1 |
Draw the pseudospectra using coloured lines? 1 = colour, 0 = b/w. |
opts.thick_lines | 1 |
Draw the pseudospectra using thick lines? 1 = thick, 0 = thin; other values (only used for printed plots) are defined by interpolation |
opts.scale_equal | 1 |
Start with the axis scale equal or not. 1 = equal, 0 = unequal. |
opts.print_plot | 0 | Run the GUI and create a printable plot only (i.e. no interaction) |
opts.no_waitbar | 0 | 1 = do not display any waitbars, 0 = display waitbars when computing. |
opts.ews | [] | The GUI does not compute eigenvalues for rectangular Hessenberg or sparse matrices. If you know some eigenvalues, and want them to be displayed on the plot (or want to compute their condition number), put them in this option when starting the GUI. |
opts.ews | problem dependent | Vector containing the eigenvalues of a rectang
ular or sparse matrix (not computed by default within the GUI. |
opts.dim | 0 | Display the dimension of the matrix at the bottom left hand corner of the axes? 1 = yes, 0 = no. |
opts.grid | 0 | Display the grid used to compute the pseudospectra on? 1 = yes, 0 = no. |
opts.no_ews | 0 | Suppress display of eigenvalues in plots? 1 = yes, 0 = no. |
opts.fov | 0 | Display the field of values? 1 = yes, 0 = no. |
opts.unitary_mtx | [] | A unitary transformation to apply to eigenmodes and pseudoeigenmodes before displaying |
opts.assign_output | 0 | Set variables in the base workspace? This is needed to obtain output from EIGS; the variables are psa_output_x, psa_output_y and psa_output_Z. 1 = yes, 0 = no. |
In addition to the above method
using eigs, the GUI can also compute the pseudospectra of
sparse matrices directly. The time required is roughly proportional to
the product of the time taken to perform a sparse LU decomposition of
the matrix and the total number of gridpoints. The advantage of this
method is that the computed pseudospectra are exact, while the
pseudospectra computed using eigs are only
approximations.
Examples
To compute 30 eigenvalues of largest real part using the default
settings:
K = sparse(gallery('kahan',500)); % Generate the matrix
eigs(K,30,'LR'); % Call eigs, asking for the 30 eigenvalues
of largest real part
To compute 20 eigenvalues of largest real part for a random matrix,
using a subspace of size 40 and an initial grid of size 30 by 30:
clear opts; % Clear this variable in case it is in use
already
N = 1000; A = spdiags([3*exp(-(0:N-1)'/10)
.5*ones(N,1)],0:1,N,N) + .1*sprandn(N,N,10/N); % Generate the matrix
opts.p = 40; % Set the maximum subspace dimension to 40
opts.npts = 30; % Initially use a grid of size 30 by 30
eigs(A,20,'LR',opts); % Call eigs, asking for the 20 eigenvalues
of largest real part
Pseudospectra GUI home page.
|