two modes []{data-label="fig:reldisp"}](Fig1.eps){width="7.5cm" height="7.2cm"}

Computation of the control term for a two wave system {#loc:computation}
-----------------------------------------------------

We consider Hamiltonian (\[Ham1\]) with two waves, where the wavenumbers are chosen according to a dispersion relation $k_1=K(\omega_1)$ and $k_2=K(\omega_2)$ plotted on Fig. \[fig:reldisp\].

In order to compute $f$, Hamiltonian (\[Ham1\]) with 1.5 degrees of freedom is mapped into an autonomous Hamiltonian with two degrees of freedom by considering that $t \mbox{ mod }2\pi$ is an additional angle variable. We denote $E$ its conjugate action. The autonomous Hamiltonian is $$\begin{aligned}
\label{Htwt_autonoma}
H(E,p,x,t)&=&E+\frac{p^2}{2}+\varepsilon_1\cos (k_1x-\omega_1
t+\varphi_1)\nonumber
\\[0.5\baselineskip]
&&+\varepsilon_2\cos (k_2 x-\omega_2 t+\varphi_2).\end{aligned}$$ Then, the momentum $p$ is shifted by $\omega$ in order to define a local control in the region $p\approx 0$. The Hamiltonian is rewritten as

$$\begin{aligned}
H&=&E+\omega p+\varepsilon_1 \cos (k_1 x-\omega_1
t+\varphi_1)\nonumber \nonumber
    \\[0.5\baselineskip]
    &&+\varepsilon_2\cos (k_2 x-\omega_2
t+\varphi_2)+\frac{p^2}{2}. \label{Htwt_pshift}\end{aligned}$$

We rewrite Hamiltonian (\[Htwt\_pshift\]) into the form (\[eqn:e4V\])  where: $$\begin{aligned}
&& \varepsilon v(x,t)=\varepsilon_1\cos (k_1 x-\omega_1
t+\varphi_1)+\varepsilon_2\cos (k_2 x-\omega_2 t+\varphi_2),\\
&& w(x,t)=0,\\
&& Q(p,x,t)=p^2/2.\end{aligned}$$ The frequency vector of the selected invariant torus is ${\bm\omega}=(\omega,1)$. From Eq. (\[eqn:exf\]) we have that $f$ is given by $$f(x,t)=-\frac{\varepsilon^2}{2} (\Gamma \partial_{x} v) ^2,$$ which is $$\begin{aligned}
    &f(x,t)= &-\frac{1}{2}\big[ \frac{\varepsilon_1 k_1}{\omega
k_1-\omega_1}\cos (k_1x-\omega_1t+\varphi_1)\nonumber\\
& &+\frac{\varepsilon_2 k_2}{\omega
k_2-\omega_2}\cos(k_2x-\omega_2t+\varphi_2)\big]^2,
    \label{eqn:fTWT}\end{aligned}$$ provided $\omega\neq\omega_1/k_1$ and $\omega\neq\omega_2/k_2$. 