1 Introduction

The lack of direct controllability of the renewable energy sources (RESs) is the main hindrance to the increase of RES penetration in smart grids. Demand side managements (DSMs) through consumption adaptation (load shifting and/or shedding) and the exploitation of energy storage systems (ESSs) offer the two most promising approaches able to mitigate the unpredictability that high RES penetration creates. Under this perspective, the energy service providers (ESPs) enhance their revenue models (RMs) from the simple trading of energy (between wholesale/day-ahead and retail market), to allow them to trade also with flexibility markets. In a typical flexibility market, ESPs offer flexibility through the use of DSM/ESS while electricity grid operators, e.g. transmission system operators (TSOs) or distribution system operators (DSOs) demand flexibility through congestion, balancing and other types of flexibility markets as surveyed in [1]. In order to achieve these, traditional utilities are evolving to competitive ESPs by exploiting digital platforms and advanced information and communication technology (ICT) infrastructure [2]. At the same time, ESPs are continuously searching for new revenue streams towards the dynamic optimization and automation of their stacked RMs [3]. In the rest of this paper, by the term “stacked revenues”, we mean the sum of the ESP’s revenues from both the retail and flexibility markets. On the network operators’ side, TSOs and DSOs are also increasingly willing to purchase flexibility services from ESPs in order to mitigate the congestion and balance problems in their transmission and distribution networks.

Nowadays, flexibility needs mainly arise in the form of ancillary services and are mostly served by large producers/consumers in the industrial sector. However, network operators have already started to interact with ESPs that aggregate and manage small and medium scale distributed energy resources (DERs) in order to provide flexibility services [4]. Subsequently, future ESPs will be able to act as flexibility service providers (FSPs) and enter flexibility markets through their ability to: dynamically obtain the flexibility market prices, e.g. compensation for each unit of energy being reduced, and interact with their consumers in an efficient way in order to influence dynamically through their retail pricing schemes, the aggregated energy consumption curve (ECC) of their consumers.

All the above-mentioned trends necessitate the evolution of the existing energy retail pricing schemes in order to include the by-design stacked RM rationale, so as to dynamically adapt to the prices and the objectives of flexibility markets, and the dynamic and heterogeneous flexibility levels of the consumers.

The main objectives of the retails pricing schemes (acting also as DSM algorithms) are among others [5]: ① the maximization of users’ satisfaction/welfare, ② the maximization of ESP’s profits, ③ the minimization of aggregated energy consumption and/or system costs, etc. The combination of these objectives and an attractive trade-off among them is a challenging research problem. In this paper, we focus on the ESP’s business objective, which is to find the optimal trade-off between the maximization of its profits, while keeping the welfare of its customers above pre-defined thresholds (or else minimizing the churn rate in the context of a competitive retail market environment).

In the context of SOCIALENERGY [6, 7], we focus on the development of innovative business models for ESPs and their automated and optimal operation through an ICT platform [8]. In our previous work, we exploit communities of end users and their social interaction [9, 10] in order to trigger behavioral changes in energy consumption. Incentivized from all the above and by evolving the logic and the architecture of the recent pricing schemes found in the literature, this paper presents:

  1. 1)

    A novel pricing scheme architecture, referred to as flexibility real-time pricing (FRTP), which allows progressive ESPs to simultaneously participate in multiple energy markets e.g. day-ahead and real-time markets, and maximize their aggregated profits dynamically by harvesting the heterogeneity of the flexibility levels of consumers, and providing them with incentives in a fair and efficient way.

  2. 2)

    The dynamic tuning of FRTP parameters according to the flexibility level of the end users (their sensitivity in financial incentives) and the prices of these markets towards an efficient trade-off between user’s welfare and ESP’s profits.

  3. 3)

    A holistic comparison between FRTP and a conventional real-time pricing (RTP)-like pricing scheme, which is a pioneering pricing scheme and is usually used as benchmark in the literature. According to the results, FRTP realizes a better trade-off between user’s welfare and ESP’s profits, while simultaneously providing fairness to the end users.

The remainder of this paper is organized as follows. In Section 2, we present the related work and outline the differences of our proposed scheme. Section 3 presents the model used in the proposed system. In Section 4, we present the FRTP scheme and describe its properties. Section 5 provides performance evaluation results for the FRTP scheme and comparisons with an RTP like pricing scheme. Finally, Section 6 concludes and provides directions for future work.

