Mathematical and Software Formation Process of Simulations on a Graphical Processing Unit
Authors:   Uzhhorod National University, Kalynych Yulianna , Bilak Yuriy ,   Uzhhorod National University, Nebesnyi Ruslan ,   Ivan Pulyuy Ternopil National Technical University, Fedorka Pavlo ,   Ivan Pulyuy Ternopil National Technical University
Published: June 2022

The paper investigates the value of simulations for research activities and identifies the main reasons for the feasibility of conducting experiments in the virtual space. The work includes two-dimensional and three-dimensional simulations built using Unity Engine. The technology of simulation in two-dimensional space was used for the simulation of Gray – Scott’s reaction-diffusion model. The considered model involves the exploration of the system in which the diffusion reaction of two substances takes place. The resulting software based on this model allows simulating the diffusion pattern in real time or speed up the flow of time in the simulation. The software product allows configuring the basic parameters of the reaction, which gives an opportunity to build simulations of any given substances or systems. It displays the result of the simulation in several modes, which allows user to evaluate different aspects of the studied reaction at any time, e.g. view the concentration of substances, the value of the change in concentration per time unit at each point in the reaction plane. For the implementation of a simulation of Gray – Scott’s reaction-diffusion model, the possibility to apply the optimization method to it by transferring calculations to the graphics core was investigated. Research has shown numerous advantages of the parallelization of calculations by the means of performing them on many threads of the graphics adapter. During the parallelization process for each pixel of the input image, which shows the initial substances application pattern on the plane, a separate stream is allocated, which calculates the values of concentration and changes in concentration at the material point of the reaction plane. From the stated above it can be concluded that the number of running computing streams is equal to the number of pixels in the image. Therefore the simulated visualization of diffusion helps to better understand real world processes, such as chemical reactions in the synthesis of hematopoiesis, fermentation. The perspectives of simulation in three-dimensional space were analyzed at the basis of the behavior of living flocks of the same type. A host of simple processes, such as avoiding collisions of elements with each other inside their groups, maintaining a common direction of movement, and bypassing obstacles along the way were implemented. The resulting flock behavior is not governed by one module of behavior of the whole flock, but is formed by the behavior of each individual entity within the flock. Therefore, the behavior of the simulated flock reflects the real behavior of flocks in nature. The described simulation was also investigated for the possibility of optimizing processes using calculations on the graphics core. Each element of the flock has a separate independent module that requires the awareness of all other entities in the flock to determine the impact on its own decisions about the movement and orientation Therefore, the graphical core allocates a separate stream for each flock entity.