Controlling collective rotational patterns of magnetic rotors

Magnetic actuation is widely used in engineering specific forms of controlled motion in microfluidic applications. A challenge, however, is how to extract different desired responses from different components in the system using the same external magnetic drive. Using experiments, simulations, and theoretical arguments, we present emergent rotational patterns in an array of identical magnetic rotors under an uniform, oscillating magnetic field. By changing the relative strength of the external field strength versus the dipolar interactions between the rotors, different collective modes are selected by the rotors. When the dipole interaction is dominant the rotors swing upwards or downwards in alternating stripes, reflecting the spin-ice symmetry of the static configuration. For larger spacings, when the external field dominates over the dipolar interactions, the rotors undergo full rotations, with different quarters of the array turning in different directions. Our work sheds light on how collective behaviour can be engineered in magnetic systems.

M agnetic driving is convenient, and in recent years there have been several suggestions for ways to use magnetic colloids in microfluidic applications. These include swimmers 1-6 , pumps 7-10 , cilia [11][12][13][14][15] , and for particle sorting and segregation [16][17][18][19] . For reviews see refs. 4,16,20,21 . When a uniform rotational magnetic field is applied to a ferromagnetic colloid, the colloid experiences a torque and rotates with the field. However, exploiting this to achieve a net motion or flow is not intuitive because of the low Reynolds number hydrodynamics: a single rotator in an infinite fluid produces a rotlet flow field without any pumping 22 . One way to achieve a net flow is to place the colloid near a wall, which breaks the symmetry of the rotational flow [7][8][9] . Another possibility is self-assembled magnetic cilia that can produce fluid flow, if the pathways of the driving and recovery strokes are different 11,12,23 .
The majority of work so far has concentrated on a single magnetic unit, or a collection of many magnetic entities that move in exactly the same way as the field rotates. To make progress in exploiting magnetic driving at low Reynolds numbers, it is of interest to devise systems where the dynamics of each unit differs, even though they receive the same external driving signal. Ideally, one would like to be able to fabricate a synthetic system that mimics the well-known natural example of ciliary arrays that have evolved to, for example, pump fluids around the body. While cilia are subject to independent individual driving, they can develop metachronal waves-phase lags between neighboursbecause of hydrodynamic coupling 24,25 . Metachronal waves have been observed in magnetically driven, artificial cilia by patterning the magnetization direction 13 or by modulating the length of the cilia 14 , and thereby engineering permanent intrinsic differences between neighbouring actuating units.
Here we describe the dynamics of an array of magnetic rotors (Fig. 1a) that are actuated via an oscillatory external magnetic field, using theory and experiment. We demonstrate surprisingly complex dynamics in the rotational patterns depending on the strength of the field as shown in Fig. 1b, and report three distinct collective actuation regimes, namely a stripe pattern in which the rotors swing upwards or downwards in alternating stripes, a quarter pattern in which the rotors undergo full rotations with different quadrants of the array turning in different directions, and a staggered pattern in which the rotors show full rotations with the rotational direction being staggered. We have been able to devise strategies to achieve dynamical states in which identical rotors that are actuated using the same external driving mechanism behave differently. This has been possible because of the geometry of the system, its finite size and the complex nature of magnetic dipolar interactions [26][27][28] . In particular, we show that the rotor array can drive an extensional flow. Our simulations help to interpret the dynamics, and show that other collective modes are also possible if the rotor array can be fabricated free of imperfections.