2 Related work

DSM is considered as the most cost-effective and reliable solution for the smoothing of the demand curve, when the system experiences imbalances. In particular, several DSM schemes have been proposed to motivate changes in the customers’ power consumption habits, in response to price-based incentives [5]. Moreover, many electric utilities, ESPs and regulators around the globe increasingly rely on behavior change programs, as essential parts of their DSM portfolios and innovative business modeling. Based on [11], the existing behavior change programs are classified in three main categories: information, social interactions, and education programs. EU-funded H2020 SOCIALENERGY project [6] is a multi-disciplinary S/W platform combining features from all three categories targeting the customer segment of ESPs [7]. In this paper, we focus on the ESP side and wish to automate the business process of finding the optimal trade-off between maximizing its profits and minimizing the churn rate. FRTP is proposed as a tool for ESPs to design and operate their innovative combined RMs from participation in both retail and flexibility markets.

ESPs act as mediators between the wholesale and retail electricity markets. Therefore, they should carefully design their buying-selling trade-off and optimize their electricity portfolio. Their decision-making process aims at minimizing costs from purchasing energy in the wholesale markets and maximizing revenues from selling this energy back to the end consumers [7]. The main problem lies in that the ESP’s profit margins are gradually reduced as a result of its participation in the retail market mainly due to increasing competition. To cope with this issue, ESPs can realize additional revenue streams by participating in flexibility markets, such as the ones surveyed in [1]. Actually, ESPs can play an active role in the emerging flexibility value chain [12] and this flexibility value is expected to continuously increase within the next years [3, 4].

There are a few recent works that model the optimal selling strategy of aggregated demand side flexibility units and ESP’s participation in multiple sequential markets. More specifically, [13] proposes an agent-based model that combines both spot and balancing electricity markets. They present a stacked RM for the ESP trying to minimize the extra energy system costs incurred by flexibility markets. In contrast, in our proposal, the objective is to find the optimal trade-off between the ESP’s profits and the aggregated users’ welfare (denoted as W). In [14], a methodology is proposed for optimal bidding for a flexibility aggregator participating in three sequential markets, i.e. flexibility reservation market, spot market for day-ahead or intra-day dispatch and a flexibility market for near-real-time dispatch. The results are empirical, based on a real aggregator’s business, showcasing the three different revenue streams, and no optimization problem is studied. Moreover, our previous work in [15] studies the ESP’s participation in both day-ahead and balancing markets and tries to optimally adapt the ESP’s strategy towards maximizing its profits (or else maximizing the value of flexibility and the value of aggregation). However, in the present work, we formulate the problem in a completely different way and we also take into consideration the W in the optimization problem. In [16], the ESP’s participation in two markets, namely the forward market and the spot market, is modeled trying to maximize its profits without consideration of W and its participation in near-real-time flexibility markets. The authors in [17] propose a pricing scheme that aggregates the flexibilities of end users for the participation of aggregators in flexibility markets. However, the proposed pricing scheme does not consider stacked revenue concept and it cannot be optimized in real time according to the flexibility market prices and the user flexibility level. Finally, many works deal with RTP, which is a state-of-the-art pricing scheme. RTP connects directly the actual energy production, transmission and distribution costs with the retail energy price, which is also dynamically adapted in real time, e.g. at 15-min intervals. On the other hand, RTP schemes still suffer from the tragedy of the common phenomenon [18]. This is because a consumer who changes her ECC (behavioral change in energy consumption) thus creating a benefit for the whole system, gets back in the average case only a small portion of the financial benefit created, as the gain is shared among all the consumers. Thus, these pricing schemes are not fair and do not allow the efficient interaction between flexibility and retail markets. The most related and pioneering works in RTP are [19,20,21,22]. In [19], the objective of the proposed RTP scheme is the minimization of energy cost and maximization of user’s satisfaction, but the latter metric does not contain the financial reimbursement of the end users , i.e. user’s welfare. The work in [20] tries to maximize ESP’s profits with respect to the system cost, without caring about W. Reference [21] tries to maximize social welfare, which is ESP profits minus total energy cost, but it also does not take into consideration W. Finally, [22] studies the system cost efficiency versus fairness trade-off (or else minimum energy cost, but in a fair way for all users). However, in this paper, we deal with the ESP profits versus W trade-off, which is more important from the ESP’s business point of view.

