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:09<?, ?it/s]
  0%|          | 0.004/10.0 [00:09<6:36:46, 2381.58s/it]
  0%|          | 0.019/10.0 [00:09<1:23:24, 501.42s/it]
  7%|▋         | 0.68/10.0 [00:09<02:10, 14.03s/it]
 63%|██████▎   | 6.315/10.0 [00:09<00:05,  1.53s/it]
 63%|██████▎   | 6.315/10.0 [00:09<00:05,  1.54s/it]
100%|██████████| 10.0/10.0 [00:09<00:00,  1.03it/s]
100%|██████████| 10.0/10.0 [00:09<00:00,  1.03it/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 9.890 seconds)