Say that I have a generalized eigenvalue problem of the form $$Ax=\lambda Bx.$$ Using MATLAB, some naive ways that one may solve this is by either
directly inverting $B$ then applying the
eig
function in order to compute the eigenvalues and eigenvectors, orsimply applying
eig
to both matrices i.e.eig(A,B)
.
The issue with these approaches is the following. Imagine that $A, B$ are large matrices with relatively large condition numbers such as a matrix representing finite difference approximations. Then, the results from method 1) are less trustworthy and prone to error, where results from method 2) take a long time to be generated. For example, on a test problem that I ran, it took over 2 times as long to do method 2), around $65$ vs. $140$ seconds, and the grid resolution was far too coarse for me to realistically use.
What types of methods are best to apply to this problem which are both speedy and accurate — obviously a tall order where some degree of tradeoff must occur? I thought about trying to use an iterative method like multigrid, this isn't in the standard $Ax=b$ form that I'm used to seeing.
For context, this problem actually comes from a quadratic eigenvalue problem $$(\lambda^2 A_2+\lambda A_1+A_0)x=0,$$ but MATLAB's polyeig
function takes a very long time due to calculating the QZ factorization (just like how method 2) takes a long time). In this case, the matrix which I called $A$ originally is a block matrix of the form $$\begin{bmatrix} U & V\\ 0 & I\end{bmatrix},$$ and $B$ is of the form $$\begin{bmatrix} 0 & W\\ I & 0\end{bmatrix},$$ where $U,V$, and $W$ involve finite difference matrices.