Continuous Control Artificial Potential Function Methods and Optimal Control