  A generic formulation for the optimal control of a single wave-energy
converter (WEC) is proposed. The formulation involves hard and soft constraints
on the motion of the WEC to promote reduced damage and fatigue to the device
during operation. Most of the WEC control literature ignores the cost of the
control and could therefore result in generating less power than expected, or
even negative power. Therefore, to ensure actual power gains in practice, we
incorporate a penalty term in the objective function to approximate the cost of
applying the control force. A discretization of the resulting optimal control
problem is a quadratic optimization problem that can be solved efficiently
using state-of-the-art solvers. Using hydrodynamic coefficients estimated by
simulations made in WEC-Sim, numerical illustrations are provided of the
trade-off between careful operation of the device and power generated. Finally,
a demonstration of the real-time use of the approach is provided.
