5.3. The Interaction between Sellers and Buyers
In order to solve the two problems involving profit maximization and cost-saving maximization in a decentralized manner, as depicted in
Figure 3, this paper develops an algorithm for interactions between sellers and buyers. The algorithm uses a decentralized method of problem solving to align with the problem formulation. In other words, while direct problem-solving approaches are feasible, they are not appropriate for the current problem formulation. The algorithm, however, employs the perspective of direct optimization problem-solving in the interaction between sellers and buyers at each step. This algorithm design was based on two main reasons: (1) the complex nature of participant interactions and (2) the need for a transparent and easily understandable solution process that aligns with real-world decision-making processes. For example, after a buyer has chosen a seller, the sellers select the buyer who maximizes their benefits. Buyers, on the other hand, choose sellers who provide the greatest value in terms of cost savings. This problem-solving strategy is integrated into the algorithm to optimize the interaction between sellers and buyers, ensuring optimal outcomes for both parties. Because the method is decentralized, the responses are typically of a local optimal nature. Some buyers and sellers, on the other hand, may receive responses that are globally optimal for them. In this paper, sellers are designated as the price makers, directing the algorithm by offering trading prices to buyers who are designated as followers and respond with trading power. The fundamental concept of the P2P energy market allows sellers and buyers to contact each other directly for purposes of buying and selling, as well as to negotiate their submitted orders regarding both trading price and trading power, while maximizing the benefits for both the seller and the buyer. In order to achieve results that are consistent with the P2P concept, the market forces from governmental intervention are ignored.
The P2P market rules used in this study require sellers to independently determine the offer prices for all participating buyers. This approach is similar to general commodity trading, in which sellers set prices prior to any transactions. It is worth noting that the sellers’ offer prices are not predetermined selections or matches with specific buyers. Buyers have the option to accept or reject these offers. As a result, the selection process gives buyers direct authority to select a seller. Following the selection, sellers can then submit new offer prices to buyers who have not yet made a decision, until the available electricity trading capacity is depleted.
Initially, the seller
sends the buyer
the trading price
. According to the maximization of profits, the trading price is set above the price
. However, it should not exceed the price at which the buyers buy energy from the DSO, such as the time-of-use (TOU) rate. When it exceeds the TOU rate, buyers typically return to trading energy with the DSO. Therefore, the price limits for trading between sellers and buyers are shown in (8). Because the TOU rate is set according to the time periods known to the buyer, as part of the basic electricity tariff used in purchasing electricity from the DSO, before considering the operational conditions of the distribution system, it is more appropriate for the buyer to utilize the TOU rate in submitting the trading price to the P2P energy trading platform for purchasing electricity from the seller. This remains true even within the scope of this research, where the operational conditions of the distribution system are considered alongside the electricity prices, potentially leading to the development of a DLMP based on the bus location to which the buyer is connected for purchasing electricity from the DSO.
where
is the TOU rate.
As a response to receiving the trading prices from sellers, the buyers then select a seller. Based on the maximization of cost savings, the buyer
will choose the seller
who maximizes the value of the term
, as depicted in
Figure 4. In this case, the buyer
agrees to trade with the seller
by setting the total power
to the trading power
. In contrast, if a buyer does not choose a seller, the trading power is set to zero by the buyer. After the selection, the trading power of the buyers is returned to the chosen sellers.
After sellers are chosen and informed of the trading power, they must determine whether their total power is sufficient to support the total amount of trading power, as depicted in
Figure 5. If it is insufficient, the sellers will prioritize the buyers according to the criteria of maximum profit. By doing so, the trading power will be diminished by ranking the trading prices from low to high until the total trading power equals the total power owned by the sellers. In contrast, if there is a sufficient supply of trading power, the sellers will sell it to any buyer who chooses them. Finally, the sellers will update the remaining total power and inform the buyers to do the same.
If there are still buyers remaining after updating the total power, the remaining sellers will have the opportunity to negotiate with these buyers for the remaining trading power. This negotiation occurs when the sellers can still achieve the highest possible profit, as illustrated in
Figure 6. Occasionally, the sellers may not be selected because their trading price is not sufficiently competitive and appealing. Consequently, they may adjust the trading price based on the remaining total power, as shown in (9), or at least sell the trading power at the lowest price they are willing to trade, i.e., at the price
.
where
is a relatively small positive value and
is the trading price at any iteration
.
Following the conclusion of negotiations, the remaining sellers and buyers continue trading energy until the total power of either party depletes, whether that be an individual depletion or simultaneously. When all of the electricity has been traded, that round of trading on the P2P energy market will conclude.
Finally, if there is no available seller or buyer, untraded sellers or buyers can choose whether to trade energy in the following round on the P2P energy market or on the DSO’s traditional energy market.
5.4. MTP and Corresponding DLMP Determination
The DSO is tasked with assessing the technical impacts on the operations of a distribution system, including the amount of power loss in the distribution system. The total power submitted by sellers and buyers is the only basic data used in the impact evaluation. The goal is to determine whether or not the total power is appropriate for the operations of the distribution system.
Furthermore, due to intermittent sources, such as solar PV systems, the DSO must ensure that the RTP of sellers and buyers does not violate network constraints during power exchange periods. Little research has been conducted to ensure that network constraints are not violated during power exchange periods. Therefore, this paper proposes assigning the DSO to determine the MTP of sellers and buyers, which helps identify the possible total power error levels. This saves the DSO time when evaluating the technical impacts of the power flow in the distribution system.
In the final sequence, the DSO calculates the DLMPs in the event that sellers and buyers sell and buy the MTP with the DSO. These DLMPs are then used to determine NUCs when sellers and buyers trade the MTP to recoup the DSO’s operational cost.
The optimization problem, as shown in (10), is formulated to calculate the MTP and corresponding DLMP of sellers and buyers as follows:
subject to
where
is assumed to be the slack bus,
and
are constant, and
is the price at which the DSO is willing to trade power with sellers (if
: buy-back rate (BBR)) and buyers (if
) at the slack bus [
33,
34].
In optimization problem (10), the relationship between nodes and energy trading is expressed in (11) and (20) for sellers, and (12) and (21) for buyers. Specifically, if the seller connects to bus and submits the trading power equal to , then for . Conversely, if the buyer connects to the bus and submits the trading power equal to , then for .
In this paper, the equality constraints (13) and (16) represent the bus active power and reactive power at bus , where neither a seller nor a buyer connects. This type of bus is called an intermediate bus. For this reason, they can be written as for and for , respectively. As for the equality constraints (14) and (15), they refer to the bus reactive power at bus , where either a seller or a buyer connects. In this research, it is assumed that both sellers and buyers do not engage in transactions involving reactive power, and the power factors in the form of the power angles and for each seller and buyer are assumed to be constant. Specifically, the seller can either supply or absorb reactive power from the distribution system, whereas the buyer can only absorb reactive power. With the relationship , they can be written as for and for , respectively.
The decision variables of the optimization problem (10) are the scaling factors and , as well as the voltage angles and magnitudes. The MTP of sellers and buyers can be determined by evaluating how much maximum power generation and load consumption can be injected into and consumed from the distribution system without violating the network constraints. The maximum scaling factors that do not cause the distribution system to violate the network constraints are referred to as the limits of the scaling factors and . For this reason, multiplying the limits of the scaling factors by the total power of the sellers and buyers represents the MTP.
The MTP is calculated separately and not incorporated directly in the seller/buyer optimization problems (1) and (5). This would require considering the two following cases: (1) when the MTP is greater than the total power of participants, and , and (2) when the MTP is less than the total power of participants. In the first case, where the MTP is greater, the total trading power of participants and cannot exceed their MTP, so adding the MTP as a constraint would have no effect on the solutions. Conversely, in the second case, where the MTP is less, the total trading power of participants can be, at most, equal to the MTP, significantly impacting the solutions. However, analyzing the solutions would be straightforward because the objective function is linear in the variables of trading power and . For example, the trading power of participants could be proportionally reduced until the total trading power equals the MTP. Adding the MTP as a constraint would therefore limit the ability of participants to optimize their benefits.
The dual variables or Lagrange multipliers corresponding to the equality constraints (11) and (12) represent the DLMPs corresponding to the MTP of sellers and buyers, respectively [
35,
36]. Solving the optimization problem using all of the decision variables and the Lagrange multipliers concurrently could take a considerable amount of time. Consequently, this paper divides the process of solving the optimization problem into two steps: first, determining the limits of the scaling factors along with the voltage angles and magnitudes, then substituting them into the optimization problem in order to determine the Lagrange multipliers.
A proposed algorithm for determining the MTP of sellers and buyers Is depicted in
Figure 7. First, a parameter
is created, which is a ratio between the scaling factors
and
, as shown in (24).
Following this, the parameter is given a value greater than zero. The scaling factor is set to 1, and the scaling factor is set in accordance with (24). After determining a set of the initial values, a power flow analysis is performed to examine the voltage magnitudes at all buses and the apparent power flowing through all distribution lines. If all of the values are within acceptable ranges, the scaling factors and are updated.
The updated scaling factors are converted to the total power of sellers and buyers. Then, the power flow analysis is repeated to ensure that all voltage magnitudes and line apparent powers are within the acceptable ranges. When one of the values examined in the power flow analysis falls outside of the ranges, the iteration for updating the scaling factors terminates.
Since the updated scaling factors at the final iteration are meaningless, the scaling factors before the final iteration are used to increase the searching order to obtain more accurate answers. The higher the order, the more precise the answer, but the longer it takes to calculate. The difference between the updated scaling factor at the final iteration and the previous iteration indicates the correct answers. It must be sufficiently small.
In this paper, sellers receive the same scaling factor
, and buyers receive the same scaling factor
. This is performed in order to achieve equality in terms of the amount of power used in trading, i.e., not to depend on the bus location of sellers and buyers in the distribution system. Furthermore, the parameter
is evaluated for a variety of values, such as from 1 to 7, in the study of the network constraints, the voltage and line capacity limits. The scaling factors
and
are determined using traditional methods, as demonstrated in [
9,
26]. However, these scaling factors may lack practical accuracy, especially when considering the uncertainty associated with PV generation and load consumption. To address this issue, this paper provides a more practical and accurate method of determining the MTP of sellers and buyers on P2P energy trading markets. This proposed method involves plotting the scaling factors against the parameter on a graph, thus allowing the determination of the limits of the scaling factors
and
of sellers and buyers, respectively. This ensures that none of the network constraints are violated during power exchange periods. Because the proposed algorithm employs an iterative method and displays results for each iteration via graph plotting, it aims to analyze trends and identify patterns in the most suitable solutions. It is acknowledged that each iteration may or may not result in a solution. Using the graph plotting method, on the other hand, has advantages in studying emerging patterns. The advantages of studying the emerging patterns, which are used in this paper, include trend predictions and decision-making adjustments.
After the scaling factors, the voltage angles, and magnitudes are obtained, the corresponding DLMPs can be determined by substituting the scaling factors as well as the voltage angles and magnitudes into the constraints and solving the optimization problem (10). Because the optimization problem belongs to the multivariable nonlinear programming problem, it can be solved in MATLAB with the fmincon optimization toolbox solver (version R2022b). This step takes less time because the decision variables are already known. The corresponding DLMPs of sellers
and buyers
can be expressed as in (25) and (26), respectively.
As illustrated in (25) and (26), the DLMPs of sellers and buyers are calculated as changes in power loss, voltage magnitude, and line apparent power with respect to the power injected or consumed at the same bus. The results of DLMPs are similar to [
37].
The strength point of the proposed method is that the DLMPs of sellers and buyers can be simplified when the limits of the scaling factors are applied because the voltage and line capacity limits are not violated, i.e.,
,
,
, and
are zero. If this is the case, the expressions of the DLMPs of sellers and buyers can be written as shown in (27) and (28).
When it comes to power exchange periods, the DLMPs
and
corresponding to the ATP
and
and the DLMPs
and
corresponding to the MTP
and
are used to estimate the DLMPs
and
corresponding to the RTP
and
using linear estimation, as shown in (29) and (30).
The calculation of the DLMPs corresponding to the RTP saves the DSO time during the exchange of trading power because sellers and buyers can calculate their own DLMPs based on the RTP. In addition, their RTP must be less than their MTP; otherwise, distribution system failure is probable.