  In this paper, we consider a community energy storage (CES) system that is
shared by various electricity consumers who want to charge and discharge the
CES throughout a given time span. We study the problem facing the manager of
such a CES who must schedule the charging, discharging, and capacity
reservations for numerous users. Moreover, we consider the case where requests
to charge/discharge the CES arrive in an online fashion and the CES manager
must immediately allocate charging power and energy capacity to fulfill the
request or reject the request altogether. The objective of the CES manager is
to maximize the total value gained by all of the users of the CES while
accounting for the operational constraints of the CES. We discuss an algorithm
titled \textsc{CommunityEnergyScheduling} that acts as a pricing mechanism
based on online primal-dual optimization as a solution to the CES manager's
problem. The online algorithm estimates the dual variables (prices) in
real-time to allow for requests to be allocated or rejected immediately as they
arrive. Furthermore, the proposed method promotes charging and discharging
cancellations to reduce the CES's usage at popular times and is able to handle
the inherent stochastic nature of the requests to charge/discharge stemming
from randomness in users' net load patterns and weather uncertainties.
Additionally, we are able to show that the algorithm is able to handle any
adversarially chosen request sequence and will always yield total welfare
within a factor of 1/a of the offline optimal welfare.
