# Numerical stability while modeling wave equation in staggered grid

I have modeled a simple wave equation given by:

\begin{align} & \begin{cases} u_t = v_x \\ v_t = u_x \end{cases} \end{align}

Boundary conditions given on interval $$M=[-1,1]$$ by:

\begin{align} u(-1,t) = u(1,t) = 0 \hspace{1cm} \forall t \ge 0\\ \end{align}

and initial conditions (take $$t=0$$) given by the exact solution

\begin{align} u = \sin(2 \pi x) \cos(2 \pi t) \\ v = \cos(2 \pi x) \sin(2 \pi t) \end{align}

My model uses leapfrog to time integration and 4th order mimetic operators (they are much like regular FDM operators, except on boundaries, and can be found at PyMTK github page, ton the page itself you will see the appearance of the Gradient and Divergent that I will put down here for sake of simplicity)

## Divergent Operator (N=11)

[-0.9151,  0.7003,  0.3911, -0.2244,  0.0497, -0.0016,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417, -0.    , -0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    , -0.    ,  0.0417, -1.125 ,  1.125 , -0.0417, -0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    , -0.    , -0.    ,  0.0417, -1.125 ,  1.125 , -0.0417],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.0016, -0.0497,  0.2244, -0.3911, -0.7003,  0.9151]


[-3.3617,  4.398 , -1.489 ,  0.5526, -0.1024,  0.0026,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.1524, -1.2917,  1.2083, -0.075 ,  0.006 ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417,  0.    ,  0.    ,  0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.0417, -1.125 ,  1.125 , -0.0417, -0.    , -0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    , -0.    ,  0.0417, -1.125 ,  1.125 , -0.0417, -0.    ],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    , -0.    , -0.006 ,  0.075 , -1.2083,  1.2917, -0.1524],
[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    , -0.0026,  0.1024, -0.5526,  1.489 , -4.398 ,  3.3617]


The problem is after some iterations and error approaching zero, it starts to grow, as can be seen in figure below:

$$\Delta t$$ is obtained using a CFL number of $$0.85$$ based on $$\Delta x$$.

I don't know where to investigate further for this issue.

I can add any information needed to help me to uncover this. The simulation was written in Python.