Wave protection comparison 6: randomized square grid vs Sierpinski carpet
Channel: Nils Berglund
Date: 2021-08-17

This is the sixth simulation in our series of comparisons between different types of protections against waves. This one compares two of the most efficient designs we have seen so far: the randomized square grid, and the Sierpinski carpet. The area covered by obstacles should be about the same in the two panels, close 37.57%. I would say we have a tie here: the amounts of reflected and stored energy are very close, while the difference in energy transmission would have been smaller for a narrower channel at the bottom of the Sierpinski carpet.
The colors indicate the energy of the wave: blue means low energy, red means high energy. The numbers in the four corners and at the top and bottom show the total energy in areas at the left and at the right of the obstacles, as well as in the area occupied by obstacles, compared to the energy of the incoming wave. The total energy is sometimes slightly larger than 1 due to round-off errors. 
There are periodic boundary conditions on the top and bottom sides of the displayed domain, and absorbing boundary conditions on the sides, which however don't work perfectly, which is why you see some waves reflected from the boundary. 

Music: "Enable the Tiger" by JAde Wii @JAdeWii_

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!