# A Methodology for Exploiting Smart Prosumers' Flexibility in a Bottom-Up Aggregation Process
## 3 Bottom-Up Aggregation Algorithm  
After evaluating its offer, a prosumer participates in the bottom-up aggregation process. The original bottom-up aggregation algorithm conceived in the context of the DEMAND project implements a collaboration-competition mechanism between electricity prosumers that, activated by the VAE, begin to interact with each other to form aggregates capable of formulating offers that meet the DSO's request. Within an aggregate, only one user can have leadership. In a nutshell, it is an asynchronous mechanism in which the interaction between  
Figure 3: Day-ahead management procedure. the various prosumers can take place while they are in different states. In particular, the possible states are four:  
1. INIT: The prosumer verifies whether it can formulate an offer of flexibility sufficient to satisfy the DSO's request. If yes, the prosumer goes to state 4; if not, it goes to state 2;
2. REQUESTER: The prosumer search for other prosumers or aggregates to form an aggregate capable of formulating an offer that responds to the DSO's request. While staying in this state, the prosumer can receive requests from other prosumers/aggregates (which are in the same REQUESTER state); those requests remain in a queue until the transition to state 3;
3. RESPONDER: The prosumer examines all requests received, evaluates the potential aggregation results and provides the requested information;
4. STAND-BY: The prosumer can no longer be contacted because it is part of an aggregate of which it does not hold leadership or is the leader of an aggregate that has made at least one valid offer published on the VAE. Figure 4 represents the states of each prosumer. The aggregation process uses some parameters that allow the user to make decisions. The first parameter is the power reduction coefficient \(\alpha_{p}^{(i)}\). It is defined as the rate, expressed as a percentage, between the power variation that a user (\(i\)), if it is the leader of an aggregate, decides to formalize with an offer and the maximum power variation that the same aggregate can provide. In this incremental growth algorithm, the first bids that are formed are those with a limited number of prosumers, each offering the maximum power variation. These bids will be, on average, more expensive than bids that include many prosumers, each with a very small power contribution. It is obvious that the larger the percentage, the faster the prosumer will form an aggregate with a valid offer, the higher the revenue of each individual prosumer that makes up the aggregate, the greater the probability that some other aggregate will create a more advantageous offer (with a lower equivalent price), for example by putting together more prosumers with smaller contributions. Thus, each prosumer will have its own value that it will update based on the success rate of the bids it forms. In particular, \(\alpha_{p}^{(i)}\) could also start at 100% (aggregating prosumers at their maximum power variation) and then could be reduced each time the bid submitted to the VAE is not accepted by the DSO. Figure 4: States of each prosumer. The second parameter is the minimum power contribution threshold \(\beta_{P}^{(i)}\). It is defined as the limit of its own power variation contribution below, which the prosumer \(u(i)\), if it is the leader of an aggregate, discards the offer even if valid. This coefficient is connected to the first one since its value influences the minimum value that \(\alpha_{P}^{(i)}\) can assume during a request of power variation according to the following relation:  
\[min\;\alpha_{P}^{(i)}=100\cdot\frac{\beta_{P}^{(i)}}{\Delta P} \tag{7}\]  
The last parameter is the maximum waiting time \(\gamma^{(i)}\). This parameter is the time that a prosumer (\(i\)), if it holds the function of the leader of an aggregate, is willing to wait following the sending of a merge request to another prosumer, leader of another aggregate, before considering that prosumer temporarily unavailable and switching to another prosumer.