I am trying to write a solver for a 1D wave equation in MATLAB, and I have run into interesting problem that I just can't find a way out of.
I start with the wave equation, and then discretize it, to arrive at the following,
I'm trying to simulate an open end string (perturbate it in the middle for example, and I want the wave to dissapear on the border)
Usually it is done (correct me if I'm wrong) with applying zero gradient boundary condition, which in my case is:
and leads to:
Unfortunately this condition creates a partial reflection from the end which is supposed to be free.