Wave Diffraction and Interference Simulation


When a wave encounters an obstacle or a slit some portion of the incident wave is reflected while the remaining part is transmitted in a distorted shape. The effect is generally more prominent for waves whose wavelength is roughly comparable to the dimensions of the diffracting object.

The following 2D model simulates the classic single and double-slit experiments for acoustic waves. Sinusoidal plane waves are set to enter the domain from the bottom of the domain. By inspecting the wave propagation one can clearly see the effect of wave diffraction and interference.

The symbols and corresponding units used throughout this tutorial are summarized in the Nomenclature section.

Please refer to the information provided in "Acoustics in the Frequency Domain" for more general theoretical background for acoustics.

Load the finite element package.

Pressure Acoustics Model

The propagation of harmonic sound waves can be described by the source-free Helmholtz partial differential equation (PDE) (1):

Define the variables and select the parameters for a frequency domain acoustics model.
Air is used as the sound medium.
Define material parameters for the acoustics PDE.


First, geometric models for the single and double slit experiment are constructed. The width of each slit is set to , and the separation distance for the double slit model is defined as . A time-harmonic sound wave enters the domain from the lower boundary and leaves from the semicircle boundary . The wall boundary is represented by .

When the incident wave reaches the slit, diffraction occurs and makes each slit behaves as if it were a point monopole sound source. For the double-slit case two diffraction waves will then superimpose with each other and form an interference pattern.

Specify the parameters of the geometry.
Define the 2D domain and .

Boundary Conditions

There are three types of the boundary conditions involved in this example. On the lower boundary a radiation boundary condition is used to model the incoming sound wave.

Specify the incoming sound amplitude , and set a radiation boundary condition at the lower boundary.

On the semicircle boundary an absorbing boundary condition is specified to model the outgoing wave.

Set an absorbing boundary condition on the outer boundary.

For the remaining boundaries a default sound hard boundary condition is implicitly used.

Model Parameters Setup

Since the diffraction pattern is more prominent for a wave whose wavelength is comparable to the size of the diffracting object, a wavelength is used.

Specify the wavelength of sound and calculate the corresponding frequency .

In acoustics simulations the wavelength of a sound wave needs to be resolved by a sufficiently fine mesh in order to get an accurate numerical solution. Here we set the max edge length to 12 nodes per , which means that there will be at least twelve elements per wavelength in each direction of the wave propagation.

Set the mesh size .

Single Slit Model

First, we consider the single slit case in order to study the diffraction pattern of the sound wave. The PDE model is solved numerically with NDSolveValue using the finite element method.

Setup the PDE model for the sound pressure field.
Solve the single slit PDE model.

To visualize the sound diffraction pattern from the single slit, the solution needs to be transformed into the time domain with the harmonic wave relation (2):

More information on the relation between time domain and frequency domain can be found here.

Find the maximum pressure amplitude and set up ContourPlot options.
Visualize the sound propagation and the diffraction pattern.

See this note about improving the visual quality of the animation.

The diffraction effect is seen once the incident wave passes the slit. The wave is then deformed from a plane-wave to a circular wave that propagates toward the semicircle boundary. The slit behaves as if it were a point monopole sound source.

Double Slit Model

Next, the double slit model is solved to show the interference effect between two diffraction sound waves.

Solve the double slit PDE model.
Visualize the interference effect between the diffraction waves.

See this note about improving the visual quality of the animation.

In the double-slit case the two diffraction waves superimpose with each other and form an interference pattern. To verify the numerical result we can calculate theoretical values for the directions of the maximal and minimal amplitude [3]. Note that the constructive interference occurs when two waves are in phase. That is, the path difference between them equals to an integral number of the wavelength. On the contrary, the destructive interference occurs when the path difference is an odd multiple of half of the wavelength.

The path difference between two waves travelling at an angle is:

The maximal and minimal sound amplitude occurs when

or equivalently

Calculate the angles of maximal and minimal amplitude.
Set up a reference line where the traveling angle .
Inspect the directions of maximal (red line) and minimal (blue line) amplitude.

The theoretical prediction matches the result from NDSolve.

To inspect the sound difference within the domain, the sound pressure values are extracted from an arbitrary trajectory (green line) which passes through the amplitude extrema. An audio file is then generated and captures a sound as if we traverse along this trajectory within the domain.

Define a function to extract the sound pressure values from the given trajectory (green line).
Generate an audio along the trajectory with a duration of .

Note that the sound varies with time as we traverse along the trajectory, and the change in volume corresponds to the sound diffraction pattern within the domain.


ρdensity of a medium[kg/m3]
cspeed of sound in a medium[m/s]
psound pressure[Pa]
ωsound wave angular frequency[rad/s]
fsound wave frequency[Hz]
λsound wavelength[m]
Xposition vector[m]
Llength of the plane wave domain[m]
wswidth of the slit[m]
wdepth of the slit[m]
Rradius of the outer boundary[m]
dslit seperation[m]
narbitrary intergerN/A
θwave traveling angle[rad]
Γininlet boundaryN/A
Γoutouter boundaryN/A
Ωcomputational domainN/A


1.  Fahy, Frank. Foundations of Engineering Acoustics. Academic Press, 2001.

2.  Norton, Andrew. Dynamic fields and waves of physics. CRC Press, 2000.