# How do I simulate an open end?

When simulating a partial differential equation describing a physical phenomenon like vibrations on a string, fluid flow in a chamber or quantum wave functions, the most straight-forward way is to divide your space into small regions / cells, set up the relevant values at each cell according to the initial condition, and simulate one time step at a time using your favourite partial differential equation algorithm, making sure the boundary conditions are upheld at all times.

For the simplest example, say we have vibrations in a tight, uniform string. If the vibrations are small enough, we can assume that each part of the string is only moving up and down. Each cell is then a miniscule part of the string, and to each cell belongs a position and velocity. The model is that each cell wants to be directly in-between the two cells on either side, and it feels an accelration proportional to how far from that position it is.

If both ends of the string are fastened, then the boundary condition is simple; the first and last cells are special and do not feel any accelration. However, say I just want to study what happens near a single end as, say, a wave hits it and reflects back. Then it's not so simple to see how to treat the opposite end. I can't just let it hang free (saying it wants to be level with the cell before), because that would cause reflections to come back. This simulation shows more or less what I'm talking about ("Loose end" vs. "No end"). How is that done?

Similarily, say I want to simulate air flow over an airfoil (say using a two-dimensional Navier-Stokes model). Uniform wind comes in on one end of my simulated chamber, and that's simple enough, conceptually. But how do I treat the end where the wind leaves the chamber in a correct way? or the top and bottom? I assume it goes more or less along the same lines, at least intuitively, as the string. If not, the string is the main part of my question.

The problem you describe, how to prescribe non-reflecting or absorbing boundary conditions when solving partial differential equations (PDE) has been extensively studied. For complex (e.g. nonlinear) systems of PDE and general boundaries, it can be quite challenging and is something of an ongoing research problem. You can find many references on the topic, for example Huan and Thompson.

But for dynamics of a one-dimensional string, there is a simple solution. As you may already know, this problem is described by the one-dimensional wave equation

$$\frac{\partial^2 u}{\partial x^2} = \frac{1}{c^2} \frac{\partial^2 u}{\partial t^2}$$

where $c^2=T/\rho$, $T$ is the tension in the string, and $\rho$ is the density per unit length.

At the right end of the string, to make the wave not reflect back, it is necessary to impose the following boundary condition

$$\frac{\partial u}{\partial x} = -\frac{1}{c}\frac{\partial u}{\partial t}$$

To see how this condition is derived, you can take a look at page 28 in this set of class notes Everstine which also show how to prescribe this condition in a finite difference implementation.

• So in the vibrations on a string case it's easy, but in general this is indeed hard. Thank you. – Arthur Feb 19 '17 at 7:35