Introduction

Load serving entity is a retailer or distribution utility that procures energy from wholesale electricity markets to sell it to its consumers. LSE makes optimal decisions for energy procurement and sale prices to maximise its profit and minimise associated risk. The risk in wholesale market trading arises from volatile and uncertain spot market prices [1]. Varying but flexible consumer demand and renewable energy (RE) penetration makes this a challenging problem for LSE. LSE offers dynamic prices to manage flexible demand [2]. In response to the offered dynamic prices, consumers alter/ optimise energy consumption to minimise their energy bill. This optimisation by consumers influences LSE’s energy procurement decisions and eventually, its profit and risk management strategies. While making such risk-based decisions, variability and availability of RE generation creates challenges for its efficient utilisation.

LSE maximises its profit by minimising procurement cost and maximising revenue from electricity sale [1]. Generally, LSE performs various types of forward contracts to eliminate the possibility of high procurement cost arising from unknown future variations in spot market prices [3]. This restricts LSE’s ability to buy at a lower cost when spot market prices are low. As spot prices are uncertain, it introduces variability in procurement cost, which needs to be minimised while making procurement decisions. Financial risk posed by uncertain spot prices necessitates understanding LSE’s behaviour, considering its risk preferences [3]. For such analysis, Conditional Value at Risk (CVaR) is the most advanced and well-adopted risk measure [3,4,5,6]. LSE’s revenue can be maximised by offering optimal fixed or time-varying/ dynamic sale prices. Time of use (ToU) and real-time pricing (RTP) are the most popular variants of time-varying pricing schemes [7,8,9].

For LSE’s profit maximisation, the consumer’s price responsive behaviour is often modelled by the price quota curve (PQC) or market share function (MSF) [3, 4]. Consumers’ responsiveness to sale price change is modelled by price elasticity of demand [4, 10]. However, these approaches cannot capture consumers’ response to sale prices when consumers receive sale price information a day or few hours prior to energy consumption. Dynamic prices such as dynamic ToU and RTP signals are communicated well ahead of real-time. Consumers make their consumption decision rationally rather than based on price elasticity, to minimise energy bill [11]. Consequently, LSE’s decisions would change with modified consumer demand. A hierarchical decision-making framework can effectively model consumer behaviour in response to offered sale prices under a bi-level programming-based approach [12].

In bi-level entirety, two conflicting objectives, LSE’s profit maximisation and consumers’ energy bill minimisation, become a joint optimisation problem [13, 14]. Consumers’ optimisation problem is expressed in the lower level of the bi-level programming model. Suppressing/shifting of consumer’s flexible demand modifies its welfare associated with comfort/utility cost. Considering flexible demand and sale prices, consumers trade-off between energy bill minimisation and welfare/comfort maximisation [11, 14]. Consumers being sensitive to (sale) price change, seek to minimise energy bill irrespective of discomfort [15]. Such LSE’s decision-making problems are considered for short or medium-term planning horizon.

LSE’s decision-making problem is expressed in the upper level of the bi-level model. For short-term planning, LSE manages energy procurement from spot and regulation markets [11, 14]. For medium-term planning, LSE manages forward contracts portfolio along with procurement from spot market [3, 16]. Additionally, distributed generation (DG) including RE as procurement options would influence LSE’s sale price and procurement decisions, and eventually its profit and risk management strategy [15, 17, 18]. LSE’s sale price and procurement decision-making problem under hierarchical framework are investigated targeting optimal utilisation of thermal DG [15]. However, it neglects demand shifting modelling, which is important to exploit economic benefits for both LSE and consumers [18]. Decision of residential consumer is modelled at the appliances level by incorporating typical operational cycle of these appliances [19]. Such a model requires accurate and detailed historical information of each consumer’s energy consumption. With a focus on electric fleet, RTP prices are determined by clustering demand profile [20]. Multiple consumer classes such as plug-in electric vehicles and residential consumers are considered together in LSE’s decision-making [21]. Consideration of the classes together is practically unacceptable as it leads to the same sale prices for both classes, irrespective of their different demand profile. Though dynamic sale prices in a bi-level framework are determined, spot price uncertainty and risk modelling are neglected [22]. LSE can target an assured level of uncertainty to maximise its profit, considering the fractile model [23]. However, this consideration cannot minimise the impact of profit risk.

