Changing the beam direction in a phased array
Channel: Nils Berglund
Date: 03/03/2023

This simulation of a phased array uses a similar set-up as in the video https://youtu.be/yS_0OVuigVE , but now the phase shift between the emitters changes in discrete steps, to show how this affects the direction of the emitted beams. 
Phased arrays are computer-controlled antennas, whose phase is altered in such a way that the emitted signal propagates only in certain directions, without moving the antennas. The array in this simulation consists of 13 equally spaced sources, which emit pulses at regular time intervals. The phase shift between neighboring sources changes about every 11 seconds in the simulation. It starts with 1/4 period, then moves to 1/3, 1/2, followed by -1/2, -1/3 and -1/4, meaning that the order in which the sources emit is reversed. The phase shift then increases again, cycling all the way back to 1/4 period. 
The video has two parts, showing the same simulation with two different color schemes:
Wave height: 0:00
Intensity of energy flux: 2:01
In the first part, the color hue shows the wave height. In the second part, it shows the intensity of the energy flux, slightly averaged over time. There are absorbing boundary conditions on the outer boundaries of the simulation. 

Render time: 53 minutes 47 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: "Delta Wave" by Asher Fulero@AsherFulero

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 Marco Mancini and Julian Kauth for helping me to accelerate my code!