Introduction to optimal control