Implementing boundary conditions for PDE simulation

91 Views Asked by At

I have the following modified nonlinear schrodinger equation: $\vec{u} = (u_1,u_2, \cdots, u_n,\cdots, u_N)$

$$i\dot{u}_n = \sum\limits_{\substack{m \in 1:N \\ m\neq n}}\frac{u_n - u_m}{|n-m|^{1+\alpha}} - |u_n|^2u_n$$

The matrix-vector equation is: $$i\vec{u} = M\vec{u} - |\vec{u}|^2 \vec{u}$$ where $M$ is a symmetric matrix: $M(n,n) = \sum\limits_{\substack{m \in 1:N \\ m\neq n}}\frac{1}{|n-m|^{1+\alpha}} $ and $M(n,m) = -\frac{1}{|n-m|^{1+\alpha}} $

I want to impose Dirichlet boundary conditions such that the solution is 0 at the boundary, say $x_1 = 1 < x_2 < \cdots < x_N = N$, but I am unsure how that is reflected in the coefficient matrix $M$.

My attempt: Since I want the solution to vanish at the boundary then I need: $u(1) = u(N) = 0$. But how do I represent this in the matrix?

Attempt: $N=5$. $u_1=u_5=0$

\begin{align} 0 &=-\frac{u_2}{|1-2|^{1+\alpha}}-\frac{u_3}{|1-3|^{1+\alpha}}-\frac{u_4}{|1-4|^{1+\alpha}}\\ i\dot{u}_2 &=u_2 \sum\limits_{\substack{m\in 1:5 \\ m\neq 2}}\left (\frac{1}{|2-m|^{1+\alpha}}\right ) -\frac{u_3}{|2-3|^{1+\alpha}}-\frac{u_4}{|2-4|^{1+\alpha}}\\ i\dot{u}_3 &=u_3 \sum\limits_{\substack{m\in 1:5 \\ m\neq 3}}\left (\frac{1}{|3-m|^{1+\alpha}}\right )-\frac{u_2}{|3-2|^{1+\alpha}}-\frac{u_4}{|3-4|^{1+\alpha}}\\ i\dot{u}_4 &=u_4 \sum\limits_{\substack{m\in 1:5 \\ m\neq 4}}\left (\frac{1}{|4-m|^{1+\alpha}}\right )-\frac{u_2}{|4-2|^{1+\alpha}}-\frac{u_3}{|4-3|^{1+\alpha}}\\ 0 &= -\frac{u_2}{|5-2|^{1+\alpha}}-\frac{u_3}{|5-3|^{1+\alpha}}-\frac{u_4}{|5-4|^{1+\alpha}} \end{align}

$M = \begin{bmatrix}\end{bmatrix}$

1

There are 1 best solutions below

5
On BEST ANSWER

You can substitute $u_1 = 0$ and $u_N = 0$ into the equations to arrive at a linear system with $N - 2$ rows (instead of $N$ rows). Alternatively, you can make the first and last row of your linear system the equations $u_1 = 0$ and $u_N = 0$, respectively.

Addendum: Substituting $u_1 = 0$ and $u_N = 0$ into your equations, one gets $N - 2$ equations: \begin{multline*} i\dot{u}_{n}=\frac{u_{n}}{\left|n-1\right|^{1+\alpha}}+\left(\sum_{\substack{1<m<N\\ m\neq n } }\frac{u_{n}-u_{m}}{\left|n-m\right|^{1+\alpha}}\right)+\frac{u_{n}}{\left|n-m\right|^{1+\alpha}}-\left|u_{n}\right|^{2}u_{n}\\ \text{for }n=2,\ldots,N-1. \end{multline*}