Very rarely is a system of PDEs able to be computed analytically. Instead, one must resort to a numerical approximation. There are various methods for numerically approximating systems of PDEs, but for this project I used Euler's method to keep things simple. Despite how simple this method is, it produces surprisingly robust results. In addition, it is trivial to parallelize: I implemented a compute shader to carry out the calculations, which means it runs entirely on the GPU. Even on a relatively old GPU, it is capable of carrying out calculations on a full-screen grid in real-time.
I went a little overboard on this project, because I thoroughly believe this is the best way to truly learn about things. I implemented numerous reaction-diffusion models, each with its own set of user-specifiable parameters. I also implemented custom palette support. Both the models and palettes are implemented in a modular, extensible way so that new models and palettes can be added without having to rebuild the program. I also briefly experimented with R3 reaction-diffusion models, as can be seen in one of the videos below. Like most of my programs, I implemented support for 3Dconnexion's SpaceNavigator mouse, which allows interactive translation and rotation on all 3 spatial axes.
The user can perturb the grid by drawing on it, and also change color palettes during the visualization:
One of the shader modes applies vertex displacement to a mesh in R3 based on the chemical values:
Visualizing R3 reaction-diffusion models:
I implemented support for real-time sampling of chemical values; they move around with the grid even as the user rotates it:
Another example of the R3 mesh view:
The user can adjust model parameters in real-time:
Another demonstration of the sampling boxes:
Perturbing the RD grid with a real-time musical waveform: