Optimal control of the magnetohydrodynamic ocean wave energy converter: theory