Shifted interactions playground

Simulators to test the results of Shifted Interaction Functions: A Unified Framework for Imperfect Actuation and Sensing in Consensus Networks: fly a fleet of drones, draw their throttles by hand, and check the theorems

Published

November 14, 2026

From the Swarm Systems Lab, University of Granada. The paper’s results, step by step, are in the explanation.

How this page works. Every agent runs the ideal consensus program and nothing else. At every tick (2 ms) it measures the relative state of each neighbour, zij=xi−xjz_{ij} = x_i - x_j, and asks its actuator for ui=−∑jziju_i = -\sum_j z_{ij}. But its hardware is imperfect: the sensor delivers ψij(zij)\psi_{ij}(z_{ij}) instead of zijz_{ij}, and the actuator delivers the velocity Fi(ui)F_i(u_i) instead of uiu_i. These are the paper’s shift functions: monotone maps, moved off the origin. Nobody compensates for them. The paper predicts what the team does anyway, and each section says what that prediction is, so that you can try to break it. The simulators run the same code as the figures of the explanation, and that code is checked against the explanation’s Python (make check).

1 Fly the fleet

Twenty drones fly around a track, each on its own orbit, so they never collide. A drone’s state is its progress along the track, and the consensus program tries to line them up. Each drone’s throttle is a shift function of its own: with “fixed-wing”, every drone has a stall speed (no reverse) and a top speed, its own gain, and its own trim. The spoke, the grey line from the inner drone to the outer one, shows the result: a straight spoke is a consensus, a bent one has offsets.

Draw a throttle. Click a drone, then draw its throttle on the maps panel with the mouse, or with your finger on a phone: input uu across, speed up. Whatever stretch of uu you draw over is replaced and the rest is kept. Your stroke becomes the closest non-decreasing curve (Assumption 2 asks no more), flat beyond its ends, so you can draw dead zones, saturations, jammed stretches, or a throttle that never lets the drone slow down. The whole fleet answers at once.

What the theory predicts. If the ranges of the throttles overlap (Assumption 3), the whole fleet ends up at one speed, y*y^*, the unique velocity of Lemma 2, whatever the start: the dots in the maps panel slide to one horizontal line [proved], Theorem 1. The spoke keeps a fixed bend, L†η‾L^\dagger\bar\eta, and straightens only if every throttle gives the same speed at zero input (Corollary 1) [proved]. A drone whose throttle is jammed at a speed vv becomes a leader: the others follow at vv if they can fly at vv (the paper’s remark after Theorem 1) [proved].

What to try. Draw one drone a throttle that stays between 1.25 and 1.5 whatever its input: the predicted speed in the centre jumps, and the whole fleet speeds up to match that one drone. Now draw it a flat line above 1.8, faster than any other drone can fly: the ranges no longer overlap, the readout says “none”, and the drone laps the fleet. Draw a flat stretch through the middle of a drone’s map (a dead zone) and watch its dot stop on it. Trim one drone (↑/↓) and watch the predicted speed change, by about a twentieth of your trim. Jam a drone (J), then hold ↑: the fleet speeds up behind it. Keep going past the others’ top speed: the readout says “none”, and the jammed drone laps the fleet. Bring it back down below the stall speed of the others and the same happens the other way. Kick the fleet (K): the spoke comes back with the same bend. Switch to “jammed pieces”: the maps have flat spots, the bend now depends on the start, and the speed does not. Then take the challenge: six drones with linear throttles, and you must straighten the spoke by trimming them one by one (Corollary 1 says how).

2 The Lemma 2 lab

The fleet, cut down to the four agents of the paper’s Fig. 1, to look inside Lemma 2. Draw their throttles as in the fleet (pick an agent and sketch, with the pointer or a finger; “move knots” fine-tunes), and the lab shows what the fleet cannot: the band T(y)T(y) of Lemma 2, and five runs from different starts.

What the theory predicts. If the ranges overlap, there is exactly one velocity y*y^* at which the agents’ inputs can add up to zero (Lemma 2): where the band T(y)T(y) crosses zero. Every run ends at y*y^*, from every start (Theorem 1) [proved]. With flat pieces, the limit of η=Lx\eta = Lx, and so the offsets, can depend on the start; the velocity cannot.

What to try. Start with the maps of Fig. 6 (with uu scaled to fit): every map is zero exactly for u≤0u \le 0, and the agents end at y*=0y^* = 0, a static consensus. Draw a new map for one agent, say one that never goes below 0.5, and watch y*y^* and all five runs move together. Choose “ranges that miss”: agent 3 can never fly as slowly as the others, Lemma 2 gives nothing, and the runs never align. Try “four dead zones”: the five runs end at the same speed with different offsets. Then run the census: a thousand random teams with flat pieces, each simulated from a random start and compared with Lemma 2 [numerical].

3 The linear lab

With linear maps, sft⁡(s)=as+b\operatorname{sft}(s) = as + b, both channels give ẋ=−L̃x+b\dot x = -\tilde L x + b, and Proposition 3 gives the drift c=v⊤b/v⊤𝟏c = v^\top b / v^\top\mathbf{1} and the offsets x*x^* in closed form, with vv the left null vector of L̃\tilde L.

What the theory predicts. The velocities converge to cc and the states to ct+x*ct + x^*, exponentially [proved]. Actuation is the special case where each agent uses one slope for all its measurements; then L̃\tilde L has real eigenvalues, otherwise they can be complex [proved]. The distortion is at most ∥b⟂∥/σ2(L̃)\|b_\perp\|/\sigma_2(\tilde L) [proved].

What to try. In “turning weights”, lower the slope of z12z_{12} until the complex pair of eigenvalues becomes real. Load “the actuation of Fig. 9” and change a single slope: it stops being an actuation. Set every bias to zero but one, and watch the whole team drift. Then run the census: how often does a random sensing have complex eigenvalues, and does the bound ever fail? [numerical]