Optimization and Optimal Control in Automotive Systems