I'm currenly working on my own PDE solver for non-linear simulations in python. I've done succesfully simulations for KdV and Fisher's equation, but now I'm playing with second order derivatives in time.
The equation I'm using is 1D wave equation, with $\Delta x = 0.5$ and $\Delta t = 0.01$. For simplicity I'm using $c = 1$ and solving by defining an auxiliar field $v(x,t)$, so the equation looks like
$$\partial_t u = v(x,t); \qquad \partial_t v = c^2 \partial_{xx} u$$
Currently I'm using my own RK4 integrator for time and finite differences up to $O(h^2)$ for space. My problem is that as time passes by, with $u(x,0) = \sin(\alpha x)$ and $\partial_t u(x,0) = 0$ the solution seems to grow until it numerically diverges. I tried with gaussian initial conditions, such as $u(x,0) = \exp(-\beta x^2)$, $\partial_t u(x,0) = 0$ and $u(x,0) = 0$, $\partial_t u(x,0) = \exp(-\gamma x^2)$and the solutions seem to irradiate waves which are not part of the analytical solution for these cases.
The boundary conditions are not fixed for the gaussian cases, I just tried these initial condions in order to find what's going on.
Does someone faced the same issues? Could it be for the order on finite differences? I'm pretty new at simulations, so anything would be helpful :)
Here are the plots for the situations mentionatres above, respectively.