that $f$ measures deviation from evenness and oddness of $\eta(x+\theta/2,T/2)$ and $\varphi(x+\theta/2,T/2)$, respectively, while $\tilde f$ measures deviation of $\eta(x+\theta,T)$ and $\varphi(x+\theta,T)$ from their initial states. In the first example of §\[sec:num\], we minimize $\tilde f$ directly, while in the second we minimize $f$ and check that $\tilde f$ is also small, as a means of validation. The number of equations, $m=M+1$ for $f$ and $m=2M+1$ for $\tilde f$, is generally larger than the number of unknowns, $n+1$, due to zero-padding of the initial conditions. This adds robustness to the shooting method and causes all Fourier modes varied by the algorithm, namely those in (\[eq:init:trav\]), to be well-resolved on the mesh.

Computation of the Jacobian
---------------------------

To compute the $k$th column of the Jacobian $J=\nabla_c r$, which is needed by the Levenberg-Marquardt method, we solve the linearized equations along with the nonlinear ones: $$\label{eq:q:qdot}
  {\frac{\partial }{\partial t}}
  \begin{pmatrix} q \\ \dot q \end{pmatrix} =
  \begin{pmatrix} F(q) \\ DF(q)\dot q \end{pmatrix}, \quad
  \begin{aligned}
    q(0) &= q_0 = (\eta_0,\varphi_0), \\
    \dot q(0) &= \dot q_0 = \partial q_0/\partial c_k.
  \end{aligned}$$ Here $q=(\eta,\varphi)$, $\dot q=(\dot\eta,\dot\varphi)$, $F(q)$ is given in (\[eq:ww\]), $DF$ is its derivative (see [@water2] for explicit formulas), and a dot represents 