2.2.4 Kuramoto-Sivashinsky - Using PDE class

This example implements a scalar PDE using the PDE. We here consider the Kuramoto–Sivashinsky equation, which for instance describes the dynamics of flame fronts:

\[\partial_t u = -\frac12 |\nabla u|^2 - \nabla^2 u - \nabla^4 u\]
pde custom expression
  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.01/10.0 [00:16<4:30:46, 1626.32s/it]
  0%|          | 0.02/10.0 [00:16<2:15:15, 813.18s/it]
  2%|▏         | 0.15/10.0 [00:16<17:47, 108.43s/it]
 83%|████████▎ | 8.34/10.0 [00:16<00:03,  1.95s/it]
 83%|████████▎ | 8.34/10.0 [00:16<00:03,  1.95s/it]
100%|██████████| 10.0/10.0 [00:16<00:00,  1.63s/it]
100%|██████████| 10.0/10.0 [00:16<00:00,  1.63s/it]

from pde import PDE, ScalarField, UnitGrid

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

eq = PDE({"u": "-gradient_squared(u) / 2 - laplace(u + laplace(u))"})  # define the pde
result = eq.solve(state, t_range=10, dt=0.01)
result.plot()

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