Waves in a quadratic resonance diffuser, rendered in 3D
Channel: Nils Berglund
Date: 12/06/2022

This 3D variant of the video https://youtu.be/FP1jknz5C4w shows the working of a particular type of noise reflecting panel known as 'Quadratic resonance diffuser", or QRD. Such a panel consists of rectangular wells of different depths. Given a prime number p, equal to 13 in this particular example, the depth of the nth well if proportional to n^2 (mod p). The basic idea is that such a design produces phase shifts between reflected waves that have no large common divisor, increasing the dispersion effect. Examples of such panels can be found, for instance, on the page https://www.subwoofer-builder.com/qrd.htm
The simulation has two parts, showing the same wave with two different representations:
Wave height: 0:00
Average energy: 1:28
In the first part, both the z-coordinate and the color hue show the wave height. It the second part, they show the energy averaged from the beginning of the simulation up to the current time. There are reflecting boundary conditions on the diffusers, and absorbing boundary conditions on the left and right ends of the room. 

Render time: 1 hour 11 minutes
Color scheme: Part 1 - Turbo, by Anton Mikhailov
https://gist.github.com/mikhailov-work/6a308c20e494d9e0ccc29036b28faa7a
Part 2 -   Plasma by Nathaniel J. Smith and Stefan van der Walt
https://github.com/BIDS/colormap

Music: "Stairway" by Patrick Patrikios@patrikiospatrick

See also https://images.math.cnrs.fr/Des-ondes-dans-mon-billard-partie-I.html for more explanations (in French) on  a few previous simulations of wave equations. 

The simulation solves the wave equation by discretization. The algorithm is adapted from the paper https://hplgit.github.io/fdm-book/doc/pub/wave/pdf/wave-4print.pdf 
C code: https://github.com/nilsberglund-orleans/YouTube-simulations
https://www.idpoisson.fr/berglund/software.html
Many thanks to my colleague Marco Mancini for helping me to accelerate my code!