# 3. 15 times accelerated wave propagation model

December, 2023
In the second version of the implementation, a much more efficient way of reflecting the magnitude of bodies' deviation from the equilibrium state was found – by writing the state directly into the Canvas matrix:

let canvasData = ctx.getImageData(0, 0, wh, he); canvasData.data[index++] = “color”.

This new approach allowed for a refresh rate on the same platform of 70 frames per second for 270,000 bodies (696 x 389), displayed as 2 x 2 rectangles. That is almost a 15-fold increase. Thus, the program computationally finds the solution to the system of 270,396 second-order differential equations, performing 70 iterations for each equation per second. Experiments have shown that further performance growth is directly limited by the computation of iterations in the equations themselves.

The program has similar functionality to the first implementation, allowing for the formation of medium inhomogeneity and modeling wave processes within it. The offered tool has the ability to build inhomogeneous elastic surfaces, vividly demonstrating all major wave phenomena such as absorption, reflection, refraction, diffraction, interference (principle of superposition), polarization, and dispersion.

The application has intrinsic value both for educational purposes and for research. It should be noted that for such complex media, there are no general analytical solutions similar to the considered wave equation, and the development of processes in them can only be predicted in computational models.