Method for controlling a wave-energy-converter system that converts the energy of sea swell into electrical or hydraulic energy, said wave-energy-converter system comprising at least one movable means linked to a power take-off, and said movable means making an oscillatory movement with respect to said power take-off, characterized in that the following steps are carried out: a) the position and/or speed and/or acceleration of said movable means are/is measured; b) the force exerted by the swell on said movable means is estimated by means of said measurement of said position and/or said speed of said movable means; c) at least one dominant frequency of the force exerted by said swell on said movable means is determined, preferably by means of an unscented Kalman filter; d) a control value is determined for said force exerted by said power take-off on said movable means in order to maximize the power generated by said power take-off by implementing the following steps: i) for said at least one determined dominant frequency, the intrinsic resistance and reactance of said movable means and the uncertainty intervals of the intrinsic resistance and reactance of said power take-off are determined; ii) at least one coefficient of a variable-gain control law having a proportional component is determined by means of solution of a problem of semidefinite-positive optimization of said maximization of said power generated by said power take-off, said semidefinite-positive optimization problem taking into account said intrinsic resistances and reactance of said movable means and said uncertainty intervals of the intrinsic resistance and reactance of said power take-off, said variable-gain control law relating said position and/or said speed and/or said acceleration of the movable means to the force exerted by said power take-off on said movable means; and e) said power take-off is controlled by means of said control value. a) the position and/or speed and/or acceleration of said movable means are/is measured; b) the force exerted by the swell on said movable means is estimated by means of said measurement of said position and/or said speed of said movable means; c) at least one dominant frequency of the force exerted by said swell on said movable means is determined, preferably by means of an unscented Kalman filter; d) a control value is determined for said force exerted by said power take-off on said movable means in order to maximize the power generated by said power take-off by implementing the following steps: i) for said at least one determined dominant frequency, the intrinsic resistance and reactance of said movable means and the uncertainty intervals of the intrinsic resistance and reactance of said power take-off are determined; ii) at least one coefficient of a variable-gain control law having a proportional component is determined by means of solution of a problem of semidefinite-positive optimization of said maximization of said power generated by said power take-off, said semidefinite-positive optimization problem taking into account said intrinsic resistances and reactance of said movable means and said uncertainty intervals of the intrinsic resistance and reactance of said power take-off, said variable-gain control law relating said position and/or said speed and/or said acceleration of the movable means to the force exerted by said power take-off on said movable means; and i) for said at least one determined dominant frequency, the intrinsic resistance and reactance of said movable means and the uncertainty intervals of the intrinsic resistance and reactance of said power take-off are determined; ii) at least one coefficient of a variable-gain control law having a proportional component is determined by means of solution of a problem of semidefinite-positive optimization of said maximization of said power generated by said power take-off, said semidefinite-positive optimization problem taking into account said intrinsic resistances and reactance of said movable means and said uncertainty intervals of the intrinsic resistance and reactance of said power take-off, said variable-gain control law relating said position and/or said speed and/or said acceleration of the movable means to the force exerted by said power take-off on said movable means; and e) said power take-off is controlled by means of said control value.