The optimal control of a flexible hull robotic undersea vehicle propelled by an oscillating foil | Synapse