Skip to content

Diffusion

Nawaf Abdullah edited this page Feb 16, 2019 · 2 revisions

The class Substance, contained in the script diffusion.py, is used to simulate the random diffusion of a substance in 2d, and 3d.

3D plotting is currently not supported.

Usage Example 2D

# Plot after adding the material without diffusing
sub1 = Substance(100)
sub1.add_mass_3d(25)
sub1.diffuse_2d(0)
sub1.plot()

# Plot after diffusing
sub1 = Substance(100)
sub1.add_mass_3d(25)
sub1.diffuse_2d(50)
sub1.plot()

Clone this wiki locally