Closed versus open-loop. (A) Spectrogram showing a full experiment for an individual larva: 100 repetitions (from top to bottom) of 10 s each (from left to right). The color code shows the instantaneous tail beat frequency (tbf) as was shown in Figure 1F for one rep. In every 10 repetitions, the first five are in closed-loop and the second five are in open-loop, as shown in (K). (B) The same data as (A), but rearranged so that reps with the identical gains are collected in blocks: the top 50 reps correspond to gain 1 and the bottom 50 reps to gain 0. The axes for (C–J) are the same. The x-axis is trial number, which is the repetition number (modulo 10): trials 1–5 correspond to gain 1 and 6–10 correspond to gain 0 (explicitly: trial 1 is the mean of reps 1, 11, 21, 31… 91, trial 2 is the mean of reps 2, 12, 22… 92, etc.). The x-axis in these panels is therefore cyclic: after trial 10 (which corresponds to the average of reps 10, 20, etc.) comes trial 1 (which corresponds to the average of reps 11, 21, etc.). The gain changes from 1 to 0 between trials 5 and 6 and back from 0 to 1 between trials 10 and 1. The y-axis is relative value of the quantity being plotted. (C) Average relative bout duration as a function of repetition number (modulo 10), that is, as shown in (K), the first five (left of vertical red line) are in closed-loop and the second five (right of vertical red line) are in open-loop. (D–F) are the same as (C) but for the average relative interbout duration, average relative number of bouts and relative latency respectively. (G) Average relative bout duration for the first, second, third, and fourth bouts in a repetition (in black, blue, red, and green respectively). Linear regression was performed on the first bout of trials 6 to 10 on a fish by fish basis and then a t-test was used to show that the mean gradient of 0.081 was significantly different from 0, p = 0.0056. The relative duration of the first three interbouts in each trial is shown in (H). The average relative mean tbf for the first four bouts is shown in (I) and the average relative max tbf is shown in (J) with the same color-coding as (G). For (C–J), all error bars denote SE or the mean and n = 23 larvae. The color code described above applies to (G), (H), (I), and (J), except for (H) which concerns the first three interbouts. (L) Duration of the first four bouts pooled from (G) for both gain settings. The asterisk denotes the only significant difference between subsequent bouts (paired t-test, p < 1 × 10−5). (M) Difference in bout duration of the first bout when changing gain. The asterisk denotes the only significant difference, which occurs in the transition from open to closed-loop (paired t-test, p = 0.007). (N) The increase in bout duration from the first bout to subsequent bouts in the closed versus open-loop experiments. The increase takes two open-loop trials to reach the maximum. Asterisks denote significant differences (p < 0.0001). The units in (L,M) are absolute (i.e., ms) to allow comparison with the analogous panel in Figure 3.