Аңдатпа
The aim of this study has been to conduct a comparative analysis of the deterministic finite difference method and a stochastic approach based on differential equations for modelling one-dimensional diffusion. The explicit finite-difference scheme FTCS and the Euler–Maruyama method for the numerical solution of stochastic differential equations were employed in the study. A comparison of the concentration profiles obtained using both approaches on a grid with the same resolution was carried out. The results show that the stochastic method yields macroscopic profiles close to the reference solution, although these are accompanied by statistical noise, the magnitude of which decreases as the number of particles increases. It was found that limiting the maximum number of particles per cell to 10 already ensures acceptable accuracy whilst significantly saving computational resources. It was concluded that the choice between the methods should be determined by the required smoothness of the solution and the acceptable computational cost: the deterministic method is preferable for problems with smooth fields, whilst the stochastic method is preferable when modelling turbulent processes and complex boundaries.