Sketch of different timings in the online implementation of optimal control. First row: sensory stimulus for all times. Second and third rows: show the predicted and emitted spike trains for all times. Fifth row: actually injected stimulus for all times. Dashed (solid) vertical line crossing the first to fifth rows shows the real time before the first optimization has started (ended). At the start of the first optimization, i.e., at t = t0, the putative spike train response is predicted up to t0 + τrp (show in second row). Also, the feedback observation mechanism has updated the past spike times to set them to those of the actually emitted spikes before t − τro (shown in the third row). In the first optimization step, the optimization algorithm is carried out with this data for the interval I1. Fourth row: this interval and the obtained optimal solution x1(t) on it. When the algorithm finishes, we reach the vertical line (in the first to fifth rows), at which point we inject the obtained solution. The actually injected part of this solution is shown as the gray part of the curve in the fifth panel. At the same time, we start the second optimization process, with updated data, for the interval I2 (bottom). By the time the second optimal solution, x2(t) is ready, we stop injecting the first solution x1(t) (therefore the gray part of the curve in the fifth row does not include the whole solution shown in the fourth row), and use x2(t) instead (sixth row).