3 System model

Figure 1 illustrates the whole framework within which the ESP can realize revenues from both retail and flexibility markets. In particular, the ESP purchases energy in advance, e.g. day ahead, from the wholesale market at a time- and volume-variant cost (denoted as G) to satisfy the demand of its customer portfolio. Then, typically, ESP sells this energy to its consumers in the retail electricity market at a higher price per unit in order to realize profits. However, another way for the ESP to realize profits from the retail market is to persuade its customer portfolio through a price-based DSM scheme to change the pattern of their aggregated ECC in real-time according to the needs of real-time markets, e.g. flexibility markets. In this way, the ESP will be able to acquire revenues from flexibility markets and subsequently realize more profits.

Fig. 1
figure 1

System model of FRTP

Flexibility offers are demanded by network operators (TSOs/DSOs) and balance responsible parties (BRPs) through flexibility markets, e.g. balancing/congestion markets. These markets are complex but we can assume that they offer a price \(L_{\textit{BRP}}\) for each energy unit that is reduced. The flexibility price may change over time according to the flexibility demand, e.g. as conditions in the underlying network change. In addition, ESP offers to its consumers another price \(L_{\textit{ESP}}\) for each energy unit that is curtailed.

Under this context, the income of an ESP is derived from the flexibility markets and the sum of the bills B of its consumers, i.e. stacked revenues from flexibility and retail market. The expenses of an ESP are the energy costs it pays in the wholesale market. The difference between income and expenses constitutes its profit. Various ESPs co-exist in a liberalized and competitive market. Thus, their objective is to apply a pricing scheme, which is able to dynamically optimize the trade-off between their profits and the W, which is the sum of the welfare of their users. A user’s welfare is a quantity \(F_i(x)\) that valuates how much a user i appreciates an energy consumption of x units of energy \(u_i(x)\) minus the bill (charges) for this consumption \(b_i(x)\). Without harm of generality, a user i consumes the energy x that optimizes her \(F_i(x)\).

Consequently, the objective of the ESP is to set the users’ bills in a way that maximizes its profits without reducing the W below the level of the competition. The ESP has to dynamically select the optimal combination of \((\pi ,L_{\textit{ESP}})\), i.e. its profit percentage \(\pi\) and the fraction of flexibility market profits returned back to the users \(L_{\textit{ESP}}\). Moreover, the ESP should care about the fairness of its pricing scheme, meaning that all end consumers should realize bill discounts according to each one’s contribution to the whole system cost benefits, denoted by \(\Delta G\).

In this paper, we formulate a single ESP’s profit maximization problem taking into consideration its clients’ welfare. In other words, we basically solve a Stackelberg game in which the ESP is the leader and its clients are the followers. It is a situation of asymmetric information in which the leader anticipates the reaction of the followers to his decisions, but the followers take the leader’s decisions as exogenous parameters. In case multiple ESPs competing with each other in the market, the problem would be to find the Nash equilibrium among multiple leaders of a Stackelberg leader-follower problem, where there is a shared follower (pool of potential clients). Each ESP solves an optimization problem subject to a Nash equilibrium among its clients (equilibrium conditions). Finally, the problem of finding the equilibrium among the competing ESPs is an equilibrium problem with equilibrium constraints (EPECs). There are a few algorithms that are used in the literature to solve EPECs, e.g. diagonalization algorithm, but their convergence to the global optimum is not guaranteed and it is outside the scope of this paper.

4 Problem formulation and proposed FRTP scheme

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.

4.1 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.

4.2 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.

4.3 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.

4.4 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)
figure a

4.5 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.

figure b

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.

5 Performance evaluation results

