Energy conservation for the nonlinear Schrödinger equation (source code)

= Energy conservation for the nonlinear Schrödinger equation
{c}

For the focusing power equation $iu_t+\Delta u+|u|^{p-1}u=0$, the conserved energy is
$$
E(u)=\frac12\int|\nabla u|^2-
\frac1{p+1}\int|u|^{p+1}.
$$