I have a boundary-value problem, that is defined over two adjacent regions with an interface in the middle, that contains an eigenvalue $\lambda$. The boundary conditions and the equations are homogeneous (as expected a linear stability analysis), but could depend on $x$.
For a simple example: \begin{align} y''''(x) + 5 y''(x) + \lambda^4 y(x) &= 0, \quad x \in [x_1,x_2] \\ z''''(x) - \lambda^4 z(x) &=0, \quad x \in [x_2,x_3] \\ \end{align}
With some boundary conditions, say \begin{align} y'(x_1)= y''(x_1)=0, \quad z'(x_3)=z'''(x_3)=0, \end{align} and some continuity/jump conditions at the interface: \begin{align} y(x_2)&=z(x_2) \\ y''(x_2)&=z''(x_2) \\ y'(x_2)+y'''(x_2)&= - 2 z'(x_2)+z(x_2)-z'''(x_2) \\ 3 y'''(x_2)&= z'''(x_2)-z'(x_2) \end{align}
Here is some code with those equations and conditions:
x1 = -5; x2 = 1; x3 = 2;
eq1 = y''''[x] + 5 y''[x] + λ^4 y[x] == 0;
eq2 = z''''[x] - λ^4 z[x] == 0;
matchconds = {y[x2] == z[x2], y'[x2] + y'''[x2] == -2 z'[x2] + z[x2] - z'''[x2],
y''[x2] == z''[x2], 3 y'''[x2] == -z'[x2] + z'''[x2]};
bcs1 = {y'[x1] == 0, y''[x1] == 0};
bcs2 = {z'[x3] == 0, z'''[x3] == 0};
These equations are actually somewhat amenable to finding analytic results, which may be useful to compare fully numerical solutions with, but in general the coefficients of $y$ and $z$ can depend on $x$. Here is a code for finding some roots via DSolve
:
ysub = DSolve[eq1, y, x][[1]];
zsub = DSolve[eq2, z, x, GeneratedParameters -> (C[# + 4] &)][[1]];
coefmat = Transpose[Table[Coefficient[Join[bcs1, bcs2, matchconds] /. ysub /. zsub /.
Equal -> Subtract, ii], {ii, Array[C, 8]}]];
detRoots = {λ, 0} /. (FindRoot[Det[coefmat], {λ, #}] & /@ {1.3, 1.5, 2, 4}) //Chop;
Note, I plan on self-answering this using my package which calculates the Evans function, but I'm interested in other methods.