In this section, we evaluate our proposed FRTP scheme, compared to a well-known RTP algorithm. We consider a system consisting of \(N=100\) energy consumers and simulate a period of one day. The consumption values used were obtained by open source dataset of the SOCIALENERGY project  [34]. Unless otherwise stated, we set \(c=0.02\) in the energy cost generation function of (2) as [21, 22, 28]. Consumers are divided into four categories, low, medium, high, mixed, based on their flexibility levels according to similar studies [23,24,25]. In low flexibility, noted as S1, parameter \(\omega\) in (1) ranges uniformly from 9 to 16; in medium flexibility, noted as S2, ranges uniformly from 4 to 11; in high flexibility, noted as S3, ranges uniformly from 0.5 to 7 while in mixed flexibility, noted as S4, ranges uniformly from 0.5 to 10. In order to evaluate the proposed system, we use the following key performance indicators (KPIs), also widely accepted in similar studies [22, 29].

  1. 1)

    ESP profit according to (10) which is the sum of consumers’ bills (retail market) plus the revenues from flexibility market minus the cost of energy in the whole sale market.

  2. 2)

    W is given according to (11), and intuitively expresses the competitiveness of an ESP that adopts a billing strategy in an open retail electricity market.

  3. 3)

    ESP energy cost (\(EC_{ESP}\)) is the cost of ESP to acquire the electricity needed to fulfill the requirements of its customers. It is expressed as:

    $$EC_{ESP}=G_k-B_f$$
    (18)

In (18), \(B_f\) is calculated through the use of \(\Delta x\), which is the difference between the amount of energy that would have been consumed in case of no DSM, the aggregated energy consumption as would have been derived if pricing was determined from (5), and the amount of energy that consumed in case that pricing was FRTP.

  1. 4)

    Behavioral reciprocity \(BR_i\) of user i is the degree of correlation between the behavioral change of i and the reward that i gets for it:

    $$BR_i = \frac{D_i^A}{D_i^R} \quad \forall i \in N$$
    (19)

where \(D_i^A\) represents the discount achieved, i.e. the system cost curtailment, for user i; and \(D_i^R\) represents the discount received by i, i.e. the difference between bill of user i with the original system state \(x_i^t=\overline{x}_i^k, \forall i \in N\) and the actual user state (after applying RTP or FRTP). This is expressed mathematically as:

$$D_i^A \nonumber= \left( 1 + \pi \right) \left[ \left( \overline{x}_i^k - x_i^t \right) \frac{ G\sum \limits _{i=1}^N{\overline{x}_i^k} - G\sum \limits _{i=1}^N{x_i^k} }{ \sum \limits _{i=1}^N{\overline{x}_i^k} - \sum \limits _{i=1}^N{x_i^k} } + L_{\textit{ESP}} \right]$$
(20)
$$\begin{aligned}&D_i^R = \overline{x}_i^k \frac{G\left( \sum \limits _{i=1}^N{\overline{x}_i^k}\right) }{ \sum \limits _{i=1}^N{\overline{x}_i^k} } \left( 1 + \pi \right) - B_i^k \end{aligned}$$
(21)

5.1 Optimal FRTP (Algorithm 2) under various flexibility market prices

In this scenario, we examine how various values of flexibility market prices (\(L_{\textit{BRP}}\)) as modeled in Section 4.2 affect the trade-off between profit and W. In order to clarify this, optimal FRTP is compared to RTP. In this scenario participate users with flexibility from category mixed, while other parameters are \(L_{\textit{BRP}} = \{0.25, 0.50, 0.75, 0.95\}, \pi \in [0,1]\).

Fig. 2
figure 2

Profit of ESP versus W for optimal FRTP and RTP for multiple prices in flexibility market

In Fig. 2, the ESP’s profit (10) is depicted as a function of W (11). Note that the W values are always negative, due to the format of the user’s welfare function (1). For all \(L_{\textit{BRP}}\) values, the optimal FRTP gives much more profits to the ESP for the same W level or else optimal FRTP has much higher W levels for the same ESP’s profits. Thus, the optimal FRTP algorithm will constitute the ESP much more competitive than another that exploits RTP. The continuous lines are above dashed lines of the same color and this testifies that FRTP delivers a more attractive trade-off than RTP between profits and welfare of user as promised. In addition, from Fig. 2, we observe that as \(L_{\textit{BRP}}\) increases, the ESP’s profits increase for a given level of W, for both RTP and optimal FRTP. This is expected, as this increases the income of ESP, which is distributed back to the consumers, in order to increase W.

Moreover, as the \(L_{\textit{BRP}}\) increases, the difference between RTP and optimal FRTP increases, too. Since this parameter is defined as the price per unit for flexibility. Thus, as this price increases, demand response becomes more lucrative and causes the optimal FRTP to perform even better.

Figure 2 also shows that for higher W values and lower ESP profits, the difference between the RTP and optimal FRTP becomes more prominent. This indicates that optimal FRTP is an ideal solution for low-profit/high W scenarios, which are what we expect to be usually realized in competitive environments (liberalized markets) and in energy cooperatives, i.e. RESCOOPs [35, 36].