Spot market and bilateral contracts are imperative sources for energy procurement in LSE’s decision-making. RE sources can be considered as self-generation to supply a part of electricity. RE characteristics of availability and intermittency may potentially impact LSE’s decision-making. RE being zero-cost energy sources, static ToU prices are determined using PQC [8]. Notably, static ToU prices remain stable for a longer duration and are communicated at lower frequencies [19]. Focus of this work is to determine dynamic sale prices for rational consumers. In a bi-level framework, RE’s investment cost is considered to highlight its impact on fixed sale prices [24]. For such analysis, spot price risk and consumer behaviour modelling, which significantly impacts sale price dynamics, are neglected. As a whole, the impact of RE on dynamic sale price optimisation in a hierarchical decision-making framework is yet to be investigated. Moreover, for such investigation, analysis on procurement decisions along with price risk modelling is essential to comprehend the risk-neutral and risk-averse behaviour of LSE.

In this context, the proposed work presents a hierarchical decision-making model to determine optimal dynamic sale prices and energy procurement decisions for an LSE. This considers consumers’ flexible demand under RE availability and spot market price uncertainty. RE cost is considered to optimise dynamic sale prices. The influence of rational consumers’ price responsive behaviour on LSE’s profit maximisation is considered by bi-level optimisation. Spot market, bilateral contracts, and self-generation are considered for procuring electricity. Thermal generation unit and RE are considered as self-generation. Risk of spot market prices is modelled by CVaR approach to determine risk-based strategies for LSE. Formulated bi-level optimisation problem is transformed into an equivalent single-level problem using the classical Karush-Kuhn-Tucker (KKT) approach. Obtained non-linear formulation is linearised by auxiliary variables and strong duality theory. Results from the proposed model help LSE to decide its procurement and selling price strategies, and consumers to determine their optimal consumption pattern.

In this view, key contributions of the paper are

  • Dynamic sale prices determination considering RE availability and flexible demand in hierarchical decision-making framework

  • Optimal dynamic sale price determination on an hourly basis to manage consumers’ flexible demand

  • Modelling of hierarchical decision-making framework under spot market price risk using CVaR to comprehend risk-neutral and risk-averse decisions of LSE.

LSE’s Decision-Making Framework

This work considers energy trading by a retailer or distribution utility as LSE’s operation. LSE determines optimal energy procurement and dynamic sale prices to be offered to consumers in the medium-term, to maximise its profit. Considered LSE is responsible for supplying only energy and does not operate distribution networks. Hence, LSE’s economic operation is only targeted in this work. LSE procures energy from the wholesale electricity market through bilateral contracts and spot market. A part of its energy requirement is procured from available thermal and RE self-generation. Uncertainty of spot market price introduces volatility in procurement cost, eventually making the profit risky. LSE aims to minimise profit risk according to its risk aversion level. Hence, a risk-averse decision-making model in addition to risk-neutral model for LSE is considered. Further, consumers can adjust their consumption based on offered sale prices. This price-responsive behaviour of consumers influences LSE’s decision-making problem. Thus, consumers as decision-makers optimise their consumption pattern to minimise energy procurement cost (energy bill) based on offered sale price dynamics. The decision-making problem consists of two decision-makers (LSE and consumers), each trying to optimise their respective objectives, subject to respective constraints. LSE’s decision-making problem is formulated as a bi-level programming problem, as illustrated in Fig. 1.

Fig. 1
figure 1

Bi-level decision-making problem

The upper-level of bi-level problem describes LSE’s risk-based profit maximisation. To analyse LSE’s risk-averse behaviour, trade-off between risk and profit for LSE has been modelled using CVaR. The lower level of bi-level is consumers’ cost minimisation problem. Both LSE and consumers optimise their objectives over a jointly dependent set.

The bi-level optimisation problem is solved by transforming it into an equivalent single-level problem. For this, the lower level problem is replaced with its KKT optimality conditions. The KKT condition appears as Lagrangian and complementarity slackness constraints in the equivalent single-level optimisation problem. The resulting problem is non-linear, which is linearised by introducing auxiliary variables and strong duality theory.

