optimal control of systems with delays