  Microgrids are self-sufficient small-scale power grid systems that can employ
renewable generation sources and energy storage devices and can connect to the
main grid or operate in a stand-alone mode. Most research on energy-storage
management in microgrids does not take into account the dynamic nature of the
problem and the need for fully-distributed, multi-step scheduling. First, we
address these requirements by extending our previously proposed
\textit{multi-step cooperative distributed energy scheduling} (CoDES) algorithm
to include both purchasing power from and selling the generated power to the
main grid. Second, we model the microgrid as a multi-agent system where the
agents (e.g. households) act as players in a cooperative game and employ a
distributed algorithm based on the Nash Bargaining Solution (NBS) to fairly
allocate the costs of cooperative power management (computed using CoDES) among
themselves. The dependency of the day-ahead power schedule and the costs on
system parameters, e.g., the price schedule and the user activity level
(measured by whether it owns storage and renewable generation devices), is
analyzed for a three-agent microgrid example.
