was found by graphically solving $\varphi(x,T/2)=0$. This gives the initial guess $\theta/2=2.54258$. This choice of $T$ and $\theta$ (with $\eta^{B+C}$ and $\varphi^{B+C}$ as initial conditions) yields $f=2.0\times10^{-11}$ and $\tilde f=1.5\times10^{-10}$. We then minimize $f$ holding $E$ and $\theta$ constant, which gives $f=2.1\times10^{-29}$ and $\tilde f=3.0\times10^{-26}$. We note that $\tilde f$ is computed over $[0,T]$, twice the time over which the solution was optimized by minimizing $f$, and provides independent confirmation of the accuracy of the solution and the symmetry arguments of §\[sec:obj:fun\].

The results are plotted in Figure \[fig:evol:kdv3\]. We omit a plot of the initial guess (the collision of Stokes waves) as it is indistinguishable from the minimized solution. In fact, the relative change in the wave profile and velocity potential is about $0.35$ percent, $$\left(\frac{
  \|\eta_\text{Stokes} - \eta_\text{periodic}\|^2 +
  \|\varphi_\text{Stokes} - \varphi_\text{periodic}\|^2}{
  \|\eta_\text{Stokes} - h\|^2 + \|\varphi_\text{Stokes}\|^2}
  \right)^{1/2} \le 0.0035,$$ and $T/2$ changes even less, from 554.057 (Stokes) to 554.053 (periodic). By construction, $E$ and $\theta/2$ do not change at all. It was not necessary to evolve the Stokes waves to $T/2$, shift space by $\theta/2$, zero out Fourier modes that violate the symmetry condition (\[eq:init\]), and reset $t=0$ to correspond to this new initial state. Doing so 