In this section, the proposed FRTP scheme is described in detail. Initially, we describe two assumptions that are made in our model. The first assumption is that users’ desired energy consumptions/ECCs (i.e. natural/voluntary/unforced consumption of a user, in the absence of incentivized time varying penalties or rewards and before the behavioral changes that FRTP will incentivize) are priori known. Through discussions that we had with industrial partners in the context of SOCIALENERGY project [6] there are use cases in which truthful report of the planned energy can be assumed such as: ① houses which are automated with equipment (e.g. smart plugs) from their ESP, ② working environment in which the management knows the energy needs of the workers, ③ direct contract between ESPs and a big industrial client with large and standard energy consumption. There are also major use cases in which truthful report of desired energy cannot be assumed, e.g. today’s residential energy consumers, or users may want to cheat the system, and we leave for future work the design of a pricing scheme that applies to this case. The second assumption is that end users perform only energy cuts. We recognize that there is also the case of energy shifts, and we leave for future work the design of a pricing scheme that applies to this case.
The rest of this section is structured as follows. Firstly, we present the user model that will be used in order to evaluate FRTP, which is based on defining a utility function \(u_i(x)\) for each user i. We note that, FRTP is transparent to the choice of the utility function and it can be used when this is known (a specific choice of the utility function is used only for evaluation purposes). Secondly, we present the models of the wholesale market and the flexibility market that we use in order to evaluate FRTP. Again, we note that FRTP can also be used in markets using different models. Thirdly, we present a conventional RTP-like scheme that will be used in order to compare and evaluate FRTP. Following that, we proceed to present and analyze the FRTP model and the proposed dynamic scheme which is called optimal FRTP.
User model
The convenience of user i at time interval k is expressed through a utility function \(u_i^k(x_i^k, \omega _i^k)\), measured in monetary units (assuming utilities quasi-linear in money). This is a function of the user’s consumption \(x_i^k\) and its so-called flexibility parameter \(\omega _i^k\). Intuitively, \(u_i^k(x_i^k, \omega _i^k)\) expresses how much user i values/appreciates (in monetary/economic terms) consumption \(x_i^k\) at time instant k. This utility function is adopted from microeconomics theory [17, 23,24,25] and is a widely accepted method for the evaluation of pricing models in smart grids [26, 27]. The general form of the utility function is taken to be the same for each user i at time instant k. However, the varying parameter \(\omega _i^k\) distinguishes different user and time preferences. It is natural to assume that the utility function \(u_i^k\) is a concave and increasing function of \(x_i^k\), with a slope affected by and \(\omega _i^k\), and with a constant maximum value after a saturation point (related to \(\overline{x}_i^k\)), which is expressed analytically as:
$$u_i^k(x_i^k, \omega _i^k) = u_{\max } - \omega _i^k (\overline{x}_i^k - x_i^k)^2$$
(1)
where \(x_i^k \le \overline{x}_i^k\) and \(u_{\max }\) is constant for each user i at each time instant k. Note that the utility function of user i is maximized for \(x_i^k = \overline{x}_i^k\), that’s why the \(\overline{x}_i^k\) is referred to as the desired consumptions. Consumption higher than \(\overline{x}_i^k\) does not cause any more utility or any less inconvenience to the user. Without loss of generality [22], only one continuous, dispatchable and positive load for each user i is assumed, representing the sum of the dispatchable/curtailable consumptions of all her electric appliances at time k.
Wholesale and flexibility market models
In order to model wholesale markets, many relevant works [20,21,22, 28] assume an increasing convex function \(G_k\) to (approximately) model the energy generation cost. In our performance results, we use a quadratic energy cost function:
$$G \left( \sum _{i=1}^N x_i^k \right) = c \left( \sum _{i=1}^N x_i^k \right) ^2$$
(2)
where \(G(\cdot )\) is the energy cost function; N is the set of ESP’s consumers; and c is a predetermined parameter that depends on the energy generators’ characteristics. The cost of the ESP to purchase the necessary energy units from the wholesale electricity market is the marginal generation cost of energy which is given by:
$$M \left( \sum _{i=1}^N x_i^k \right) = 2 c \sum _{i=1}^N x_i^k$$
(3)
where \(M(\cdot )\) is the marginal generation cost of energy equation (3) comes as the derivative of (2). Thus, in the case of a vertical ESP (an ESP that disposes energy generators and sells directly to end users without a market clearing in the middle), the cost of energy could be modeled from (2) and in the case of this existence of a wholesale market from (3). In both cases and without harm of generality, the form of the function through which ESPs buy energy is the same and it is noted from now on as \(M_k\) for a time instant k.
Without harm of generality, in order to model flexibility markets, recent works [17] assume that the revenues \(B_f^k\) that ESPs acquire from them at each time instant k, are proportional to the consumption curtailment \(\Delta x\) that they trigger, which is simplistically given by:
$$B_f^k(\Delta x) = L_{\textit{BRP}}^k \Delta x$$
(4)
where \(L_{\textit{BRP}}^k\) is the price of the flexibility market at each time instant k.
RTP
Existing RTP models [20, 29, 30] calculate the prices in each time instant k through the following iterative process. Users initially set their desired consumptions. The first step is to calculate the price per energy unit that ESP pays to the wholesale market as follows:
$$p^k = \frac{G_k}{\sum \limits _{i=1}^N x_i^k}(1 + \pi )$$
(5)
In the second step, the users adjust their consumption \(x_i^k\) as a response to the price \(p^k\) in order to maximize their welfare. The welfare of user i at k is defined as:
$$F_i^k = u_i^k(x_i^k,\omega _i^k) - p^k x_i^k$$
(6)
Thus, in RTP, the energy scheduling problem at a time instant k is defined as the optimization in a selfish way from each consumer of her/his actual energy consumption according to the energy cost \(G_k\). In this way, the profit of the ESP/retailer is determined.
FRTP
As analyzed earlier, the intuition behind the development of FRTP is to give incentives to consumers to participate in flexibility market by rewarding them with a percentage of the energy cost curtailment that they trigger. In order to achieve this, let us assume that the desired energy consumption of each user i at k is \(\overline{x}_i^k\). The total energy cost in this case is \(\overline{G}_k = G \left( \sum \limits _{i=1}^N \overline{x}_i^k \right)\), and will be distributed as discount D to the end users in N:
$$D = \left( G \left( \sum _{i=1}^N \overline{x}_i^k \right) - G \left( \sum _{i=1}^N x_i^k \right) \right) L_{\textit{ESP}}$$
(7)
As analyzed later, \(L_{\textit{ESP}}\) expresses the percentage of the energy cost curtailment which the ESP exploits to reward its users, in order to incentivize them to change their behavior. Thus, it is logical that \(L_{\textit{ESP}} \in [0,1]\). Subsequently, the bill in FRTP of each user i at time instant k, noted as \(B_i^k\), could be expressed as:
$$B_i^k =\frac{\overline{x}_i^k}{\sum \limits _{i=1}^N \overline{x}_i^k}\overline{G}_k - \frac{\overline{x}_i^k -x_i^k}{\sum \limits _{i=1}^N \left( \overline{x}_i^k - x_i^k \right) }D$$
(8)
In addition to these bills, in case that ESP wants to realize more profits, it can multiply each bill with a factor \(1+\pi\). Thus, the previous equation becomes:
$$\begin{aligned} B_i^k = \left[ \frac{\overline{x}_i^k}{\sum \limits _{i=1}^N \overline{x}_i^k}\overline{G}_k - \frac{\overline{x}_i^k -x_i^k}{\sum \limits _{i=1}^N \left( \overline{x}_i^k - x_i^k \right) }D \right] (1+\pi ) \end{aligned}$$
(9)
It is again logical that \(\pi >0\) because of the competition in the open markets and we consider the case of \(\pi > 1\) as unrealistic. Thus, in this work \(\pi \in [0,1]\).
According to (10), in the case that an ESP selects the values of \((\pi ,L_{\textit{ESP}})\), Algorithm 1 calculates the energy consumption (\(x_i^k\)) and the bill (\(B_i^k\)) of each user i at k. According to these (at time instant k), the profits of the ESP, noted as \(P_k\), are given from (10) and the W is given from (11).
$$P_k= \sum _{i=1}^N B_i^k + B_f^k - G_k$$
(10)
$$W_k= \sum _{i=1}^N u_i^k - \sum _{i=1}^N B_i^k$$
(11)
Optimal FRTP
The next objective of FRTP is the dynamic optimization for each time instant k of the values \((\pi ,L_{ESP})\) in two common use cases which are: ① \(P_k\) in (10) of the ESP must be bigger than a limit (threshold) that ESP sets according to its financial sustainability/policy; ② \(W_k\) in (11) must be larger than a threshold that the competition of an ESP sets (churn rate minimization). Algorithm 2 describes the proposed algorithm that achieves this and is noted as optimal FRTP.
In more details, the performance of the FRTP algorithm, in terms of the W and ESP’s profits, is dependent on the configuration of the parameters \(\pi\) and \(L_{\textit{ESP}}\). Some \((\pi ,L_{\textit{ESP}})\) combinations may lead to higher values of \(W_k\), but this reduces the ESP’s profitability. On the other hand, other \((\pi ,L_{\textit{ESP}})\) combinations may lead to high profits, but the \(W_k\) of the users may be unacceptable and the service would not be competitive in the retail market. Optimal FRTP is derived from the observation that there exists an optimal \((\pi ,L_{\textit{ESP}})\) combination that can achieve the maximum profit for the ESP (\(P_k\)), for a given \(W_k\) constraint or conversely the maximum \(W_k\) for a given profit constraint. The rationale is that in a competitive environment, each ESP has an interest in maximizing its profits, but if the users’ welfare is reduced too much, they will end their contracts and look for a competitive ESP, causing increased churn rate.
Thus, for optimal FRTP, a lower limit for the targeted W (constraint) is set as an input parameter (first of the two aforementioned cases), and the algorithm searches the \((\pi ,L_{\textit{ESP}})\) space to find the values that maximize the ESP’s profit, without violating the aforementioned constraint. Several optimization mechanisms may be used for obtaining the optimal \((\pi ,L_{\textit{ESP}})\) values given the constraint. Indicatively, Bayesian optimization [32] can be also used for more general functions (in cases that user model is more general and/or unknown and differs from the one that is presented in Section 4.1, but in this case the proposed methodology may suffer from slow convergence). Alternatively convex optimization [31] can be used if the two above-mentioned use cases and user model are assumed, which leads to a convex form of the \(P_k\) in (10) and can converge faster. For the methodology with which the user model parameters are derived, we refer to [17, 26, 27]. For the simulation results in the next section, the convex optimization solver, which has been used is provided by the CVXOPT package [31] in python.
In order to execute optimal FRTP, the numerical result of the objective function (5) to be optimized is required, for given set of input parameters \((\pi ,L_{\textit{ESP}})\). In our case, this function is given by Algorithm 1, which calculates the profit that would be realized if the given parameters were applied. The objective function of optimal FRTP (\(O(\pi ,L_{\textit{ESP}})\)) is described through (12).
$$O(\pi ,L_{\textit{ESP}}) = P (\pi ,L_{\textit{ESP}})$$
(12)
where \(P (\pi ,L_{\textit{ESP}})\) is the profit for given set of input parameters \((\pi ,L_{\textit{ESP}})\). In addition, optimal FRTP requires the constraint \(C(\pi ,L_{\textit{ESP}})\) (which has to be negative by definition) to be defined as the difference of the lower threshold for the W which ESP explicitly sets \(W_{limit}\) minus \(W_k\), as depicted in (13).
$$C(\pi ,L_{\textit{ESP}}) = W_{limit} - W_k$$
(13)
The gradients of the two aforementioned functions are given in (14) and (15). These are calculated numerically using the Gradient function of the numdifftools package [33], using a step of 0.001.
$$\begin{aligned} \nabla O(\pi ,L_{\textit{ESP}})&= \begin{bmatrix} \frac{ \partial O( \pi , L_{\textit{ESP}})}{\partial L_{\textit{ESP}}}\quad \frac{\partial O(\pi ,L_{\textit{ESP}})}{\partial \pi } \end{bmatrix} \end{aligned}$$
(14)
$$\begin{aligned} \nabla C(\pi ,L_{\textit{ESP}})&= \begin{bmatrix} \frac{ \partial C( \pi , L_{\textit{ESP}})}{\partial L_{\textit{ESP}}} \quad \frac{\partial C(\pi ,L_{\textit{ESP}})}{\partial \pi } \end{bmatrix} \end{aligned}$$
(15)
The Hessian matrices of the objective function and the constraint are given in (16) and (17), respectively. These were calculated numerically using the Hessian function of the numdifftools package [33], with a step equal to 0.001.
$$\begin{aligned} \nabla ^2 O(\pi ,L_{\textit{ESP}})&= \begin{bmatrix} \frac{\partial ^2 O(\pi ,L_{\textit{ESP}})}{\partial L_{\textit{ESP}}^2} \quad \frac{\partial ^2 O(\pi ,L_{\textit{ESP}})}{\partial L_{\textit{ESP}} \partial \pi } \\ \frac{\partial ^2 O(\pi ,L_{\textit{ESP}})}{\partial \pi \partial L_{\textit{ESP}}} \quad \frac{\partial ^2 O(\pi ,L_{\textit{ESP}})}{\partial \pi ^2} \\ \end{bmatrix} \end{aligned}$$
(16)
$$\begin{aligned} \nabla ^2 C(\pi ,L_{\textit{ESP}})&= \begin{bmatrix} \frac{\partial ^2 C(\pi ,L_{\textit{ESP}})}{\partial L_{\textit{ESP}}^2} \quad \frac{\partial ^2 C(\pi ,L_{\textit{ESP}})}{\partial L_{\textit{ESP}} \partial \pi } \\ \frac{\partial ^2 C(\pi ,L_{\textit{ESP}})}{\partial \pi \partial L_{\textit{ESP}}} \quad \frac{\partial ^2 C(\pi ,L_{\textit{ESP}})}{\partial \pi ^2} \\ \end{bmatrix} \end{aligned}$$
(17)
In the use case in which the constraint is in the profits instead of the welfare, the same methodology holds. Slight modifications can also lead to a case in which the objective is the optimization (maximization) of a linear combination of them.