Optimal Active Control and Optimization of a Wave Energy Converter