function to compute the propagation speed (Jacobian)
function wavespeed(n,u,ps)
for i = 3:n-2
ps[i] = max(abs(u[i-2]), abs(u[i-1]), abs(u[i]), abs(u[i+1]), abs(u[i+2]))
end
```

```