I would like to solve the following equation $$\frac{\partial^2 y}{\partial t^2} - c^2(x,t)\frac{\partial^2 y}{\partial x^2}=0,$$ for $y=y(x,t)$ numerically. The wave speed, $c(x,t)$, is of the form $$c(x,t) = \begin{cases} c_1(t), & x<0 \\ c_2(t), & x\ge 0. \end{cases}$$ The initial conditions are $$y(x,0)=f(x),$$ $$\left.\frac{\partial y}{\partial t}\right|_{t=0}=g(x).$$ The boundary conditions are that the solution is periodic in $x$, with period $2l$ such that $$y(-l,t)=y(l,t).$$ Note that if you can find a solution with a more convenient set of boundary conditions please let me know. We need $y(x,t)$ and $\partial y / \partial x$ to be continuous.
I am not sure how to solve this. My first thoughts are to solve the problem like this. Let $$y(x,t)=\begin{cases} y_1(x,t), & x<0 \\ y_2(x,t), & x\ge0, \end{cases}$$ where $$\frac{\partial^2 y_1}{\partial t^2} - c_1^2(t)\frac{\partial^2 y_1}{\partial x^2}=0,$$ $$\frac{\partial^2 y_2}{\partial t^2} - c_2^2(t)\frac{\partial^2 y_2}{\partial x^2}=0,$$ where the boundary conditions are now $$y_1(-l,t)=y_2(l,t),$$ $$y_1(0,t)=y_2(0,t),$$ but how do I proceed from here?