  The proposed distributed dynamic clustering algorithm enables to group agents
based on their pre-selected feature states. The clusters are determined by
comparing the distance of the agents' current feature states with average
estimates of the states in all clusters. The algorithm also provides average
estimates of pre-selected auxiliary states that can be utilized for control
purposes. Two example applications of the algorithm are introduced. In the
first application, the algorithm is applied to a microgrid with distributed
batteries that are controlled to achieve a common state of charge within a
group. However, a random selection of the batteries' groups results in
additional power losses during operation. The algorithm reduces the power
losses by clustering the batteries based on the selected feature states: local
loads and battery capacities, while the state of charges and output voltages
are selected as auxiliary states for control purposes. In the second
application, the algorithm is used to form a virtual energy storage from
batteries distributed in a microgrid.
