Skip to main content

differential equations - Solving eigenvalue BVP with an interface


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.



Answer



In general, for a linear homogeneous equation of this type we can write: \begin{align} \frac{d \mathbf{y}}{dx} &= \mathbf{A}_y(\lambda, x) \cdot \mathbf{y}, \\ \frac{d \mathbf{z}}{dx} &= \mathbf{A}_z(\lambda, x) \cdot \mathbf{z}, \\ \mathbf{B} \cdot \mathbf{y}(x_1) &= \mathbf{0}, \\ \mathbf{F} \cdot \mathbf{y}(x_2) +\mathbf{G} \cdot\mathbf{z}(x_2) &= \mathbf{0}, \\ \mathbf{C} \cdot \mathbf{z}(x_3) &= \mathbf{0}. \\ \end{align}



for some matrices $\mathbf{A}_y, \mathbf{A}_z, \mathbf{B}, \mathbf{C}, \mathbf{F}, \mathbf{G}$, which may all involve the eigenvalue $\lambda$ (and $\mathbf{A}_y$ and $\mathbf{A}_z$ may be functions of $x$).


The boundary condition at $x=x_1$ gives us two conditions on the four entries of $\mathbf{y}$ there, so we can find two linearly independent solutions that satisfy the boundary conditions. In this example, $\mathbf{y}^1(x_1) = [1, 0, 0, 0]$ and $\mathbf{y}^2(x_1) = [0, 0, 0, 1]$. We can then integrate both of these solutions across to the matching point $x_2$, and then the general solution is given by $\mathbf{y} = k_1 \mathbf{y}^1 + k_2 \mathbf{y}^2$ (due to linearity).


The same procedure starting at $x=x_3$ gives us a general solution for $\mathbf{z} = k_3 \mathbf{z}^1 + k_4 \mathbf{z}^2$.


