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.

The shape of the wave with forming zigzags

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.

  • $\begingroup$ 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. $\endgroup$ – Kyle Kanos Feb 19 '18 at 15:31
  • $\begingroup$ 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. $\endgroup$ – tpg2114 Feb 21 '18 at 13:25

I have not used this with the wave equation, but I have used something similar with the Navier-Stokes equations. I think the issue is in what you consider known/unknown in your boundary condition equation.

Specifically, I would implement (using O(1) schemes for demonstration -- adapt as you need to):

$$ \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} $$

In other words, you need to compute your spatial derivative based on information inside the domain and use that to compute the temporal evolution at the boundary based on that. You need to control the temporal part, not the spatial part.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.