  A multi-agent system designed to achieve distance-based shape control with
flocking behavior can be seen as a mechanical system described by a Lagrangian
function and subject to additional external forces. Forced variational
integrators are given by the discretization of Lagrange-d'Alembert principle
for systems subject to external forces, and have proved useful for numerical
simulation studies of complex dynamical systems. We derive forced variational
integrators that can be employed in the context of control algorithms for
distance-based shape with velocity consensus. In particular, we provide an
accurate numerical integrator with a lower computational cost than traditional
solutions, while preserving the configuration space and symmetries. We also
provide an explicit expression for the integration scheme in the case of an
arbitrary number of agents with double integrator dynamics. For a numerical
comparison of the performances, we use a planar formation consisting of three
autonomous agents.