It is considered that the aggregated outcome from RE would be provided to LSE. RE generation uncertainty consideration is avoided due to aggregation [25]. However, the impact of RE variability and spot market prices is high; hence both are considered in dynamic sale price determination. This work also assumes that consumers respond rationally to the dynamic prices offered by LSE.

Bi-Level Mathematical Formulation

The proposed bi-level problem discussed in “LSE’s Decision-Making Framework” section is mathematically formulated in this section.

Upper Level: LSE’s Problem

LSE’s trade-off problem, i.e., profit maximisation and risk minimisation, subject to procurement and sale price constraints, is mathematically formulated in the following subsections.

Procurement Cost

Total cost for energy procurement in hour t is equal to the sum of energy cost from bilateral contracts \( {C}_t^{bc}, \) thermal generating units \( {C}_t^{TG} \), renewable generation \( {C}_t^{PV} \), and spot market \( {C}_t^S \).

$$ {Cost}_t^{total}={C}_t^{bc}+{C}_t^{TG}+{C}_t^{PV}+{C}_t^S $$
(1)
  1. (a)

    Bilateral contract

LSE signs bilateral contracts with electricity suppliers. It procures energy at a mutually agreed price \( {\lambda}_{i,t}^{bc} \) for a specified time t from ith bilateral contract. Energy procurement cost incurred due to bilateral contracts in hour t is given by (2). Constraint (3) imposes minimum and maximum energy procurement limits from individual bilateral contracts if the contract is exercised as indicated by a binary variable δi, t.

$$ {C}_t^{bc}=\sum \limits_{i\in I}{P}_{i,t}^{bc}{\lambda}_{i,t}^{bc} $$
(2)
$$ {P}_i^{min}{\delta}_{i,t}\le {P}_{i,t}^{bc}\le {P}_i^{max}{\delta}_{i,t} $$
(3)
  1. (b)

    Self-generation

LSE utilises available distributed energy resources (DER) as a procurement option. Conventional thermal generation and renewable generation from solar photovoltaic (PV) systems are considered as available DER facilities to LSE. At time t, total energy procured from self-generation \( {P}_t^{SG} \) would be equal to energy procured from thermal and PV generation (4).

$$ {P}_t^{SG}=\sum \limits_{g\in G}{P}_{g,t}+{PV}_t^{sch} $$
(4)
  1. (i)

    Thermal generation

The operational cost of thermal generation \( {C}_t^{TG} \) considers fuel cost, start-up and shut down costs. Cost of thermal self-generation is

$$ {C}_t^{TG}=\sum \limits_g\left({Cost}_{g,t}^F+{c}_{g,t}^{su}+{c}_{g,t}^{sd}\right) $$
(5)

The fuel cost of thermal generating units is modelled by a quadratic function and is given by (6). Piece-wise linearisation of cost function is shown in Appendix 1. This linearisation is required to formulate a linear bi-level problem.

$$ {Cost}_{g,t}^F={a}_g{\left({P}_g^{min}\right)}^2+{b}_g{P}_g^{min}+{c}_g{u}_{g,t}+\sum \limits_k{s}_{g,k}{P}_{g,t,k} $$
(6)

\( {C}_t^{TG} \) is subject to the following constraints

$$ {c}_{g,t}^{su}\ge {C}_g^{su}\left({u}_{g,t}-{u}_{g,t-1}\right)\kern4.07em \forall g,\forall t $$
(7)
$$ {c}_{g,t}^{sd}\ge {C}_g^{sd}\left({u}_{g,t-1}-{u}_{g,t}\right)\kern4.05em \forall g,\forall t $$
(8)
$$ {P}_{g,t}-{P}_{g,t-1}\le {R}_g^u{u}_{g,t}\kern5em \forall g,\forall t $$
(9)
$$ {P}_{g,t-1}-{P}_{g,t}\le {R}_g^d{u}_{g,t-1}\kern4.25em \forall g,\forall t $$
(10)
$$ \left[{X}_{g,\mathrm{t}-1}^{ON}-{T}_g^u\right]\left[{u}_{g,t}-{u}_{g,t-1}\right]\ge 0\kern1.4em \forall g,\forall t $$
(11)
$$ \left[{X}_{g,\mathrm{t}-1}^{OFF}-{T}_g^d\right]\left[{u}_{g,t-1}-{u}_{g,t}\right]\ge 0\kern1.8em \forall g,\forall t $$
(12)
$$ {P}_g^{min}{u}_{g,t}\le {P}_{g,t}\le {P}_g^{max}{u}_{g,t}\kern3.7em \forall g,\forall t $$
(13)
$$ {c}_{g,t}^{su},{c}_{g,t}^{sd}\ge 0\kern8.64em \forall g,\forall t $$
(14)
$$ {u}_{g,t}\in \left[0,1\right]\kern9em \forall g,\forall t $$
(15)

