Introduction to Optimal Control Theory and Dynamical Systems