# 2.19. Kuramoto-Sivashinsky - Using custom class

This example implements a scalar PDE using a custom class. 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$
  0%|          | 0/10.0 [00:00<?, ?it/s]
Initializing:   0%|          | 0/10.0 [00:00<?, ?it/s]
0%|          | 0/10.0 [00:00<?, ?it/s]
2%|2         | 0.24/10.0 [00:00<00:16,  1.72s/it]
6%|6         | 0.61/10.0 [00:00<00:07,  1.31it/s]
22%|##2       | 2.23/10.0 [00:00<00:02,  3.20it/s]
56%|#####5    | 5.57/10.0 [00:01<00:00,  4.73it/s]
56%|#####5    | 5.57/10.0 [00:01<00:01,  3.08it/s]
100%|##########| 10.0/10.0 [00:01<00:00,  5.53it/s]
100%|##########| 10.0/10.0 [00:01<00:00,  5.53it/s]


from pde import PDEBase, ScalarField, UnitGrid

class KuramotoSivashinskyPDE(PDEBase):
"""Implementation of the normalized Kuramoto–Sivashinsky equation"""

def evolution_rate(self, state, t=0):
"""implement the python version of the evolution equation"""
state_lap = state.laplace(bc="auto_periodic_neumann")
state_lap2 = state_lap.laplace(bc="auto_periodic_neumann")