Optimal trajectory tracking control design