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.(adsbygoogle = window.adsbygoogle || []).push({});

I start with the wave equation, and then discretize it, to arrive at the following,

U{n+1}(j)=a*(U{n}(j+1)-2*U{n}(j)+U{n}(j-1))+2*U{n}(j)-U{n-1}(j) (for (j=1...end-1))

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:

U{n}(end+1)=U{n}(end-1)

and leads to:

U{n+1}(end)=a*(-2*U{n}(end)+2*U{n}(end-1))+2*U{n}(end)-U{n-1}(end);

Unfortunately this condition creates a partial reflection from the end which is supposed to be free.

Please help

Regards

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# 1D wave equation open boundary

**Physics Forums | Science Articles, Homework Help, Discussion**