# Zigzag behavior on non-reflecting boundary

My goal is to simulate a 1D wave using the finite difference method, but I am having some trouble with the transparent boundary condition (TBC). I am trying to solve, $$\frac{\partial ^2y}{\partial t^2}(x,t)=v^2\frac{\partial ^2y}{\partial x^2}(x,t)$$ The left-side boundary condition is a fixed Dirichlet condition and the right-side is a transparent one: $$\frac{\partial y}{\partial x}=-\frac{1}{v}\frac{\partial y}{\partial t}, \quad x=L$$
The discrete approximation of the TBC: $$\frac{y_{m+1,n}-y_{m-1,n}}{2\Delta x}=-\frac{1}{v}\frac{y_{m,n+1}-y_{m,n-1}}{2\Delta t}$$

I did all the necessary transformations of the wave equation and was able to create a computer simulation of the wave propagating. However, the resulting graph does not look correct. There is a zigzag forming at the right boundary which propagates to the rest of the wave as time goes on. This would suggest an error in calculating the formula for the position of the wave at that end. Unfortunately, I cannot seem to find what exactly is the problem or where I went wrong.

What is the cause of this behavior? Is the boundary condition itself incorrect or is it the approximation? What part of this task am I misunderstanding?

Please help. I have been trying to solve this for two full days already, and I am supposed to present my results to my tutor on Monday morning.

• This type of behavior can appear in numerical methods; I believe it's called Gibbs phenomenon. You either need to go to higher order Taylor series in your simulation or live with it. – Kyle Kanos Feb 19 '18 at 15:31
• The Gibbs phenomenon @KyleKanos is referring to would be the case if your initial condition had a discontinuity in it or something. You don't need to go to higher order (that can make things worse actually) -- you would need increased dissipation. That would be a lower order scheme, an upwind biased scheme, or artificial dissipation. But, I would say this looks like an error in the implementation more likely than an error in the equations or the scheme. – tpg2114 Feb 21 '18 at 13:25

$$\frac{\partial y}{\partial x} = -\frac{1}{v} \frac{\partial y}{\partial t}$$
$$\frac{y^{n+1}-y^{n}}{\Delta t} = -v \frac{y_{i-1}-y_{i-2}}{\Delta x}$$