Constraints (7) and (8) decide start up and shut down cost of generating units. Constraints (9) and (10) decide ramp up and ramp down limits. Minimum up and down time of generating units is given by constraints (11) and (12). Minimum & maximum generation limits are decided by constraint (13). (14) is a non-negativity constraint. (15) is a variable declaration constraint.

  1. (ii)

    Renewable generation

RE generation from PV system is considered. Considering the non-dispatchable characteristics of RE, this generation is considered a must run. It provides \( {PV}_t^{act} \)generation. The energy procurement cost from PV systems is considered using (16). This cost recovers the investment cost of PV systems. LSE incurs some cost when it procures RE through contracts. RE cost is considered in this work considering these factors though fuel cost for RE generation is negligible. The value of \( {\lambda}_t^{PV} \) can be mathematically calculated using bottom-up or any other methodology by considering relevant cost parameters of PV systems. Calculation of \( {\lambda}_t^{PV} \) is beyond the scope of the work, and so its value is assumed. Available RE generation could be curtailed during hours of low demand using (17). This constraint is required as available RE generation and demand cannot be matched by the limited flexible demand of consumers.

$$ {C}_t^{PV}={PV}_t{\lambda}_t^{PV} $$
(16)
$$ {PV}_t={PV}_t^{act}+{PV}_t^{cur} $$
(17)
  1. (iii)

    Spot market

LSE considers spot market as one of the procurement options. As future prices in the spot market are uncertain, its forecasted/ expected values are considered. Expected energy purchase cost from the spot market for each hour t is given by (18). This work considers procurement from the spot market only.

$$ {C}_t^S={P}_t^S{\lambda}_t^S $$
(18)

Constraint (19) represents energy balance equation to ensure that energy procured from various sources meets the consumer demand in each hour t. Here \( {L}_t^{act} \) is consumers’ optimised demand, obtained from the lower-level problem.

$$ {P}_t^S+\sum \limits_{i\in I}{P}_t^{bc}+{P}_t^{SG}={L}_t^{act} $$
(19)

Revenue

LSE resells acquired energy to its consumers at a per unit sale price \( {\lambda}_t^{sale} \). Revenue for each time period is determined by (20), subject to constraints (21)–(23).

$$ {Revenue}_t={L}_t^{act}{\lambda}_t^{sale} $$
(20)
$$ {\lambda}_t^{sale}\ge \left(1-{z}_t^{min}\right){\lambda}_t^{nsale} $$
(21)
$$ {\lambda}_t^{sale}\le \left(1+{z}_t^{max}\right){\lambda}_t^{nsale} $$
(22)
$$ \frac{\sum \limits_t{L}_t^{act}{\lambda}_t^{sale}}{\sum \limits_t{L}_t^{act}}\le {\lambda}^{avg} $$
(23)

Constraints (21) and (22) restrict the sale price within a certain percentage of nominal sale price at hour t. The constraint given by (23) is used to impose an upper bound on the sale prices. This constraint ensures sufficient number of low sale prices hours. It also helps to alleviate LSE’s market power [14]. In the absence of (23), LSE’s optimal choice will touch the maximum limit of sale price, i.e.,\( {\lambda}_t^{sale}=\left(1+{z}_t^{max}\right){\lambda}_t^{nsale} \), which seems to be unfair to consumers. It is assumed that LSE and consumers have mutually agreed upon considered minimum, maximum and average sale prices.

Risk Modelling

