1. Introduction
The modern energy landscape is witnessing a transformative shift with the proliferation of renewable energy sources and the emergence of prosumers, individuals who actively participate both as energy consumers and producers within the energy grid. This paradigm shift has led to the development of innovative energy trading platforms, known as peer-to-peer (P2P) energy trading systems, which enable prosumers to engage in direct energy exchanges within localized communities, e.g., the local electricity market (LEM) [
1]. By facilitating efficient energy transactions, P2P energy trading holds the promise of revolutionizing traditional energy markets and empowering consumers to play an active role in shaping the energy ecosystem [
2].
Despite the potential benefits, current P2P energy trading models often lack a comprehensive strategy to maximize the advantages for prosumers involved in the system. Consequently, prosumers may face challenges in optimizing their energy consumption and generation patterns to reap the full economic potential of their participation [
3]. An investigation [
4] presented strong evidence regarding the financial advantages for peers who share energy at the local level in a small energy community. To significantly increase consumer partaking, it is essential for flexible market operations and techniques to align with customers′ preferences. To understand customers′ motivations, such as self-reliance and monetary rewards, a customer-centric approach is necessary [
5] to effectively engage them [
6]. The research in [
7] suggested a commitment system based on smart contracts and a trusted execution environment to address the trust issue among market players because the distributed energy trading model lacks an efficient trust strategy. To mention an important dimension of energy storage, the suggested strategy in [
8] illustrates the potential of energy storage as an efficient tool for managing congestion and operating cost optimization in distribution networks by offering financial advantages to both the microgrid and the distribution system operator through thorough simulations and analyses. The research in [
9] suggested a method for taking the solution to the next level, in which nearby microgrids in a distribution network cooperate and create a multi-microgrid to construct a shared energy storage to boost their revenue and raise their dependability. The annual compensation received from system operators is taken into account while comparing various investment possibilities. Operators award annual rewards depending on the contribution of energy storage to peak-shaving and annual cost savings in distribution network operation for each of the investment scenarios.
Increasing the earnings that prosumers may make by reselling this surplus into the neighborhood network is one strategy to expand the number of prosumers. Additionally, customers would benefit from cheaper pricing as a consequence of competition among prosumers, paying less for power that is not subject to network charges. The use of P2P contracts negotiated in local marketplaces and operated at the microgrid stage serves as a method of facilitating this kind of transaction [
10]. One study [
11] introduced a novel marketplace for prosumers’ energy surplus trading in a genuine local microgrid based on intelligent P2P contracts. The study outlined in reference [
12] introduced a pair of bidding approaches intended for the P2P market. It scrutinized the impact of these strategies on augmenting liquidity, stabilizing prices, and achieving profitability. The investigation drew upon historical data from a previous demonstration project concerning solar PV generation and consumption. The research in [
13] demonstrated that providing fiscal incentives encourages prosumers to finance in or improvement to energy-efficient resources. Consequently, there is a need for comprehensive strategies to engage customers [
14,
15], empowering them to utilize their resources effectively. Our research goal statement revolves around this premise.
3. Proposed P2P Model
In this research, we conducted simulations on a local energy network comprising 36 households, 30 of which were prosumers equipped with solar PV and battery backup, enabling them to engage in P2P energy trading. The remaining six customers were normal consumers restricted to importing power without generating or selling it. The primary focus was on calculating the power transaction cost for two distinct cases: one without P2P and another with P2P implementation.
There were two cases considered for the study, as shown in
Table 1, which includes the SSS. For Case 1, electricity transactions were solely permitted with the grid, enabling customers to purchase the power at retail prices and prosumers to sell excess power to the utility grid at feed-in prices. In Case 2, besides the utility grid power exchange, customers were also allowed to buy energy from the peer prosumer at the P2P price or mid-market price, as specified by Equation (19). Additionally, prosumers in Case 2 had the option to trade electricity to other peers at P2P price or to the utility grid at feed-in prices.
The motivation behind these strategies is to address customers′ growing demand for rate alternatives that can help reduce their electricity bills. Strategies 3 and 4 aim to classify customers by providing monetary rewards depending on their power export. In Strategy 3, classification is founded on the highest exported power, while Strategy 4 classifies prosumers by their average exported power. This approach encourages prosumers to strive for higher rewards, motivating them to improve their power export performance. However, it is essential to ensure that the sum of rewards provided to all prosumers collectively remains under the cost-saving threshold. The detailed segment rules and incentive limits are detailed in
Table 2.
Overall, these strategies and the implementation of P2P hold promise for enhancing cost savings and incentivizing prosumers to actively participate in the energy market, contributing to a more sustainable and efficient energy exchange.
The step-by-step methodology of market operation is illustrated in
Figure 1, outlining the roles and responsibilities of the distribution system operator (DSO), the aggregator, and the participants, as well as their interrelationships. The optimization process conducted in this study is specifically focused on the aggregator level. In this context, the aggregator assumes control over the community and presents an optimal operation solution, factoring in the objective function. On the other hand, the DSO is responsible for receiving and preserving the smart meter data of customers to run optimal power flow (OPF). The DSO defines the power exchange prices and the network configuration. It is important to note that market clearing is not pursued in this scenario, as the aggregator is responsible for proposing and implementing the most advantageous transaction arrangement within the community.
4. Mathematical Model
The primary goal of the initial optimization stage is to formulate the objective function in a way that minimizes the overall system cost, as described by Equation (1).
In this context,
and
denote the cost and income, respectively, for prosumers interacting with the grid. On the other hand,
and
represent the cost and income, respectively, for prosumers engaged in energy sharing with peers locally. Additionally,
signifies the fixed charge applicable to each prosumer.
Expressions (2) and (3) outline the mathematical computations for determining the cost and revenue associated with power interchange to the grid for all prosumers, subject to constrictions (4–7). In these equations,
and
represent the power purchased from and sold to the grid, respectively.
and
represent the power exchange rates for buy and sell, respectively, while d
serves as the time period adjustment factor
In this context, Equations (4) and (5) establish the boundaries for power trading, with
representing the maximum allowable power purchase and
indicating the maximum permissible power sell. Their corresponding binary variables are symbolized as
and
. These variables are used to express whether a prosumer engages in power purchase or power sell transactions.
The limitations on the binary variables are defined in Equations (6) and (7). Constraint (8) ensures that a prosumer cannot perform both power buying and selling operations with the grid simultaneously.
Equations (9) and (10) are the mathematical representations for assessing the cost and revenue associated with electricity buy and sell transactions in P2P for all prosumers. These calculations are subject to limits (11–18).
where
and
represent the power purchased and sold in P2P, respectively, while
denotes the P2P price applicable to all participants. Within the P2P framework, the prosumers may take into account network losses as a central factor during the process of matching peers [
18]. The power loss coefficients for power buying and selling in P2P are denoted as
and
, respectively. The overall power loss multiplier for energy transactions in the local energy trading is fixed at 5% [
19].
Here, constraints (11) and (12) define the limitations for power trading among peers at the local level. The binary variables
and
are used to express whether a prosumer engages in power purchase or power sell transactions in P2P, respectively. These variables help establish the boundaries for the power buy and sell operations within P2P.
where a restriction defined by Equations (13) and (14) on the binary variables influences the actions of prosumers within P2P. Specifically, it enforces that prosumers can choose either to purchase or to sell power in P2P, but not both simultaneously.
Constraints (15)–(17) prevent a participant from engaging in simultaneous operations both in the grid and the P2P, while expression (18) signifies equilibrium between power transactions in the P2P transaction. In other words, during time period
, a prosumer can either trade power with the grid or participate in P2P, but not both. The P2P price is determined on the basis of Equation (19) and is computed as an average of the smallest purchase price of each household and the feed-in price [
20].
Equations (20) and (21) illustrate the mathematical model for the batteries of the players. The mathematical representation of the first charging power is calculated by Equation (20), while for all other times, Equation (21) is used:
where
characterizes the battery power, and charge and discharge efficiencies are symbolized as
and
. Expression (21) governs the battery charging process throughout all time periods. These energy balance equations are constrained by conditions (19)–(21).
Equation (22) pertains to the battery capacity
and the upper limit of power in the battery
. Meanwhile, constraints (23) and (24) impose limitations on the charging and discharging of the battery, ensuring they remain within specific boundaries. In these constraints,
and
denote the charging and discharging power, respectively, and
&
are their corresponding binary variables. Furthermore,
and
represent the power limits for charging and discharging, respectively.
The binary variables and are constrained by (25) and (26). Constraint (27) ensures that the battery cannot be simultaneously charged and discharged, limiting it to either charging or discharging at any given time.
To enhance the realism of the mathematical model, additional constraints (28)–(30) are incorporated. Equation (28) represents the power balance equation, applied individually to each player in each time period.
where
is imported power,
is the power discharged from battery,
is power generation,
is power consumed by load,
is power exported,
is power charged in the battery. Equation (29) calculates the imported power. On the other hand, Equation (30) computes the exported power.
The second phase of optimization is described below, which is the mathematical model of the SSS.
Equation (30) is the mathematical representation of the objective function of second-phase optimization to maximize the overall financial reward received by prosumers, where
,
,
,
,
, and
are the monetary incentives for prosumers under the six segments S1, S2, S3, S4, S5, and S6 respectively.
The range of the maximum and minimum peak power export values for the six segments of prosumers can be found using Equations (32)–(37) in Strategy 3. Likewise, the higher and lower bounds for the average exported power values for the segments can be determined using Equations (38)–(43) in Strategy 4. These equations provide the limits for peak power export,
,
,
,
, and
, as well as average power export,
,
,
,
and
. It is important to note that these power export values, whether peak or average, are not variable entities; instead, they are derived from the optimized power value
obtained during the initial optimization phase. This information is further detailed in
Table 2 and mathematical representations (32)–(43).
The lower limit for the incentive amount
and the upper limit
are constrained according to Equations (44) and (45), where
is the cost savings. These equations involve the cost savings, which signifies the disparity in savings achieved when comparing scenarios without and with P2P.
The conditions outlined in the mathematical model in Equations (46)–(51) pertain to the fiscal incentives provided to prosumers. In these equations, the parameters
,
,
,
,
, and
correspond to the upper limits of rewards for their respective segments. For segments S1 through S6 in Strategy 3, the reward limits are set at 50%, 60%, 75%, 100%, 130%, and 160% of the maximum reward, respectively. In Strategy 4, Equations (46)–(51) remain unchanged, but the rewards are capped at 25%, 50%, 70%, 90%, 120%, and 150% of the maximum reward for segments S1 through S6, respectively. The symbols
,
,
,
and
represent binary variables corresponding to the prosumer segments. A value of 0 signifies that a prosumer is not categorized within that segment and will not receive an incentive. Conversely, a value of 1 indicates that the prosumer falls into that segment and is eligible to receive an incentive based on the constraint equation. The amounts of incentives and their respective binary variables are further confined by Equations (52)–(59).
Equations (52)–(57) outline the boundary for binary variables determining eligibility for rewards within their corresponding segments. The limitations specified in Equation (58) prevent prosumers from obtaining rewards from multiple segments simultaneously, while constraint (59) distinguishes between various levels of reward amounts.
Equations (52)–(60) introduce additional practical limitations to the model. Among them, Equation (60) enforces the condition that the combined reward sum must not exceed the value of the cost savings.
6. Results and Discussion
MATLAB 2022b served as the platform for conducting the simulation. The challenge of optimizing mixed integer linear programming was addressed using the TOMLAB toolbox′s CPLEX solver. A simulation was conducted on a system with a core i5 processor (11th generation) and a 64-bit operating system with 64 GB of installed RAM. The investigation revolved around the system cost implications in two scenarios aimed at cost reduction and a comparison of cost savings between the two scenarios. The findings stemmed from the 2021 Portuguese feed-in rate (0.045 EUR/kWh). In Case 1, engagement in the P2P transaction was prohibited for all participants, whereas Case 2 permitted their involvement in P2P energy sharing. In both instances, Case 1 did not yield an incentive, while Case 2 offered a rewarding outcome. The absence of LEM resulted in a system cost of EUR 103.42, whereas this cost diminished to EUR 90.10 when P2P was employed, as depicted in
Table 4. Consequently, a cost reduction of EUR 13.32, or 12.9%, was obtained within this system.
In the context of Case 1, the cumulative earnings garnered by prosumers amounted to EUR 3.19. Notably, the spectrum of revenue for individual prosumers spanned from EUR 0 to 0.55, with the lowest and highest revenue figures. Conversely, in Case 2, involving P2P power exchange, the collective income produced by prosumers reached EUR 19.23, with revenue spanning from EUR 0 to 1.93. It is worth highlighting two key observations here. Initially, certain prosumers experienced minimal to almost negligible revenue due to their low power export to the grid/P2P, aligned with the aim of minimizing system costs or opting to predominantly self-consume generated power. Secondly, the revenue achieved in Case 2 significantly surpassed that of Case 1. This discrepancy stems from the P2P power transaction model, permitting prosumers to sell their excess power at a higher P2P price compared with the retail feed-in price offered by the utility grid. Simultaneously, prosumers could purchase power at a lower P2P price compared with the retail purchase price from the retailer. This pivotal difference accounts for the lower system cost in Case 2 as opposed to Case 1.
The diagram in
Figure 2 illustrates the peak power export of prosumers in both scenarios. It is noticeable that the peak power export of prosumers was greater when peer-to-peer (P2P) dynamics were present. Furthermore, a subset of prosumers displayed minimal peak power export values, a reflection of the optimization model′s allowance for prosumers to self-consume generated power, thereby reducing system costs. In the absence of P2P, the range of peak power export spans from 0.005 to 4.78 kW, whereas in the presence of P2P, this range extends from 0.67 to 5.17 kW during a single time period. To allocate this cost reduction as a financial benefit to prosumers, we introduce four approaches. The concept of a circular economy serves as an incentive for existing prosumers to engage in P2P energy exchange, thereby enhancing their motivation to participate in local energy trading. Across all strategies, a shared limitation is enforced: the total monetary reward must not surpass the cost savings. In the first strategy, the cost savings are evenly divided among all prosumers. By contrast, the second strategy entails prosumers receiving 40% of the income they have produced from electricity sales to the grid or through P2P locally, as outlined in Case 2.
Moreover, prosumers undergo segmentation depending on their highest and average power export. Upon scrutinizing
Figure 4 for Strategy 3, it becomes evident that two prosumers existed within the S1 segment, six prosumers were categorized under the S2 segment, eight prosumers were allocated to the S3 segment, nine prosumers fell into the S4 segment, no prosumers fell under the S5 segment, and five prosumers were situated within the S6 segment. All prosumers belonging to the S6 segment successfully reached the predefined maximum power export threshold of 5.175 kW. Similarly, for Strategy 4, the information presented in
Figure 5 indicates the presence of six prosumers within the S1 segment, five prosumers situated in the S2 segment, two prosumers falling into the S3 segment, no prosumers in the S4 segment, three prosumers in the S5 segments, and fourteen prosumers forming the S6 segment.
The reward amounts obtained by all prosumers across the four strategies are depicted in
Figure 6. This figure enables a comparison of the rewards received by individual prosumers within each strategy. Notably, varying reward amounts were allocated to each prosumer across all four strategies. In this context, it was observed that all prosumers, categorized on the basis of their segments, attained the maximum achievable monetary rewards corresponding to their respective segments. Furthermore, a noticeable trend emerged wherein numerous prosumers within the same segment received identical rewards, a measure aimed at ensuring that the aggregate rewards distributed among all prosumers remained beneath the threshold of cost savings. We also experimented with introducing a constraint to prevent prosumers within the same segment from receiving identical rewards. This led to varying reward amounts for prosumers within the same segment, but the collective sum of rewards remained significantly lower than the achieved cost savings. Given that the primary objective of the study was to optimize rewards and make the most efficient use of cost savings, outcomes with diverse reward amounts were disregarded as suboptimal. The ultimate results based on the proposed segmentation criteria and reward limitations reflected the highest level of cost savings utilization and reward maximization. Additionally,
Table 5 presents a comparison of the least, extreme, average, and full incentive values.
Comparing the results with three-segment strategies, as shown in
Figure 7, the total reward in Strategy 3 increases up to 1.63% from EUR 12.05 to 12.25, while in Strategy 4, a remarkable increment by 13.73% from EUR 11.49 to 13.32 is obtained.