Results
Rotor array system. The system consists of N ¼ N x N y magnetic rotors with ring geometries (Fig. 2a) positioned on a square grid, where N x and N y are the number of rotors in the x-and y-directions, respectively. The rotors are fabricated by mixing silicone rubber and NdFeB magnetic particles and they have a magnetic moment of m ¼ 2:0 10 À4 A Á m 2 . As shown in an inset of Fig. 2a, the rotors have a small rectangular protrusion, which shows the magnetization direction. Details of the fabrication process are given in a subsection in Method 'Fabrication process'.
The rotors are placed on an interface between glycerol (>95% pure; viscosity η ¼ 1:4 Pa Á s) and air. They are held in place by a square array of 3D printed posts, where ' is the spacing between the posts. Hence, because of the posts, the rotors have no translational degree of freedom, but can freely rotate feeling the local magnetic fields. A Helmholtz coil system is used to create a uniform magnetic field along x oscillating in time as: where B is the amplitude and f is the frequency.
To write down equations of motion describing the system, we make two simplifying assumptions. First, we assume that the rotor is a sphere with radius a that has no translational degree of freedom, but can freely rotate about the z-axis. Second, we ignore any effect of the liquid-air interface, and consider rotors located in an infinite fluid with viscosity η and density ρ. Each rotor has a magnetic moment m ¼ ðm cos θ; m sin θ; 0Þ, where θ is the angle the moment makes with the x-axis.
A rotor i experiences a magnetic torque: where r i is its position vector, r ij ¼ r j À r i , r ij ¼ jr ij j, n ij ¼ r ij =r ij andê z is the unit vector along the z-direction. The first term gives the torque from the external magnetic field B ext , while the second term describes the torque from the dipolar interactions between the rotors.  To the leading order in the hydrodynamic coupling between rotors, the angular velocity of a rotor i is The coefficient in the first term 8πηa 3 is the friction constant for the rotation of a sphere, while the second term is a consequence of the flow field produced by the rotation of the other spheres 22 .
Note that the coefficient in the second term can be derived by applying a rotation operator to the rotlet flow field. Although the hydrodynamic interactions would be expected to play an important role if the rotors are in close proximity, here they only have a minor effect: the second term of Eq. (3) is two orders of magnitude smaller than the first term for the grid size in our experimental set-up, '=a ¼ 5:0. Considering the rotors as point torques, the flow velocity v at position x can be expressed by a summation of rotlets as: To follow the dynamics of the array of rotors, Eqs. (2) and (3) were solved numerically. The dimensionless parameterã ¼ a=' ¼ 0:2 was kept constant for all simulations.
The rotors interact with the field, and also with each other through magnetic dipole interactions. The relevant dimensionless parameters are: α is the ratio between the external magnetic field and the dipolar field due to a neighbour rotor. The second parameter, β, compares the relaxation time of the system to the external field frequency f . The Reynolds number, Re, is so inertial effects can be neglected. We first describe the orientational patterns of the rotors when the magnetic field is static. Fig. 2b shows the configuration in zero field, α ¼ 0. The dipole-dipole interactions maximize the angle between neighbours resulting in the frustrated spin-ice structure 29,30 . At the other limit, α ) 1, the dipolar forces are negligible and all the rotors align along the external magnetic field direction as shown in those in the other two corners show tilting towards Ày. The local alignments are created by the magnetic field of the rotors as shown in Fig. 2c, d, and this is due to the finite size of the system.
Collective rotational patterns. We now turn to the dynamics in an oscillatory magnetic field. The behaviour of a single rotor is shown in Supplementary Movie 1. The rotor swings backwards and forwards through 180 at a frequency f , following the field (see Fig. 1b-(I) where the pattern of rotor movement is shown). The swinging direction can be either 'upwards' (i.e. the polar angle 0 < θ < π) or 'downwards' (Àπ < θ < 0). The direction of swing depends only on the initial angle: if a rotor has a component of its magnetic moment along þy (Ày), it will swing upwards (downwards). This is a consequence of the small inertia condition, Re ( 1; the rotor does not overshoot during the swinging and does not undergo a full rotation for any value of α or β. Despite the simplicity of the single rotor dynamics, rotor arrays have different collective dynamical modes as the control parameters are varied. Fig. 2e and Supplementary Movie 2 show the dynamics of a 4 4 rotor array when an oscillatory field is applied for α ¼ 0:4 and β ¼ 0:3 (see also Fig. 1b for the pattern of the rotor movement). Whether the spins swing upwards or downwards is controlled by the static configuration, which is the spin-ice structure. Hence, there are alternating stripes along the y-direction of rotors that swing up (orange arrows) or down (green arrows).
A different dynamical behaviour is observed for larger values of α. Fig. 3a is a schematic representation of the motion of a 4 4 square rotor array under the 1D alternating field with α ¼ 6:0 and β ¼ 0:3. Supplementary Movie 3 shows the corresponding dynamics of the experimental system. There is a clear contrast to the low α case because the discs can now show full rotations of 2π during the cycle. This can occur because the combination of the dipolar interactions and the external field breaks the time-reversal symmetry in this system. The direction of rotation depends on the rotor position within the array: those located in the top-left and bottom-right quadrants rotate clockwise, while those in the other two corners rotate counter-clockwise. There is, however, a residual overall chiral symmetry, which is broken due to the initial conditions.
In order to characterize the pattern, we count the number of rotations during 25 cycles of the field and introduce the parameter where n þ and n À are the number of counter-clockwise and clockwise rotations, respectively. Fig. 3b shows the parameter R for each rotor. The rotors with jRj ¼ 1 continuously rotate in the same direction (always clockwise corresponding to R ¼ 1 or counter-clockwise corresponding to R ¼ À1), while they rotate evenly in both directions for R ¼ 0. Rotors at the corners almost always rotate in the same direction. The four central rotors, however, do not have a preferred direction and they typically swing during a cycle. The preference for a particular rotational direction is a consequence of the dipolar forces leading to an initial tilting of the rotors near the edges of the array (see Fig. 2c). After the first half turn the alignment pattern is such that a given rotor will continue in the same sense, as long as it has sufficient time to relax towards its preferred orientation. Hence, the quarter pattern is seen for smaller values of β. This is an example showing that identical rotors, driven by the same field, can behave in different ways to each other because of collective effects.
As shown in Supplementary Movie 3 and Fig. 3d, the simulation reproduces the same quarter pattern under a condition α ¼ 6:0 and β ¼ 0:03 (i.e. the same α, but 10 times smaller β than the experiment). The fact that we could only see the quarter pattern for relatively smaller values of β in the simulation is because of the simplifications in our equations; for example, the model is not considering the effects of the liquid-air interface. The simulation result is also different in terms of the rotational patterns: all rotors are showing quarter pattern in the simulation, while the inner layer is not showing full rotation in the experiment. We believe this difference arises because of imperfections in the grid structure in the experiment. Fig. 3f shows a rotational pattern with a grid that has a small Gaussian noise (with standard deviation σ, in both the x-and y-directions) in the rotor position. Increasing the noise level, the inner layer is not showing full rotation similar to what is observed in the experiment.
To investigate how the rotational phase varies across the array we classify the rotors into three categories depending on their position as shown in Figs. 3c, d. Fig. 3e compares the time history of vorticity strength, jωj, for each category for a value of β that isolates individual rotations. The figure indicates that the corners start to rotate first, and the phase then propagates towards the centre of the system. This phase propagation is also clearly shown in the simulations and Supplementary Movie 4. This is a finite system size effect: the rotors at the corners start to rotate first because they have the maximum tilting angle from the external magnetic field as shown in Fig. 2e. In other words, the corner rotors flip earlier than the others because they are closer to the opposite direction. This variability in the tilting angles give rise to the phase lag. This metachronal-wave-like phase propagation can be seen clearly in larger systems, such as the 20 20 array shown in Supplementary Movie 5.
Fluid mixing and pumping. This collective rotation can be used to mix or pump fluid as shown in Fig. 3c and Supplementary Movie 6. The particle image velocimetry (PIV) method is utilized to visualize the flow field. The instantaneous flow velocities close to the rotors were~100 mm s À1 (corresponding to dimensionless speed v=ð'f Þ % 20). As a result of the symmetry of the quarter pattern, the rotors pull the fluid into the centre from the y-direction, perpendicular to the external magnetic field, and push it out in x-direction thus creating a dipolar (or 2D extensional) flow. The dipolar flow field is reproduced by our simulations (Fig. 3d), and the flow magnitude is in the same order as in the experiment (maximum velocity~v=ð'f Þ ¼ 30; see also Supplementary Movie 4). Figure 4a shows rotational patterns for different external magnetic field directions defined via B ext ðϕÞ ¼ B cos 2πftðcos ϕ; sin ϕ; 0Þ. When the external field is titled by 45 or 90°, it is observed that the quarter pattern also rotates by 45 and 90°. This method of creating an extensional flow has the advantage that the flow direction can be easily switched by rotating the external magnetic field. If we place this system at an intersection of microfluidic channels 10 , it can pull fluid from two directions and push it to the other two directions. At intermediate angles (ϕ ¼ π=8 or 3π=8), the rotors are creating S-shaped vortex patterns and not showing the quarter pattern. As a demonstration, we show in Supplementary Movie 7 that the pumping can be achieved in a microchannel. Figure 4b shows tracer particle movements after 50 cycles of actuation, whereas Supplementary Movie 8 demonstrates mixing in our experiment (ϕ ¼ 0). By changing ϕ, the rotors with opposite rotations determine the mixing landscape and produce drastic differences in the mixing modes. Mixing in low Reynolds number flow (or laminar flow) is challenging [31][32][33] , and has so far been achieved by adding polymer additives 34 and fixed microfluidic patterning [35][36][37] . Our method allows us to control the mixing mode dynamically by tuning the external field, and as such introduces a practical approach for mixing fluid in low Reynolds number regimes.
Phase diagram. We next use the simulations to explore the parameter space in more detail. Figure 4c shows which of the collective rotational patterns are stable for different values of α and β. For large α the quarter pattern is observed, as long as β is sufficiently small, so that the system can relax to its zero field configuration between oscillations. For smaller values of α the stripe dynamics is stable. This is in agreement with the experiment, although the agreement is only qualitative because of the simplifications introduced in the model.
The simulations allow us to identify a range of parameters where at least two other states are stable. These, which we shall call staggered patterns, are shown in Figs. 4d, e. The rotors undergo full rotations but the pattern of clockwise and anticlockwise rotations varies. The corresponding flow fields are also shown in Figs. 4d, e. Importantly, these different rotational patterns allow us to access different length scales of fluid mixing. As shown in Fig. 3, we find that by incorporating a very small irregularity in the positions of the rotors, the simulations no longer give the same behaviour, and result in random rotational patterns. Hence, a perfect lattice structure is required to obtain these patterns. We believe this sensitivity can explain why we were unable to observe these staggered patterns experimentally.
For a comprehensive understanding of the phase diagram, we present theoretical arguments that predict the existence and approximate locations of the main phase boundaries. The magnetic dipole-dipole interaction between two rotors decays with their distance r in the form of 1=r 3 ; therefore, the interaction can be considered as short-ranged in our 2D system. We can thus approximate the magnetic energy of the ith rotor as: keeping only the magnetic dipolar interaction with the neighbouring rotors (hence the notation hiji). As shown in Figs. 2b, d, the magnetic moments of the rotors will be aligned with the magnetic field if B ext is strong, and they form a spin-ice structure if B ext is negligible. By comparing the magnetic energies of one rotor in these two configurations, we find α c ¼ 1=π (shown in Fig. 4c) as the critical value at which the two contributions match. For α > α c the rotors will be aligned with B ext , whereas for α < α c the rotors will prefer the spin-ice structure.
In the phase diagram, there is a region of 'no pattern', where no specific patterns can be identified in the collective dynamics of the system. This behaviour originates from the fact that the rotation of the rotors in this regime is significantly slower than the oscillations of the magnetic field. This happens for large α, where the magnetic energy due to the external magnetic field dominates the magnetic dipole-dipole interaction. Therefore, to estimate the threshold for this behaviour, we will only consider the contribution due to the external field. Then, the angular velocity of a given rotor can be simplified as: This equation can be integrated to yield where θ 0 is the initial angle. Since the cosine function is bounded, we can recast the above solution into the following form, in terms the maximum and minimum values for the angle θ in a given cycle: If the above ratio remains to be around unity, the orientations of the dipoles do not change appreciably from the initial values that are randomly distributed. If the ratio becomes significantly larger than unity, the angles could deviate substantially from the initial values and merge into a collective pattern of persistent rotations. The threshold for the change in behaviour occurs at some value β s ¼ c 0 ' 3 =ð8π 2 a 3 Þ, where c 0 is of order unity. We can also estimate the onset of 'no pattern' by incorporating a slipping condition: ω < 2πf , or in other words, β > sin θ ' 3 =ð16π 2 a 3 Þ.
We can provide an estimate of β s by averaging the right-hand side y/ This estimate is shown in Fig. 4c.
Rotational patterns for different grid configurations. To investigate how generic our observations are, we examine the effect of the grid configuration on the collective properties of the rotors, as reported in Fig. 5. When we change the local structure from a square lattice (Fig. 5a) to a diagonal square lattice (Fig. 5b), the rotational pattern is not significantly modified. By tilting these structures by 90° (Fig. 5d, e), the position-dependent rotational pattern flips and shows counter-clockwise rotation at the bottom-right and the top-left corners. We also observe several other rotational patterns such as Fig. 5c, f-h, which contain mixed clockwise/counter-clockwise rotation patterns. These observations suggest that the local lattice structure (square or hexagonal) has a weak effect on the rotational patterns, while the overall grid shape has a larger impact.
The differences in these patterns can be traced back to the degree of roundness of the global grid boundary. As shown in the previous sections, the dipolar interactions give rise to the rotational preferences for small tilting angles (Fig. 5i). When the overall shape of the grid is rounded as in Fig. 5j, this tilting angle follows the smooth boundary since the dipole moments tend to align with their neighbours. As a result, the corners exhibit opposite rotations for Fig. 5i, j. When the global shape has both features of Fig. 5i, j, the system exhibits complex patterns as seen in Fig. 5c, f, g.

Discussion
We have described the collective motion of magnetic rotors that are placed on a square grid. The rotors, and pins that constrain their positions, are fabricated using 3D printing technology and actuated by a uniform, oscillating magnetic field. By changing the magnetic field strength relative to the dipolar interactions between rotors we identified two different collective modes in experiments. When the magnetic dipole interaction is dominant the rotors swing upwards or downwards in alternating stripes, reflecting the spin-ice symmetry of the static configuration. For larger spacing, when the external field dominates over the dipolar interactions, the rotors undergo full rotations, with different quadrants of the array turning in different directions. This is a consequence of the dipolar perturbations to a fully aligned state, which occur because of the finite size of the array.
The motion can be used to drive an extensile flow, even at zero Reynolds number, and hence it gives a new possibility of achieving magnetic mixing or pumping at low Reynolds number. In particular, the flow direction can be easily controlled by rotating the external magnetic field.
In the quarter state different rotors have a different phase, somewhat analogous to a metachronal wave. Metachronal waves are achieved in biological cilia by hydrodynamic interactions or modulated driving. They have been demonstrated in fabricated cilia by designing the magnetic units that are intrinsically different from one another; for example, by imposing a size gradient 14 or patterning the magnetization direction 13 . Here, by contrast, all the rotors are identical and the phase lag is an emergent property of the magnetic interactions between the dipoles as well as the geometry of the system.
We have demonstrated surprisingly complex dynamics in an array of magnetic rotors driven by an oscillating field. The results suggest several directions for further research. On the theoretical side, it will be interesting to understand how changes in the size and shape of the array affect the dynamical behaviour. Technological implementations will need to explore ways to miniaturize the devices, and the rotor configurations that will maximize the strength of the flow fields.

Methods
Dimensionless form of the governing equations. In this subsection, we describe the dimensionless form of the governing equations and the numerical methods. Defining the dimensionless form of the toque as T Ã ¼ T' 3 =ðμ 0 m 2 Þ, we find the Also, the flow field given by the rotlets (Eq. (4)) is given by: where r Ã ¼ r='. In our simulations, the initial orientations θðt ¼ 0Þ of the rotors were random, and the orientations were updated with the 1st-order Euler method with a time step f Δt ¼ 1:0 10 À3 .
Fabrication process. The mould used to fabricate the rotors was 3D printed (Formlabs Form 2) from a design created on Autodesk AutoCAD. The liquid silicone rubber was mixed with the curing catalyst in a 10:1 ratio by weight. NdFeB powder, with an average grain diameter <10 μm, was added to the rubber mix so that it comprised~28% of the total volume. The liquid magnetic rubber was then placed in the 3D printed mould and cured at room temperature for 6 h. The cured rotors were then placed in a Vibrating Sample Magnetometer and the magnetizing field was ramped up to 1.8 T over 17 min to saturate the rotors along the major axis of the geometry. The resulting magnetic moment was m ¼ 2:0 10 À4 A Á m 2 . The rotor radius is 1.3 mm, the inner radius is 0.6 mm, and the depth is 0.9 mm.
Arrays of posts were 3D printed with different separations (4.0 and 6.3 mm). The arrays of posts were used to fix the rotors at a given position and distance from other rotors. The posts were fabricated with a radius of 0.5 mm so that the rotation of the rotors was unhindered. The system was placed within a Petri dish containing glycerol (η = 1.4 Pa Á s) so that the rotors were positioned on the glycerol-air interface.
Experimental set-up. The coil system is powered by a signal generator and power amplifier to generate the sinusoidal field, and the amplitude and frequency of the field can be varied.
The rotor motion was observed and recorded using a high-speed camera at 240 fps. The associated fluid flow field was tracked using open source PIV Software (PIVLab 38 ). The PIV images were created by placing tracer particles on the surface of the fluid, and the velocities of the particles were tracked and averaged over 3000 frames of the recording. The experimental setup was designed and constructed for the project by Platform Kinetcs Ltd (https://www.platformkinetics.com/). Table 1 shows the experimental values that we use in our experiments.

Data availability
The data that support the findings of this study are available from the corresponding author upon reasonable request.