Finally, if we observe the points the lines cross the x-axis, we can see that when the profits are marginal (zero), which represents extreme competition, W is vastly different. For example, the maximum welfare for RTP with \(L_{\textit{BRP}} = 0.25\) is about $-460000, but for optimal FRTP it is about $-410000. For \(L_{\textit{BRP}}=0.95\), the difference is even larger with RTP and optimal FRTP crossing the axis at about $-430000 and $-290000, respectively. This constitutes optimal FRTP with extremely competitive.

5.2 Optimal FRTP (Algorithm 2) under various user flexibility levels

In this scenario, we examine how different flexibility levels (S1, S2, S3) affect the optimal FRTP performance compared to RTP. In other words, the impact of the sensitivity of end users to financial incentives is analyzed. In this scenario, \(L_{\textit{BRP}} = 0.5\).

Fig. 3
figure 3

Profit versus W between optimal FRTP and RTP for multiple levels of consumer’s flexibility

Figure 3 depicts the ESP’s profit as a function of W. For all flexibility scenarios, optimal FRTP performs much better than RTP in the trade-off between ESP’s profits and user’s welfare, just like observation in Fig. 2. In addition, we can see that as the flexibility of the users increases, the ESP’s profit also increases for every level of W. This is expected because flexible users by definition can achieve higher levels of demand curtailment without affecting their welfare too much. This is observed for both RTP and optimal FRTP. Another observation to be made is that the difference in performance between RTP and optimal FRTP is greater for lower flexibility levels, indicating that the advantages of optimal FRTP may be realized even when the users are not too flexible. This can be justified by the fact that for highly flexible users, even RTP can achieve reasonable performance. On the other hand, when the flexibility is limited (a case more difficult and closer to real life scenarios), the optimal FRTP offers the greatest advantages, as it is capable of utilizing any flexibility potential that is available in the ESP’s portfolio.

5.3 FRTP insights (Algorithm 1) through a study of the ESP’s profits under various rewarding levels

In this scenario, we examine how different levels of consumer’s rewarding affects the ESP. In this scenario, fixed FRTP (Algorithm 1) parameters have been used, in order to simplify previous cases, in contrast with optimal FRTP which is able to identify the optimal parameters. This is done in order to highlight a few insights for the proposed pricing architecture. For this evaluation study: the price of the flexibility market each time instant is \(L_{\textit{BRP}} = 0.5\); level of users’ flexibility is set to mixed category; and rewarding level of the consumers is set to \(L_{\textit{ESP}} = \{0.4, 0.5, 0.6, 0.7\}\). For each evaluation metric, the ESP’s profit percentage \(\pi\) ranges from \(0\%\) to \(100\%\) (\(\pi \in [0,1]\)). Figure 4 presents a comparison between FRTP and RTP regarding the aggregated ESP’s profits under various values of \(L_{\textit{ESP}}\). We observe that for each value of \(\pi\), FRTP achieves significantly higher profits for \(L_{\textit{ESP}}\) values 0.4, 0.5 and 0.6, when it is compared to RTP. In this case, consumers are not incentivized enough from the ESP in order to reduce their consumptions. As a result, fewer profits from the flexibility market are shared among consumers according to their energy sheds. On the other hand, even for larger \(L_{\textit{ESP}}\) values, higher profit values are achieved for the ESP during FRTP execution when it is compared with RTP.

Fig. 4
figure 4

ESP profits comparison between FRTP and RTP for multiple values of \(L_{\textit{ESP}}\)

Figure 5 presents a study for the W in FRTP and is compared with the W in RTP for multiple values of \(L_{\textit{ESP}}\). As \(\pi\) increases, W decreases for each case scenario. In particular, as \(L_{\textit{ESP}}\) increases, W also increases, approaching the W of RTP. In this case, lower \(L_{\textit{ESP}}\) values mean that less profit is returned back to consumers for their sheds, resulting to lower user welfare values. In general, if we co-examine Figs. 4 and 5, we observe that a decrease in W of 20%–40% (Fig. 5), that FRTP offers, leads to an increase in profits by 100%–200% (Fig. 4), which testifies the high superiority of FRTP in this trade-off. In case of optimal FRTP, this trade-off is much better as Figs. 2 and 3 depicted.

Fig. 5
figure 5

