Optimization and Control of Dynamic Systems