A numerical scheme

Consider Eq. (2.18)

$\displaystyle u_{tt}-u_{xx}+\sin(u)=0
$

on the interval $ x\in[a,\,b]$ with initial conditions

$\displaystyle u(x,0)=f(x),\qquad u_t(x,0)=g(x)$ (2.23)

and, e.g., no-flux boundary conditions

$\displaystyle \frac{\partial u}{\partial x}\biggl\vert_{x=a,b}=0.
$

Let us try to apply a simple explicit scheme (2.10) to Eq. (2.18). The discretization scheme reads

$\displaystyle u_i^{j+1}=-u_i^{j-1}+2(1-\alpha^2)u_i^{j}+\alpha^2(u_{i+1}^j+u_{i-1}^j)-\triangle t^2\sin(u_i^j)$ (2.24)

with $ \alpha=\triangle t/\triangle x$ , $ i=0,\ldots,M$ and $ t=0,\ldots,T$ .

To the implementation of the second initial condition one needs again the virtual point $ u_i^{-1}$ ,

$\displaystyle u_t(x_i,0)=g(x_i)=\frac{u_i^1-u_i^{-1}}{2\triangle t}+\mathcal{O}(\triangle t^2).
$

So, one can rewrite the last expression as

$\displaystyle u_i^{-1}=u_i^1-2\triangle t g(x_i)+\mathcal{O}(\triangle t^2),
$

and the second time row can be calculated as

$\displaystyle u_i^1=\triangle tg(x_i)+(1-\alpha^2)f(x_i)+\frac{1}{2}\alpha^2(f(x_{i-1})+f(x_{i+1}))-\frac{\triangle t^2}{2}\sin(f(x_i)).$ (2.25)

No-flux boundary conditions lead to the expressions for two virtual space points $ u_{-1}^j$ and $ u_{M+1}^j$ :
$\displaystyle \frac{\partial u}{\partial x}\biggl\vert_{x=a}$ $\displaystyle =$ $\displaystyle 0\Leftrightarrow \frac{u_1^j-u_{-1}^j}{2\triangle x}=0\Leftrightarrow u_{-1}^j=u_{1}^j;$  
$\displaystyle \frac{\partial u}{\partial x}\biggl\vert_{x=b}$ $\displaystyle =$ $\displaystyle 0\Leftrightarrow \frac{u_M^j-u_{M+1}^j}{2\triangle x}=0\Leftrightarrow u_{M+1}^j=u_{M}^j;$  

One can try to rewrite the differential scheme to more general matrix form. In matrix notation the second time-row is given by

$\displaystyle \boxed{ \mathbf{u}^1=\triangle t \gamma_1+A\mathbf{u}^0-\frac{\triangle t^2}{2}\beta_1,}$ (2.26)

where
$\displaystyle \gamma_1$ $\displaystyle =$ $\displaystyle \bigl(g(a),g(x_1),g(x_2),\ldots,g(x_{M-1}), g(b)\bigr)^T$   and  
$\displaystyle \beta_1$ $\displaystyle =$ $\displaystyle \bigl(\sin(u_0^0),\sin(u_1^0),\ldots,\sin(u_{M-1}^0),\sin(u_{M}^0)\bigr)^T$  

are $ M+1$ -dimensional vectors and $ A$ is a tridiagonal square $ M+1\times M+1$ matrix of the form

$\displaystyle A=\begin{pmatrix}
1-\alpha^2 & \boxed{\alpha^2} & 0 & \dots 0\\
...
...ts 0\\
\hdotsfor{4}\\
0 & \dots & \boxed{\alpha^2}& 1-\alpha^2
\end{pmatrix} $

The boxed elements indicate the influence of periodic boundary conditions. Other time rows can also be written in the matrix form as

$\displaystyle \boxed{ \mathbf{u}^{j+1}=-\mathbf{u}^{j-1}+B\mathbf{u}^j-\triangle t^2\beta,\quad j=1,\ldots,T-1}$ (2.27)

Here

$\displaystyle \beta= \bigl(\sin(u_0^j),\sin(u_1^j),\ldots,\sin(u_{M-1}^j),\sin(u_{M}^j)\bigr)^T
$

is a $ M+1$ -dimensional vector and $ B$ is a square matrix, defined by an equation

$\displaystyle B=2A.$

Gurevich_Svetlana 2008-11-12