## 3 Modeling of Various Stakeholders in the Distribution Network (DN)
### Prosumers Model  
In this work, prosumers are considered as grid-connected and allow for a two-way power flow, i.e., prosumers can optimize power flow through their own energy management system based on internal conditions and external signals (such as price, demand response, etc.). Generally, the tariff  
Figure 5: Utility function of consumers energy usage.  
price of RES to the grid is relatively fixed, but the purchase price is based on the retail price of the entire DN, such as real-time electricity price and time of use (TOU) price.  
The economic model for prosumers is established based on the cost of each part and the income from tariffs of RES to the grid. The sub-models are as follows:  
_1) Storage Cost_  
EMS is responsible for setting the operation strategy of storage. Based on the concept of life cycle management, the cost of batteries can be converted into daily investment costs and average maintenance costs [32]:  
\[CS_{j}=24\frac{\alpha_{1}C_{cap}}{T_{a}}+\beta_{1} \tag{3}\]  
where \(C_{cap}\) is the capital cost of the storage system (i.e., cost of the battery and converter), \(\alpha_{1}\) is capital recovery factor of storage, \(\beta_{1}\) is average maintenance cost. \(T_{a}\) is lifetime of battery.  
_2) RES Cost_  
The RESs of prosumers mainly include PVs and WTs. The cost model can be established based on the value of PES power to the grid \(r_{j}^{t}\). The cost includes two parts: one is the loss cost of energy from the perspective of the life cycle, which is similar to the storage cost; the other is the maintenance cost. RES cost can thus be expressed as:  
\[CR_{j}=\sum_{t}^{T}\left[\alpha_{2}(r_{j}^{t})^{2}+\beta_{2}r_{j}^{t}\right] \tag{4}\]  
where \(r_{j}^{t}\) is feed-in power of RES to the grid, \(\alpha_{2}\) is constant coefficient of RES cost, and \(\beta_{2}\) represents average maintenance cost of RES.  
_3) Utility of Consumption_  
The consumption of prosumers is the same as normal customers, and this model can thus be written as the utility model mentioned in Section 3.1:  
\[L_{j}=\sum_{t}^{T}[U(x_{j}^{t},\omega_{j})-P_{retaller}^{t}x_{j}^{t}] \tag{5}\]  
where \(P_{retaller}^{t}\) is the real-time retail price for purchasing electricity of prosumers, and \(x_{j}^{t}\) is the quantity of energy consumption of prosumer \(j\) at time slot t.  
_4) Income from Tariffs from RES to the Grid_  
It is assumed that the local tariffs of RES to the grid is a fixed value, the income can thus be calculated as:  
\[H_{renewable,j}=\sum_{t}^{T}[P_{tariff}\times E_{renewable,j}^{t}] \tag{6}\]  
where \(P_{tariff}\) is the local tariff of RES to the grid, \(E_{renewable,j}^{t}\) represents the energy amount of RES to the grid at time slot \(t\), which is subject to the total energy of the prosumer. i.e., \(E_{renewable,j}^{t}\) should be less than the sum of the energy at interval \(t-1\) and the RES output at interval \(t\):  
\[0\leq E_{renewable,j}^{t}\leq B_{initial}+r_{j}^{t}+\sum_{t=1}^{T}\left(r_{j}^{t -1}-E_{renewable,j}^{t-1}\right) \tag{7}\]  
where \(B_{initial}\) is the initial energy in the storage, \(r_{j}^{t}\) is the output power of RES at interval \(t\).  
To sum up, the revenue of the prosumer at interval \(t\) is the sum of the above:  
\[R_{prosumer,i}=H_{renewable,j}+L_{j}-CS_{j}-CR_{j} \tag{8}\]