Abstract
Energy communities, consisting of interactive prosumers, are reaching a dominant interest in many countries in the last years. Prosumers, by participating in energy communities, can achieve economic benefits, by maximizing the exploitation of locally produced renewable energy and by providing ancillary services to the system operators. Considering the large scale number of prosumers in an energy community and the requirement to carry out both day-ahead and real-time optimizations, new real-time and distributed optimization methods are necessary to cope with the issue of scalability while preserving the privacy of prosumers.