I'm trying to find a general approach to trace the temporal evolution of horizontal distances from maximum to maximum in a solution of EDP. The solution `u[x,t]`

normally have several maximum and minimum in the space `x`

who are moving in space `x`

and evolve over time `t`

.

Here is a simple example in which the maxima and the minima are periodic. But in my real problem, they are not periodic and the distances between different pairs of adjacent max are different at one time. `t`

, the distances between two adjacent max may also change `t`

.

```
sol = NDSolve[{D[u[x, t], t] + u[x, t] D[u[x, t], x] + D[u[x, t], x, x] +
0.4*D[u[x, t], {x, 3}] + D[u[x, t], {x, 4}] == 0,
u[-4 [Pi], t] == u[4 [Pi], t], u[x, 0] == 0.1*Sin[x]}, u, {t, 0, 20},
{x, -4 [Pi], 4 [Pi]}]
Plot3D[Evaluate[u[x, t] /. First[sol]], {t, 0, 10}, {x, -4 Pi, 4 Pi}, PlotRange -> All, PlotPoints -> 100]
```

I tried to use `Table[FindMaximum[Evaluate[u[x, t] /. First[sol]], {x, x0}][[2, 1, 2]], {t,0,tend,0.01}]`

with an initial position `x0`

to find a local maximum. But I do not know how to simultaneously find two adjacent maxima to trace the temporal evolution of their distance.