2.5. Simple diffusion equation

This example solves a simple diffusion equation in two dimensions.

simple
  0%|          | 0/10.0 [00:00<?, ?it/s]
Initializing:   0%|          | 0/10.0 [00:00<?, ?it/s]
  0%|          | 0/10.0 [00:07<?, ?it/s]
  0%|          | 0.00369/10.0 [00:07<5:32:10, 1993.79s/it]
  1%|          | 0.07347/10.0 [00:07<16:35, 100.24s/it]
  9%|8         | 0.86378/10.0 [00:07<01:17,  8.53s/it]
  9%|8         | 0.86378/10.0 [00:07<01:18,  8.55s/it]
100%|##########| 10.0/10.0 [00:07<00:00,  1.35it/s]
100%|##########| 10.0/10.0 [00:07<00:00,  1.35it/s]

from pde import DiffusionPDE, ScalarField, UnitGrid

grid = UnitGrid([64, 64])  # generate grid
state = ScalarField.random_uniform(grid, 0.2, 0.3)  # generate initial condition

eq = DiffusionPDE(diffusivity=0.1)  # define the pde
result = eq.solve(state, t_range=10)
result.plot()

Total running time of the script: ( 0 minutes 7.608 seconds)