Abstract— In this paper we consider the problem of optimizing over the switching times for a multi-modal dynamic system when the complete cost-to-go is not available. The instantaneous cost is assumed to be unavailable before run-time, but can be measured in real time. Since the cost-to-go for optimization is time-varying, this problem falls under the category of online optimization of switched systems. The goal of the paper is to present an iterative process to update the switching times for the system in such a way that they remain optimal with respect to the changing cost-to-go function. It is shown that the information required to update the switching times is the ‘rate of change’ of the instantaneous cost, which is in the form of the partial derivative of the instantaneous cost function.