There is some flickering in the first part of this video, which is why I put an epilepsy warning.
In this variant of the simulation • Bragg diffraction on a denser lattice of Bragg diffraction, the system has been scaled down by a factor 2, in order to get closer to the far field, where the interference patterns should be more clear. In addition, as suggested in comments, a plot of a horizontal slice through the wave height or energy has been added at the top. It shows a graph of the values of the field along a horizontal line in the middle of the rectangular box.
Bragg diffraction (see for instance https://en.wikipedia.org/wiki/Bragg%2... ) occurs when a wave encounters a regular lattice, for instance a crystalline solid. Depending on the wave length, the angle of incidence of the wave, and the geometry of the lattice, interference of the reflected waves can create various patterns, that sometimes allow to deduce properties of the lattice.
The video has two parts, showing the same simulation with two different color schemes:
Wave height: 0:00
Average energy (log scale): 2:09
In the first part, the color hue shows the wave height. In the second part, it shows the energy, averaged from the beginning of the simulation, on a logarithmic scale. There are oscillating boundary conditions on the left side of the simulation, and absorbing boundary conditions on the other sides.
Render time: 48 minutes 52 seconds
Color scheme: Part 1 - Twilight by Bastian Bechtold
https://github.com/bastibe/twilight
Part 2 - Magma by Nathaniel J. Smith and Stefan van der Walt
https://github.com/BIDS/colormap
Music: "A Rising Wave" by Jeremy Blake@RedMeansRecording
See also https://images.math.cnrs.fr/Des-ondes... 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...
C code: https://github.com/nilsberglund-orlea...
https://www.idpoisson.fr/berglund/sof...
Many thanks to Marco Mancini and Julian Kauth for helping me to accelerate my code!
#wave_equation #waves #diffraction #Bragg_diffraction