Spot market prices are highly uncertain and can not be predicted with certainty beforehand during decision-making. Uncertainty of spot prices introduces risk for LSE. This risk in LSE’s energy procurement is quantified and measured using CVaR. Risk measure CVaR is defined as the conditional expectation of losses that exceeds a threshold value: value at risk (VaR). VaR provides the expected maximum loss over a target horizon within a confidence interval. CVaR is computed by taking a weighted average of the losses exceeding VaR values. In this work, historical simulation method of CVaR computation is applied [26]. CVaR computation algorithm is shown in Appendix 2. Risk incorporated by spot market procurement is accounted by (24). \( CVaR\left({\lambda}_t^S\right) \) represents calculated CVaR for per unit procurement for given confidence from the historical simulation method.

$$ {Risk}_t={P}_t^S. CVaR\left({\lambda}_t^S\right) $$
(24)

LSE’s Profit and Risk Trade-off

LSE’s objective is to maximise expected profit and minimise risk imposed by spot prices. LSE determines a trade-off between expected profit and risk considering its risk preferences. This trade-off is formulated based on the CVaR criterion in the upper level of the bi-level problem. LSE’s multi-objective function is formulated by combining profit and risk objectives using a risk weighting parameter β. The value of β describes risk preferences, i.e., risk-averse and risk-neutral behaviour of LSE. Risk-neutral behaviour describes LSE’s concerns for only profit maximisation and is obtained by assigning β = 0. The risk-averse behaviour of LSE indicates its emphasis on risk and is accomplished by assigning higher values of β. The LSE’s multi-objective function is given by

$$ \mathit{\operatorname{Maximize}}\kern1em {Obj}_{LSE}=\sum \limits_tE\left({Prof}_t\right)-\beta \sum \limits_t{Risk}_t $$
(25)
$$ \sum \limits_tE\left({Prof}_t\right)=\sum \limits_t{Revenue}_t-\sum \limits_tE\left({Cost}_t\right) $$
(26)

The first term in (25), E(Proft) represents LSE’s expected profit and is obtained by subtraction of expected procurement cost (1) from revenue generated (20), as given by (26). The second term in (25) represents risk, which is to be minimised.

Lower Level: Consumers’ Problem

Consumers are the second decision-maker of the proposed bi-level problem. Hence, at the lower level, consumers determine their optimal energy consumption based on dynamic sale prices offered by LSE. Consumers received dynamic price signals from LSE. LSE determines these prices in the upper level of the proposed bi-level problem. A group of consumers with similar characteristics can be represented by different classes. For these consumer classes, mathematical formulation remains the same. However, the available flexible demand and nominal demand profiles of these consumer classes will be different. This is reflected in the mathematical model through appropriate factors. Moreover, consumer is aware of its nominal/ initial demand profile and available flexible demand. Consumer objective is mathematically formulated as

$$ \mathit{\operatorname{Minimize}}\kern1em {Obj}_{con}=\sum \limits_t{L}_t^{act}{\lambda}_t^{sale} $$
(27)

subject to constraints

$$ {L}_t^{act}\ge {L}_t{x}^l\kern2em \left({\lambda}_t^{sale}\right) $$
(28)
$$ {L}_t^{act}\le {L}_t{x}^u\kern2em \left({\lambda}_t^{sale}\right) $$
(29)

In (27), \( {L}_t^{act} \) is revised energy demand, which is a decision variable of considered consumer class. Inequality constraints (28) and (29) describe the minimum and maximum limits on consumer demand in terms of their initial demand [14]. These constraints represent a relation between revised demand, initial demand, and available flexible demand of consumers. The minimum and maximum limit on energy (electricity) consumption is determined by multiplying a factor xland xu with initial demand, respectively. These factors represent consumer’s flexible demand in percentage terms. As mentioned before, consumers have information about their initial demand profile and flexible demand. Consumers aim to redistribute their demand to minimise energy bill. Hence, this work considers that consumers do not reduce or suppress their total demand. However, they can shift it to other hours considering their flexible demand while maintaining the total demand at its original value. In other words, the sum of Lover 24 hours equals the sum of \( {L}_t^{act} \). This demand shift is mathematically formulated as (30).

$$ \sum \limits_t{L}_t^{act}=\sum \limits_t{L}_t $$
(30)

Equivalent Single-Level Programming Problem

The bi-level problem formulated for LSE in (1)–(30) can be solved by transforming it to one level. This transformation is done by adding equivalent KKT optimality conditions [27] of lower-level problems (27)–(30) as constraints to the upper-level problem. This includes both necessary and sufficient conditions for optimality [27]. Resultant problem contains complementary and slackness conditions, making it non-linear. The non-linear complementary conditions are replaced by their equivalent linear expressions to make the problem linear.

