Direct simulation of the dynamics of two spherical particles actuated magnetically in a viscous fluid