An R Shiny app showing diffusion of a particle in 2D (gganimate) and 3D (RGL widget)

Below is an R Shiny app which demonstrates diffusion in both 2D and 3D. The 2D aspect is animated via gganimate and the 3D plot is interactive (zoom in and out and rotates) via an RGL widget.

The net movement of atoms, ion, molecule, and energy from a region of higher concentration to a region of lower concentration is known as Diffusion. A gradient in free energy or chemical potential is what drives Diffusion. In spinodal decomposition, it’s possible to diffuse “uphill” from a region of lower concentration to a region of higher concentration. The inherent randomness of the diffuse entity can be used to model many real-life scenarios. Statistics, probability theory, information theory, neural networks, finance, and marketing are some of the fields where the corresponding mathematical models are used.

Many fields, including physics, chemistry, biology, sociology, economics, statistics, data science, and finance, use the concept of diffusion. The idea of spreading out a substance or collection is common to all of these. The change in the value of a quantity is known as a gradient. A change in concentration over a distance is called a concentration gradient, a change in pressure over a distance is called a pressure gradient, and a change in temperature over a distance is called a temperature gradient.

The Latin word diffundere means “to spread out”.

5 thoughts on “An R Shiny app showing diffusion of a particle in 2D (gganimate) and 3D (RGL widget)”

  1. Fantastic blog! Do you have any suggestions for aspiring writers?

    I’m planning to start my own blog soon but I’m a little lost on everything.
    Would you recommend starting with a free platform like WordPress or go for
    a paid option? There are so many options out there that I’m totally overwhelmed ..
    Any recommendations? Thanks a lot!

  2. Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something.
    I think that you could do with some pics to drive the message home a little bit, but instead of
    that, this is magnificent blog. An excellent read.
    I’ll certainly be back.

Comments are closed.