KKT Optimality Condition for Lower-Level Problem

The KKT optimality conditions are obtained by determining Lagrangian functions for the lower level problem (27)–(30), given by (31) [17, 27]. σ, γt and μt in (31) represent the Lagrange multiplier associated with the lower-level problem constraints (28)–(30), respectively.

$$ {L}_a=\sum \limits_t{L}_t^{act}{\lambda}_t^{sale}-\sigma \left[\sum \limits_t{L}_t^{act}-\sum \limits_t{L}_t\right]-\sum \limits_t{\gamma}_t\left[{L}_t^{act}-{L}_t{x}^l\right]-\sum \limits_t{\mu}_t\left[{L}_t{x}^u-{L}_t^{act}\right] $$
(31)

KKT necessary optimality conditions of the lower level problem are obtained by partial derivatives of the Lagrangian function (31). KKT necessary optimality conditions consist of stationarity (32), dual feasibility (33)–(34) and complementary slackness conditions (35)–(36), respectively. These conditions are in addition to the primal feasibility constraints (28)–(30). Therefore, the lower-level problem is represented by (28)–(30) and (35)–(36). To this end, the bi-level optimization problem is transformed into a non-linear complementary model.

$$ \frac{\partial {L}_a}{\partial {L}_t^{act}}={\lambda}_t^{sale}-\sigma -{\gamma}_t+{\mu}_t=0 $$
(32)
$$ {\gamma}_t\ge 0 $$
(33)
$$ {\mu}_t\ge 0 $$
(34)
$$ {\gamma}_t\left[{L}_t^{act}-{L}_t{x}^l\right]=0 $$
(35)
$$ {\mu}_t\left[{L}_t{x}^u-{L}_t^{act}\right]=0 $$
(36)

Equivalent Linear Expression

The nonlinear complementary slackness conditions (35)–(36) obtained from KKT conditions are linearised by introducing an auxiliary binary variable (wand υt) and a sufficiently positive large constant (M1and M2) [27]. This results in two constraints per complementarity constraints as

$$ {\gamma}_t\le {M}_1{w}_t $$
(37)
$$ \left[{L}_t^{act}-{L}_t{x}^l\right]\le {M}_1\left(1-{w}_t\right) $$
(38)
$$ {w}_t\in \left\{0,1\right\} $$
(39)
$$ {\mu}_t\le {M}_2{\upsilon}_t $$
(40)
$$ \left[{L}_t{x}^u-{L}_t^{act}\right]\le {M}_2\left(1-{\upsilon}_t\right) $$
(41)
$$ {\upsilon}_t\in \left\{0,1\right\} $$
(42)

Constraints (37)–(39) replace (35) and constraints (40)–(42) replace (36).

Product of consumer demand and sale prices, i.e., \( {L}_t^{act}{\lambda}_t^{sale} \) in (27) introduces non-linearity in the problem. Its equivalent linear expression is determined by utilising duality theory. The dual of lower level problem (27)–(30) is obtained and shown in (43).

$$ \mathit{\operatorname{Maximize}}\kern1em \sigma \sum \limits_t{L}_t+\sum \limits_t{\gamma}_t{L}_t{x}^l-\sum \limits_t{\mu}_t{L}_t{x}^u $$
(43)

where σγt and μt are the dual variables associated with the constraints (28)–(30). Optimal solution is obtained by equating primal (27) and dual (43) as

$$ \sum \limits_t{Revenue}_t=\sum \limits_t{L}_t^{act}{\lambda}_t^{sale}=\sigma \sum \limits_t{L}_t+\sum \limits_t{\gamma}_t{L}_t{x}^l-\sum \limits_t{\mu}_t{L}_t{x}^u $$
(44)

It is worth pointing out here that (44) does not connect lower and upper levels. The non-linear term \( {L}_t^{act}{\lambda}_t^{sale} \) in (26) is replaced by its equivalent linear term represented in (44). Eq. (26) can be rewritten as

