a variational derivative with respect to perturbation of the initial conditions, not a time derivative. To compute $\partial r_i/\partial c_k$ for $i\ge2$ and $k\le n$, one simply puts a dot over each Fourier mode on the right-hand side of (\[eq:r:def\]) or (\[eq:r1:def\]), including $\hat\eta_j(0)$ and $\hat\varphi_j(0)$ in (\[eq:r1:def\]). If $k=n+1$, then $c_k=T$ and $${\frac{\partial r_{2j}}{\partial T}} = {\operatorname{Im}}\{e^{ij\theta/2}(1/2)\partial_t\hat\eta_j(T/2)\}, \qquad
  {\frac{\partial (r_{4j}+ir_{4j+1})}{\partial T}} = \sqrt{2}\big[\partial_t\hat\varphi_j(T)\big]$$ in (\[eq:r:def\]) and (\[eq:r1:def\]), respectively, with similar formulas for $\partial(r_{4j-2}+ir_{4j-1})/\partial T$ and $\partial
r_{2j+1}/\partial T$. The three possibilities for $r_1$ are handled as follows: $$\begin{aligned}
  &\text{case 1:} \quad {\frac{\partial r_1}{\partial c_k}} = \dot E
  = \frac{1}{2\pi}\int_0^{2\pi} \left[\dot\varphi\eta_t - \dot\eta\varphi_t \right]_{t=0}dx, 
  \quad (k\le n), \qquad
  {\frac{\partial r_1}{\partial c_{n+1}}} = 0, \\
  &\text{case 2:} \quad {\frac{\partial r_1}{\partial c_k}} = {{\dot\eta}^{\scriptscriptstyle\bm\wedge}}_1(0) = \delta_{k,1},
  \quad (k\le n+1),\\
  &\text{case 3:} \quad {\frac{\partial r_1}{\partial c_k}} = \dot\eta(0,0) = 2\delta_{k,\text{odd}}, \quad
  (k\le n), \qquad {\frac{\partial r_1}{\partial c_{n+1}}} = 0,\end{aligned}$$ where $\delta_{k,j}$ and $\delta_{k,\text{odd}}$ equal 1 if $k=j$ or $k$ is odd, respectively, and equal zero otherwise. The vectors $\dot q$ in (\[eq:q:qdot\]) are computed in batches, each initialized with a different initial perturbation, to consolidate the work in computing the Dirichlet-Neumann operator during each timestep. See [@water2; @trav:stand] for details.

Numerical results {#sec:num}
