Imposing boundary conditions for PDE quadratic eigenvalue problem

I have a quadratic eigenvalue problem of the form:

$$(A_2 s^2 + A_1 s + A_0)\hat{v} = 0$$

where $s$ is the eigenvalue. The matrices $A_i$ contain derivatives up to order six, and I have six boundary conditions:

$$\hat{v}(0) = \hat{v}(1) = 0 \\ \hat{v}^{ii}(0) = \hat{v}^{ii}(1) = 0 \\ \hat{v}^{iv}(0) = \hat{v}^{iv}(1) = 0$$

If the eigenvalue problem was of "standard" form $A\hat{v}=\lambda \hat{v}$ then I would simply modify the first and last rows of the matrix $A$ to impose the boundary conditions. But for my problem I don't know if I should impose the boundary conditions for all three matrices, or just for $A_0$ (which is not multiplied by $s$), in which case I would set the corresponding terms of $A_2$ and $A_1$ to zero. Actually I tried to use this last approach but it didn't work (I am calculating the eigenvalues using MATLAB's polyeig).

More specifically, the differential equation is:

$$\left [\left(D^2 - K^2 \right)s^2 - 2 \left(D^2 - K^2\right)^2s + \left(D^2 - K^2 \right)^3 + Ra K^2 \right] \hat{v} = 0$$

where $D = \frac{\partial^2}{\partial y^2}$, $K$ is a constant (so numerically it is a diagonal matrix), and $Ra$ is a constant scalar. The differentiation operator $D$ is implemented using Chebyshev collocation, and the higher-order derivatives can be evaluated as powers of $D$.

I think you've already made a mistake in your thinking when you consider the standard EVP $A v = \lambda v$. Let's consider this problem and impose your very first BC, $v(0) = 0$:
The first row of $A$ is then $\{1,0,...,0\}$ as you suggest, and let us not forget that $A v = \lambda v$ is really just $A v = \lambda B v$ in disguise, where $B = I$ the identity matrix. And so your first equation then reads $v(0) = \lambda v(0)$. This is not what you want! To properly impose your first BC you then need to modify $B = I$ such that the first row is a row of zeros, and you will have $v(0) = 0$. This extends simply to your other Dirichlet condition.
If I assume that your differential operators do not include eigenvalue $\lambda$, though sometimes they might, then this extends to the requirement that the appropriate rows in matrices $A_1$ and $A_2$ need to be modified to enforce them.
• You're right. And no, the operators do not include the eigenvalues. But the thing is, if I modify $A_2$ and $A_1$ to account for the BCs, then the equivalent rows would be multiplying $s^2$ and $s$, and I think that would violate the BCs for $\hat{v}$. That's why I thought about zeroing the BC rows of $A_2$ and $A_1$ and enforce the BCs on $A_0$ only. By the way, I tried both approaches and none give me correct results. – Albertini Aug 28 '16 at 14:07
• Actually the eigenvectors I'm getting do satisfy the BCs, so I agree that the problem is elsewhere. A simplification of my problem consists of setting $s=0$ and then solving the problem $A_0 \hat{v} = -Ra K^2 \hat{v}$ (please see the original question where I have now included the full equations). In that case (same BCs) I get a lot of spurious eigenvalues, but I do find the correct one too. My guess is that these spurious eigenvalues arise from the way I impose the BCs. Do you have any suggestion on that? – Albertini Aug 28 '16 at 16:46
• Those spurious eigenvalue indeed are from how you impose the boundary conditions and this is normal using the Chebyshev scheme. However, usually the number of spurious eigenvalues is equal to the number of boundary conditions. You can check that these are spurious by evaluating the residual of $A v - s v$ then discard them. There's also literature on this topic because in some cases it can be quite difficult to deal with. – Spencer Bryngelson Aug 28 '16 at 18:13
• Indeed if I impose six BCs I get six eigenvalues with value NaN or Inf. However, some of the other eigenvalues are very large ( $~10^5$), when the maximum value I expect was about 600 - and I get that value too, but then without knowing which value I should expect I wouldn't be able to know what the correct eigenvalue was. I also noticed that increasing the number of collocation points above 60, I no longer recover the correct eigenvalue. I will need to find a better way of imposing the BCs. I found examples of how to do this for 4th order problems, but no for 6th order as is the case here. – Albertini Aug 29 '16 at 10:23