$$ \sum \limits_tE\left({Prof}_t\right)=\sigma \sum \limits_t{L}_t+\sum \limits_t{\gamma}_t{L}_t{x}^l-\sum \limits_t{\mu}_t{L}_t{x}^u-\sum \limits_tE\left({Cost}_t\right) $$
(45)

Objective function of the equivalent single level problem is obtained by substituting (45) in (26) as

$$ \mathit{\operatorname{Maximize}}\kern1em {Obj}_{LSE}=\sigma \sum \limits_t{L}_t+\sum \limits_t{\gamma}_t{L}_t{x}^l-\sum \limits_t{\mu}_t{L}_t{x}^u-\sum \limits_tE\left({Cost}_t\right)-\beta \sum \limits_t{Risk}_t $$
(46)

The equivalent single-level formulation of the bi-level problem consists of is a Mixed Integer Linear Programming problem (MILP). Objective function (46) is to be maximised subject to procurement (1)–(19), sale price (21)–(23), CVaR (24), consumers constraints (28)–(30), and KKT (32)–(34), (37)–(42).

Case Study

Data

The proposed formulation for an LSE is illustrated via a case study. Historical spot price data from the PJM electricity market are considered for this study [28]. RE generation profile for a solar based PV system in the Pennsylvania region [29] is considered (shown in Fig. 2). A fixed price of 38$/MWh is considered for energy procurement from RE. It is assumed that one thermal self-generating unit is available with LSE. Specification for considered unit is shown in Table 1. It is worth noting that only one thermal generating unit is there to highlight the impact of RE availability. One bilateral contract at 35$/MWh is considered with maximum and minimum procurement limits of 300 MW and 30 MW, respectively. Dynamic sale prices and energy procurement are determined for each hour of a day for LSE.

Fig. 2
figure 2

PV generation profile

Table 1 Self-generation unit specifications

This case study considers one type of consumer class to illustrate performance of the proposed model. The model can be applied to other consumer classes with their respective demand profiles and flexibility. Forecasted demand profile of considered consumer class is depicted in Fig. 3. It is considered that consumers can vary their demand up to 15% of their original demand at each hour. Nominal sale price for any hour is set 5% higher than corresponding spot market price. An average sale price is taken equal to 38 $/MWh. To keep sale prices within a reasonable limit, LSE considers minimum value of sale prices equal to nominal sale prices and the maximum sale price 20% higher than the nominal sale price at each hour.

Fig. 3
figure 3

Consumer demand profile

Statistical Calculations

Expected values of spot market prices for each hour are calculated as a mean of historical data (from 1/12/2016 to 11/03/2017) corresponding to that hour, over the entire planning period. CVaR value for 95% confidence level is computed as per unit value of historical spot market price data. The historical simulation method, as described in Appendix 2, is utilised to obtain per unit CVaR values. Fig. 4 depicts calculated expected spot prices and CVaR values over 24 hours.

Fig. 4
figure 4

Hourly spot price and corresponding CVaR

Simulations

The objective function (46), subject to constraints (1)–(24), (28)–(30), (32)–(34), and (37)–(42) is simulated for different values of risk weighting parameter β to maximise LSE’s profit. The resulting MILP problem has been solved using CPLEX solver commercially available in GAMS® software on Intel®, Core(), i5 CPU, 3.20 GHz and 4GB of RAM system [30]. CPLEX is a high-performance mathematical programming solver for mixed integer linear programming (MILP) [30]. It uses branch and cut algorithm for solving MILP problems. The solution of the proposed problem generates 508 variables and 96 discrete variables. Average execution and computation time to solve the optimisation problem are 0.089 s and 2.88 s, respectively.

Results

Considering LSE’s risk preferences, i.e., risk-neutral (β = 0) and risk-averse (β > 0), results evaluated from simulations are illustrated in Figs. 5, 6, 7, 8 and 9. Highest risk-averse behaviour of LSE is obtained for β = 1.5. Results include dynamic sale prices, optimised consumer demand and energy procurement portfolio.

Fig. 5
figure 5

Dynamics of sale prices

Fig. 6
figure 6

Dynamics of consumers’ optimised demand

Fig. 7
figure 7

Procurement from different options for risk-neutral LSE

Fig. 8
figure 8

Procurement from different options for risk-averse LSE

Fig. 9
figure 9

Efficient frontier

