Shop Optimal Control With Engineering Applications