  In this paper, we propose a computationally efficient, robust density control
strategy for the mean-field model of a robotic swarm. We formulate a static
optimal control problem (OCP) that computes a robot velocity field which drives
the swarm to a target equilibrium density, and we prove the stability of the
controlled system in the presence of transient perturbations and uncertainties
in the initial conditions. The density dynamics are described by a linear
elliptic advection-diffusion equation in which the control enters bilinearly
into the advection term. The well-posedness of the state problem is ensured by
an integral constraint. We prove the existence of optimal controls by embedding
the state constraint into the weak formulation of the state dynamics. The
resulting control field is space-dependent and does not require any
communication between robots or costly density estimation algorithms. Based on
the properties of the primal and dual systems, we first propose a method to
accommodate the state constraint. Exploiting the properties of the state
dynamics and associated controls, we then construct a modified dynamic OCP to
speed up the convergence to the target equilibrium density of the associated
static problem. We then show that the finite-element discretization of the
static and dynamic OCPs inherits the structure and several useful properties of
their infinite-dimensional formulations. Finally, we demonstrate the
effectiveness of our control approach through numerical simulations of
scenarios with obstacles and an external velocity field.