W comparison between FRTP and RTP for multiple values of \(L_{\textit{ESP}}\)

Figure 6 presents the final consumption achieved as a function of \(\pi\). FRTP is compared to RTP for multiple \(L_{\textit{ESP}}\) values. As the \(\pi\) value increases, the total consumption decreases for both FRTP and RTP. This is expected, as the ESP pushes its consumers to reduce their energy through the increase in prices. On the other hand, as \(L_{\textit{ESP}}\) increases, energy sheds increase because higher benefit incentives are provided by the ESP. The FRTP scheme achieves significantly better energy reductions compared to RTP as consumers have incentives to minimize their consumptions. According to these incentives, an effect in side of FRTP is that it promotes energy efficiency.

Fig. 6
figure 6

Final consumption comparison between FRTP and RTP for multiple values of \(L_{\textit{ESP}}\)

Figure 7 depicts the ESP energy cost as a function of \(\pi\). A comparison between FRTP and RTP for different values of \(L_{\textit{ESP}}\) is depicted. As it is presented, the energy cost decreases as the \(\pi\) value increases. Furthermore, as \(L_{\textit{ESP}}\) increases, the ESP incentivizes consumers to reduce their consumptions by minimizing in this way the wholesale market energy cost and thus leading to lower ESP energy costs. As a result, another effect in side of FRTP is to reduce the costs of energy which creates in its turn more financially autonomous communities in the long term.

Fig. 7
figure 7

ESP energy cost comparison between FRTP and RTP for multiple values of \(L_{\textit{ESP}}\)

Figure 8 depicts the aggregated consumer bills (as defined in (4)) as a function of \(\pi\). It presents a comparison between the FRTP and RTP algorithms for multiple levels of \(L_{\textit{ESP}}\). As observed, \(L_{\textit{ESP}}\) values of 0.4 and 0.5 lead to higher and increasing billing results compared to RTP. In this case, the ESP increases the bills of the consumers in order to have highest profits from the retail market. On the other hand, \(L_{\textit{ESP}}\) values of 0.6 and 0.7 lead to lower and decreasing billing results compared to RTP. In this case, the ESP does not increase billing results in order to maximize its revenues from selling energy directly, but instead derives most of its profits from the flexibility market. This is the way that FRTP achieves higher profits for the ESP by offering in the same time higher user welfare. In addition, it is revealed here the necessity for the design of optimal FRTP. Thus it is addressed in an automatic way and optimize the trade-off between ESP’s profits and user welfare which is demonstrated in Fig. 2.

Fig. 8
figure 8

Consumer bills comparison between FRTP and RTP for multiple values of \(L_{\textit{ESP}}\)

Figure 9 depicts the cumulative distribution function (CDF) of the behavioral reciprocity (19) which expresses fairness and is analyzed at the beginning of evaluation section between the FRTP and RTP algorithms. This relationship is depicted under various levels of user flexibility (sensitivity levels of users to financial incentives). The flexibility levels that represent the three scenarios of this figure are analyzed at the beginning of Section 5. In a nonprofit and totally fair pricing scheme, the CDF of the behavioral reciprocity would be a vertical line in 1 which means that the account that each user achieved is equal with the discount that each user received. In case of profitable business models, the vertical line will be moved to right in an average degree equal with the ESP’s profit percentage. From Fig. 9, it is testified that for all the scenarios, FRTP has a much more vertical CDF than RTP, which means much higher levels of fairness. It is obvious from this figure that FRTP is much more fair than RTP for every level of user’s sensitivity. This improvement is vast in case of high sensitivity/flexibility.

Fig. 9
figure 9

CDF of BR for multiple categories of flexibility between FRTP and RTP

6 Conclusion

This paper presents the FRTP scheme, which offers a dynamically adjustable level of financial incentives to participating users, by fairly rewarding the users who make desirable behavioral changes in the way that they consume electricity. In this way, the proposed pricing scheme exploits its high levels of fairness in order to offer an attractive trade-off between the stacked profits of the ESP and the satisfaction of the end users. The proposed FRTP is able to be tuned dynamically according to: the business environment (level of competition); the conditions in wholesale and flexibility markets; and the flexibility levels of the end users. Thus, the performance evaluation results demonstrate that FRTP is very competitive in all the environments. In our future work, we plan to extend FRTP in a way that considers also energy shifts and scenarios in which the desired energy consumption is unknown.