An application of optimal control theory to the guided torpedo problem