Abstract: It is now well established that many electric loads are inherently flexible, and this flexibility can be harnessed to provide grid services identical to those obtained today through batteries and responsive generators. This article concerns the resource allocation problem associated with control of a large collection of heterogeneous loads. This problem is posed as a finite-horizon optimal control problem, in which the cost function reflects both the needs of the grid and the needs of the users of electric loads in the population. The main result is a form of state-space collapse: The marginal cost for each load class evlves in a two-dimensional subspace, spanned by a scalar costate process and its derivative.