Mathematical and Software Formation Process of Simulations on a Graphical Processing Unit

: pp. 110 - 126
Uzhhorod National University
Uzhhorod National University
Temopil Ivan Puluj National Technical University
Uzhhorod National University

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.

  1. Lammers, K. (2013). Unity Shaders and Effects Cookbook. Packt Publishing. 268 p.
  2. Doppioslash, C. (2017). Physically Based Shader Development for Unity 2017: Develop Custom Lighting Systems. Apress. 255 .
  3. Marschner, S., Shirle, P. (2021). Fundamentals of Computer Graphics. V. CRC Press. 716
  4. Hunz, J. (2013). The Possibilities of Compute Shaders - an Analysis. Universitat Koblenz. 60
  5. Cosmin-Constantin, M., Ciprian L. (2021). Using Graphics Processing Units and Compute Shaders in Real Time Multimodel Adaptive Robust Control, Electronics, 10, 24-62.
  6. Erban, R., Chapman, J. (2020). Stochastic Modelling of Reaction-Diffusion Processes. Cambridge University Press.
  7. Gray P., S.K. Scott. (1983). Autocatalytic reactions in the isothermal, continuous stirred tank reactor: Isolas and other forms of multistability. Chemical Engineering Science, 38, 29-43.
  8. Evans, L. (1998). Partial Differential Equations: Second Edition. American Mathematical Society. 749 p.
  9. Newell, Alan C.; Whitehead, J. A. (1969). Finite bandwidth, finite amplitude convection. Journal of Fluid Mechanics. Cambridge University Press (CUP), 38, 279-303.
  10. J Ross, A. Arkin, S. C. Mueller. (1995). Experimental evidence of Turing structures. J. Phys. Chem., 99, 10417-10419.
  11. Reynolds. C. W. (1982). Computer Animation with Scripts and Actors, Computer Graphics, 16 (3), (acm SIGGRAPH '82 Proceedings), 289-296.
  12. Reynolds, C.W. (1987). Flocks, herds and schools: A distributed behavioral model. SIGGRAPH '87: Proceedings of the 14th Annual Conference on Computer Graphics and Interactive Techniques. Association for Computing Machinery, 25-34.
  13. Stephens, R. (2019). Essential Algorithms: A Practical Approach to Computer Algorithms Using Python and C#, John Wiley & Sons, 800
  14. Gille, W. (2020). Particle and Particle Systems Characterization. Small-Angle Scattering (SAS) Applications. CRC Press. 348 p.
  15. Reeves, W. (1983) Particle Systems-A Technique for Modeling a Class of Fuzzy Objects, ACM Transactions on Graphics, 2, 91-108.
  16. Shaw, E. (1979) Fish in Schools, Natural History, 84 (8), 4046.
  17. Abelson, H., Sessa, A. (1981). Maneuvering a Three Dimensional Turtle in Turtle Geometry: The Computer as a Medium for Exploring Mathematics, The MIT Press, Cambridge, Massachusetts, 140-159.
  18. Madarshahian, R., Hemez, F. (2021). Data Science in Engineering, IX, Springer Nature.
  19. Hewitt, C., Atkinson. R. (1977). Parallelism and Synchronization in Actor Systems, acm Symposium on Principles of Programming Languages, 4, Los Angeles, California. 267-280
  20. Yuen, D., Wang, L., Chi X., Johnsson, L., Ge, W., Shi, Y. (2013). GPU Solutions to Multi-scale Problems in Science and Engineering, Springer Science & Business Media. doi:10.1007/978-3-642-16405-7_2

Uncaught exception thrown in session handler.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'uid': INSERT INTO {sessions} (sid, ssid, uid, cache, hostname, session, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => 1T_VNCWADIqwtINtDQ-FCdyfpV0T46H5VxxGFCLjWa8 [:db_insert_placeholder_1] => 1T_VNCWADIqwtINtDQ-FCdyfpV0T46H5VxxGFCLjWa8 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => nodeviewcount_views_limit|a:1:{i:28150;O:8:"DateTime":3:{s:4:"date";s:26:"2023-03-27 17:39:32.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"Europe/Helsinki";}} [:db_insert_placeholder_6] => 1679927972 ) in _drupal_session_write() (line 209 of /home/science/public_html/includes/