Optimal periodic control of variable time-delay systems