Dynamics of optimised sale prices and flexible consumer demand is shown in Figs. 5 and 6, respectively, for risk-neutral and risk-averse LSE. Curves for sale price and demand labelled with β = 0 and β = 1.5 represent risk-neutral and risk-averse behaviour of LSE. The dynamics of consumers’ optimised demand indicates that consumers modify their energy consumption during each hour to minimise their overall energy cost (Figs. 5 and 6). In other words, consumer response follows the sale price signal offered by the LSE, which provides them with a minimum cost (energy bill). It shifts most of the flexible demand to hours where sale prices are low. This demand shift also incetivizes LSE to procure most of its demand during low market price hours.

Figure 5 shows that the dynamics of offered sale prices for risk-neutral and risk-averse case differs. This difference in sale price dynamics is governed by wholesale prices and spot price risk. As risk-neutral LSE (β = 0) ignore spot price risk, it offers higher value of sale prices at hours when procurement cost tends to be high. However, a risk-averse LSE considers a given level of spot price risk and tries to offer high sale prices at hours when spot price risk is high. In both the cases, LSE does this to shift its consumers’ flexible demand from these hours to other beneficial hours. Consumers respond to these prices, and this results in different consumption patterns for risk-neutral and risk-averse cases (Fig. 6). At certain hours, sale prices are low, though consumers reduce their demand (hours 20, 21 for risk-neutral case). This happens because consumers can benefit by shifting demand to hours when sale prices are comparatively low (hour 15–17) (Figs. 5 and 6).

Energy procurement from the spot market, bilateral contracts, and thermal and RE self-generation obtained for risk-neutral and risk-averse LSE are shown in Figs. 7 and 8, respectively. These energy allocations are determined for corresponding optimised demand of consumers (Fig. 6). Figures 7 and 8 show that risk-neutral LSE procures most of the energy from spot markets, whereas risk-averse LSE procures most of the energy from sources without uncertainty. It can be observed from obtained energy allocation that available RE generation is completely utilised in both cases. This utilisation significantly impacts energy procurement from cost-effective sources during its availability. To decrease overall procurement cost, risk-neutral LSE tries to increase consumer demand during RE availability hours where spot prices are low (Fig. 7). For instance, at hours 13–17, consumer demand increases and is procured from the spot market due to their low prices. LSE offers lower sale prices to consumers to increase consumer demand during these hours (Fig. 5). Risk-averse LSE also tries to increase consumer demand during RE availability hours, to minimise risk imposed by uncertain spot prices. This increases procurement from low uncertainty sources, which is low during RE availability (Fig. 8). LSE offers lower sale prices during RE availability and increases with high risk (Fig. 5).

Figure 9 illustrates the efficient frontier depicting risk-averse behaviour of LSE for different values of β. Frontier implies that for a high value of β, LSE’s expected profit and associated risk decreases. Depending upon the willingness to accept spot price risk, LSE may select decisions corresponding to that. In case the value of βis too high, (following the frontier pattern, it is implied that) it would reduce risk and expected profit to zero, which indicates that LSE’s participation in retail activities is not recommended. This means risk-averse LSE can reduce risk up to a certain level.

Conclusion

This paper models hierarchical interaction between LSE and consumers using bi-level programming. Dynamic sale prices and decisions on energy procurement are determined subject to spot market price uncertainty and RE availability. This hierarchical interaction is modelled using bi-level programming. LSE’s objective of profit maximisation and risk minimisation is considered at the upper level. Consumers’ objective of optimising cost by altering its consumption pattern is considered at the lower level. Obtained sale prices and procurement decisions are analysed for risk-neutral and risk-averse LSE.

It is observed from the case study that risk-neutral LSE maximises its profit to provide price incentives (low sale prices) to consumers to shift their demand to low spot market prices periods. However, risk-averse LSE provides price incentives when risk is low. Sale price dynamics is also impacted by RE utilisation. Both risk-neutral and risk-averse LSE offer sale prices to increase consumer demand during RE availability duration to utilise RE generation. However, as risk averseness increases, LSE shifts its procurement from risky spot market to risk-free contracts. Thus, LSE effectively utilises RE by actively using consumers’ flexible demand to achieve its objective.

This work is formulated for an LSE, and its market power is alleviated by restricting the sale price. The proposed model could potentially be extended by incorporating multiple LSEs.