Practical optimal control of a wave-energy converter in regular wave environments