Constrained Optimal Control of a Heaving Buoy Wave-Energy Converter