For the simpler case without the interface conditions (where $\mathbf{A}_y = \mathbf{A}_z$, we would then require that the two solutions match at a matching point (which could be chosen arbitrarily), i.e. $\mathbf{y}(x_m) = \mathbf{z}(x_m)$, which could be written as $\mathbf{N}(x_m, \lambda) \mathbf{k}=\mathbf{0}$, where the matrix $\mathbf{N}$ is given by \begin{equation} \mathbf{N}(x_m, \lambda)=[\mathbf{y}^1, \mathbf{y}^2, \mathbf{z}^1, \mathbf{z}^2]. \end{equation} Non-trivial solutions (i.e. eigenvalues) therefore require $|\mathbf{N}(x_m, \lambda)|=0$. The Evans function $D(\lambda)$ is a (complex) analytic function whose roots are eigenvalues of the original equation, which is independent of the location of the matching point, \begin{equation} D(\lambda)= \exp( -\int^{x_m}_{x_1} {\rm tr}\, A(s, \lambda)\, d s) \; |N(x_m, \lambda)|. \end{equation}


For the interface case as described here, we need to satisfy the interface conditions instead, leading to \begin{equation} \hat{\mathbf{N}} = [\mathbf{F} \cdot \mathbf{y}^{1}, \mathbf{F} \cdot \mathbf{y}^{2}, \mathbf{G} \cdot \mathbf{z}^{1}, \mathbf{G} \cdot \mathbf{y}^{2}], \end{equation} and therefore $|\hat{\mathbf{N}}|=0$.


I have a package that implements all this, including using the compound matrix method to help make the differential equations less stiff, at the cost of converting to more equations. So let us load the package:


Needs["PacletManager`"]
PacletInstall["CompoundMatrixMethod",
"Site" -> "http://raw.githubusercontent.com/paclets/Repository/master"]
Needs["CompoundMatrixMethod`"]


Convert the system of ODEs into the matrix form, which gives all the matrices:


sys = ToMatrixSystem[{eq1, eq2}, {bcs1, bcs2, matchconds}, {y,z}, {x, x1, x2, x3}, λ];

Then the function Evans can be evaluated for a given value of $\lambda$ with this system:


Evans[1, sys]
-0.170854

And a quick plot:


Plot[Evans[λ, sys], {λ, 0, 5}]


enter image description here


Note that even though there is a zero of the analytic determinant at $\lambda = 1.58114$, this is because there are repeated roots of the equation for $y$ and not an actual eigenvalue. Note that the Evans function is continuous here (goes down to ~-75).


And then we can find the eigenvalues via FindRoot:


λ /. FindRoot[Evans[λ, sys], {λ, #}] & /@ {1, 1.3, 1.4, 5}

Comments

Popular posts from this blog

functions - Get leading series expansion term?

Given a function f[x] , I would like to have a function leadingSeries that returns just the leading term in the series around x=0 . For example: leadingSeries[(1/x + 2)/(4 + 1/x^2 + x)] x and leadingSeries[(1/x + 2 + (1 - 1/x^3)/4)/(4 + x)] -(1/(16 x^3)) Is there such a function in Mathematica? Or maybe one can implement it efficiently? EDIT I finally went with the following implementation, based on Carl Woll 's answer: lds[ex_,x_]:=( (ex/.x->(x+O[x]^2))/.SeriesData[U_,Z_,L_List,Mi_,Ma_,De_]:>SeriesData[U,Z,{L[[1]]},Mi,Mi+1,De]//Quiet//Normal) The advantage is, that this one also properly works with functions whose leading term is a constant: lds[Exp[x],x] 1 Answer Update 1 Updated to eliminate SeriesData and to not return additional terms Perhaps you could use: leadingSeries[expr_, x_] := Normal[expr /. x->(x+O[x]^2) /. a_List :> Take[a, 1]] Then for your examples: leadingSeries[(1/x + 2)/(4 + 1/x^2 + x), x] leadingSeries[Exp[x], x] leadingSeries[(1/x + 2 + (1 - 1/x...

How to thread a list

I have data in format data = {{a1, a2}, {b1, b2}, {c1, c2}, {d1, d2}} Tableform: I want to thread it to : tdata = {{{a1, b1}, {a2, b2}}, {{a1, c1}, {a2, c2}}, {{a1, d1}, {a2, d2}}} Tableform: And I would like to do better then pseudofunction[n_] := Transpose[{data2[[1]], data2[[n]]}]; SetAttributes[pseudofunction, Listable]; Range[2, 4] // pseudofunction Here is my benchmark data, where data3 is normal sample of real data. data3 = Drop[ExcelWorkBook[[Column1 ;; Column4]], None, 1]; data2 = {a #, b #, c #, d #} & /@ Range[1, 10^5]; data = RandomReal[{0, 1}, {10^6, 4}]; Here is my benchmark code kptnw[list_] := Transpose[{Table[First@#, {Length@# - 1}], Rest@#}, {3, 1, 2}] &@list kptnw2[list_] := Transpose[{ConstantArray[First@#, Length@# - 1], Rest@#}, {3, 1, 2}] &@list OleksandrR[list_] := Flatten[Outer[List, List@First[list], Rest[list], 1], {{2}, {1, 4}}] paradox2[list_] := Partition[Riffle[list[[1]], #], 2] & /@ Drop[list, 1] RM[list_] := FoldList[Transpose[{First@li...

front end - keyboard shortcut to invoke Insert new matrix

I frequently need to type in some matrices, and the menu command Insert > Table/Matrix > New... allows matrices with lines drawn between columns and rows, which is very helpful. I would like to make a keyboard shortcut for it, but cannot find the relevant frontend token command (4209405) for it. Since the FullForm[] and InputForm[] of matrices with lines drawn between rows and columns is the same as those without lines, it's hard to do this via 3rd party system-wide text expanders (e.g. autohotkey or atext on mac). How does one assign a keyboard shortcut for the menu item Insert > Table/Matrix > New... , preferably using only mathematica? Thanks! Answer In the MenuSetup.tr (for linux located in the $InstallationDirectory/SystemFiles/FrontEnd/TextResources/X/ directory), I changed the line MenuItem["&New...", "CreateGridBoxDialog"] to read MenuItem["&New...", "CreateGridBoxDialog", MenuKey["m", Modifiers-...