arXiv:1612.05971v3 [cs.SY] 21 Mar 2018

An Integrated Optimization + Learning Approach to
Optimal Dynamic Pricing for the Retailer with Multi-type
Customers in Smart Grids✩
Fanlin Menga,d,∗, Xiao-Jun Zengb, Yan Zhangc, Chris J. Dentd , Dunwei Gonge
a School

of Engineering and Computing Sciences, Durham University, Durham DH1 3LE, UK
of Computer Science, The University of Manchester, Manchester M13 9PL, UK
c College of Information System and Management, National University of Defense Technology, Changsha
410073, China
d School of Mathematics, University of Edinburgh, Edinburgh EH9 3FD, UK
e School of Information and Control Engineering, China University of Mining and Technology, Xuzhou
221116, China
b School

Abstract
In this paper, we consider a realistic and meaningful scenario in the context of smart
grids where an electricity retailer serves three different types of customers, i.e., customers with an optimal home energy management system embedded in their smart
meters (C-HEMS), customers with only smart meters (C-SM), and customers without
smart meters (C-NONE). The main objective of this paper is to support the retailer to
make optimal day-ahead dynamic pricing decisions in such a mixed customer pool. To
this end, we propose a two-level decision-making framework where the retailer acting as upper-level agent firstly announces its electricity prices of next 24 hours and
customers acting as lower-level agents subsequently schedule their energy usages accordingly. For the lower level problem, we model the price responsiveness of different
customers according to their unique characteristics. For the upper level problem, we
optimize the dynamic prices for the retailer to maximize its profit subject to realistic
market constraints. The above two-level model is tackled by genetic algorithms (GA)
based distributed optimization methods while its feasibility and effectiveness are con-

✩ ©2018. This manuscript version is made available under the CC-BY-NC-ND 4.0 license
http://creativecommons.org/licenses/by-nc-nd/4.0/. Please cite this accepted article as: Fanlin Meng, XiaoJun Zeng, Yan Zhang, Chris J. Dent, Dunwei Gong, An Integrated Optimization + Learning Approach to
Optimal Dynamic Pricing for the Retailer with Multi-type Customers in Smart Grids, Information Sciences
(2018), doi: 10.1016/j.ins.2018.03.039
∗ Corresponding author. Tel.: +44 131 650 5069; Email: Fanlin.Meng@ed.ac.uk.

Preprint submitted to Information Sciences

March 22, 2018

firmed via simulation results.
Keywords:
Bilevel Modelling, Genetic Algorithms, Machine Learning, Dynamic Pricing,
Demand-side Management, Demand Response, Smart Grids

1. Introduction
With the large-scale deployment of smart meters and two-way communication infrastructures, dynamic pricing based demand response and demand-side management
programs [37] [12] have attracted enormous attentions from both academia and industry and are expected to bring great benefits to the whole power system. For dynamic
pricing, price changes between different time segments. Real-time pricing (RTP), timeof-use pricing (ToU) and critical-peak pricing (CPP) are commonly used dynamic pricing strategies [20]. There are emerging studies on how to design optimal dynamic pricing strategies within the last decade. For instance, a residential implementation of CPP
was investigated in [18] and an optimal ToU pricing for residential load control was
proposed in [10]. An optimal RTP algorithm based on utility maximization for smart
grid was proposed in [36]. More recently, a game theory based dynamic pricing method
for demand-side management was proposed in [39] where different pricing strategies
such as RTP and ToU are evaluated for the residential and commercial sectors.
Many existing studies on dynamic pricing based demand response and demandside management assume that customers are installed with home energy management
systems (HEMS) in their smart meters, i.e. an optimization software which is able to
help customers maximize their benefits such as minimizing their payment bills. For
instance, references [5, 30–32, 44, 48] propose different HEMS for customers to help
them deal with the dynamic pricing signals. Instead of focusing on the single level
customer-side optimization problems, references [9, 28, 33, 43, 45, 46, 49] deal with
how a retailer determines retail electricity prices based on the expected responses of
customers where they model the interactions between a retailer and its customers as a
Stackelberg game or bilevel optimization problem where HEMS are assumed to have
been installed for all customers.

2

In contrast, [19] [29] investigate the electricity consumption behavior of customers
who have installed smart meters without HEMS embedded (C-SM). Even without
HEMS installed, these customers can easily get access to price information and their
electricity consumption data through smart meters, and are likely to respond to dynamic price signals. On the other hand, with smart meters and two-way communication, the retailer is able to identify each customer’s energy consumption patterns based
on history smart meter data. For instance, [19] presents a stochastic regression based
approach to predict the hourly electricity consumption of each residential customer
from historical smart meter data in the context of dynamic pricing. [29] proposes two
appliance-level electricity consumption behavior models for each customer in the context of dynamic pricing with the premise that appliance-level electricity consumption
data at each hour can be disaggregated from household-level smart meter data using
non-intrusive appliance load monitoring (NILM) [17].
In addition to C-HEMS and C-SM, it is also unavoidable that some customers do
not have smart meters installed (C-NONE). Therefore, these customers do not have direct access to electricity prices 1 and their history consumption, and are more likely to
have a relatively low demand elasticity. On the other hand, without smart meters, the
retailer does not have accurate consumption data of each individual customer but only
the aggregated demand data of all customers. As a result, an aggregated demand model
is needed to forecast the total demand of C-NONE. Existing research on aggregated demand modelling in the context of dynamic pricing include artificial intelligence based
approaches [21, 35, 47] and demand elasticity based approaches [15, 22, 26, 40].
Although the above and other unlisted studies have provided valuable insights on
how to model customers’ demand patterns in the context of dynamic pricing and smart
grids, they all consider scenarios where only one single type of customers exist. However, there will be situations when several types of customers with different level of
demand elasticity (e.g., C-HEMS, C-SM, and C-NONE) coexist in the market, espe1 Although

customers of this type could not receive price signals directly due to the unavailability of

smart meters, the electricity price information is usually open to the public through other sources (e.g., their
retailer’s website) and customers of this type might take advantage of this.

3

cially during the transition phase of smart metering and smart grids (e.g., the smart
meter roll-out in UK is expected to finish by 2020 [2]). Considering customer segmentation and differences in pricing has been extensively studied in retail sectors such
as broadband and mobile phone industry [14], but has not received much attention in
energy and power system sector mainly due to the flat price regulation in the electricity retail market and lack of demand flexibility among customers. Nonetheless, with
the liberalization of retail market and the development of smart grids and demand side
management, situations start changing recently. For instance, the importance of considering customer segments has been demonstrated in some recent studies [13] [7]. More
specifically, the benefit of capturing different customer groups with distinctive energy
consumption patterns to the electricity tariff design was firstly described in [13]. Further, [7] proposed an approach to group customers into different clusters (types) based
on their demand elasticity with the aim to design effective demand response programs.
When dealing with a customer pool consisting of different types of customers, the
aggregated demand behavior is a combination of behaviors from distinctive energy user
groups (e.g. C-HEMS, C-SM, and C-NONE considered in our paper) and will be very
complicated. For instance, there will be a lot of energy switch behaviors from C-HEMS
and C-SM who are very sensitive to price changes (i.e. the demand would be an implicit discontinuous function of prices) whereas the demand of C-NONE is much less
sensitive to price signals. Therefore, it is very difficult for existing demand modelling
approaches which are mainly developed for a single type of users to handle the complicated demand behaviors of such a customer pool. To this end, in this paper we propose
a hybrid demand modelling approach by considering the behavior differences among
customers explicitly (i.e. customers of similar behavior patterns are categorized in the
same group). Our proposed approach, which captures more detailed utility information
of a mixed customer pool, can better reflect the demand behaviours in reality, and thus
provide more accurate and well-behavioural demand models for the retailer to make
right pricing decisions.
In terms of bilevel optimization, there are many existing solution methods such as
the commonly used single level reduction method which converts the bilevel problem
into a single level problem by replacing the lower level optimization problem with its
4

Karush–Kuhn–Tucker (KKT) conditions [24, 38]. However, for bilevel problems that
have non-convex and discontinuous lower level problems such as our considered hybrid
optimization+ machine learning problem with mixed (both integer and continuous)
decision variables, the above conventional bilevel methods are infeasible [38] due to the
unavailability of derivative information and the non-convexity of lower level problems.
In such cases, metaheuristic optimization methods such as genetic algorithms, which
are easy to implement and do not require derivative information, are often employed
and have been widely used in energy system modelling studies [6, 25, 34, 41]. In
addition, the intrinsic parallelism of genetic algorithms could be exploited in our future
investigations e.g. by developing parallel genetic algorithms based solutions to take
advantage of distributed and parallel computing facilities. To this end, in this paper we
propose a GA-based two-level solution framework to solve the problem in a distributed
and coordinated manner.
The main objective of this paper is to support the retailer to make best dynamic
pricing decisions in such a mixed customer pool which takes all different types of customers (i.e., C-HEMS, C-SM, and C-NONE) into account at the same time. To the
best of our knowledge, this is the first paper to tackle such a realistic and meaningful demand response problem by considering potential responses of different types of
customers. The main contributions of this paper can be summarized as follows:
• We propose an integrated optimization+ learning to optimal dynamic pricing for
the retailer with a mixed customer pool by considering potential responses of different
types of customers.
• A genetic algorithm (GA) based two-level distributed pricing optimization framework is proposed for the retailer to determine optimal electricity prices.
The rest of this paper is organized as follows. The system model framework is
presented in Section 2. An optimal home energy management system for C-HEMS is
given in Section 3 while two appliance-level learning models for C-SM are presented
in Section 4. In Section 5, an aggregated demand model for C-NONE is presented. A
pricing optimization model for the retailer is provided in Section 6 and GA based twolevel distributed pricing optimization algorithms are presented in Section 7. Numerical
results are presented in Section 8. This paper is concluded in Section 9.
5

Figure 1: Two-level pricing optimization framework with the retailer and its customers.

2. System Model
In this paper, we consider a practical situation where a retailer serves three different
groups of customers (i.e., C-HEMS, C-SM, and C-NONE). The number of above three
groups of customers is denoted as N1 , N2 , and N3 respectively with the total number
of customers denoted as N = N1 + N2 + N3 . The retailer procures electricity from
the wholesale market, and then determines optimal retail dynamic prices based on the
potential responses (when and how much is the energy consumption) of customers,
which can be cast as a two-level decision making framework. The above interactions
between the retailer and its customers is further depicted in Figure 1.
As aforementioned, at the customer-side, for C-HEMS, their installed HEMS represents some optimization software such as to minimize customers’ bills or maximize
their comforts. With the help of two-way communication infrastructure, the retailer is
able to know these customers’ energy consumption responses to dynamic price signals
by interacting with the installed HEMS. As a result, for illustration purposes, we formulate the energy management optimisation problem for C-HEMS by modifying [28]. In
[28], we only consider shiftable and curtailable appliances where the scheduling problem of shiftable appliances is formulated as a linear program, and that of curtailable

6

appliances is represented by a predefined linear demand function. However, in this paper we consider three types of appliances (i.e. interruptible, non-interruptible and curtailable appliances), with a more detailed problem formulation where the consumption
scheduling problems of interruptible and non-interruptible appliances are formulated
as integer programming problems, while that of curtailable appliances is formulated as
a linear program. Nevertheless, other existing HEMS methods such as [32][48] in the
literature should work equally well in this context.
For C-SM, they cannot always find the best energy usage scheduling without the
help of HEMS. However, with the help of non-intrusive appliance load monitoring
techniques (NILM) [17], hourly or even minutely appliance-level energy consumption
data of each appliance can be disaggregated from household-level smart meter data
with high accuracy. As a result, appliance-level energy consumption patterns of each CSM can be identified from history price and consumption data using machine learning
algorithms. To this end, we modify [29] to identify appliance-level energy consumption
patterns for each C-SM. More specifically, in this paper we have removed the price
elasticity of demand constraints considered in [29] for the learning model of curtailable
appliances to simplify the model implementation, as such constraints seem to make no
difference in this particular study.
For C-NONE, they usually manifest a relatively low demand elasticity due to lack
of direct access to real-time price signals. On the other hand, the retailer is unable to
know the accurate energy consumption information of each individual C-NONE. As
a result, to identify the electricity consumption patterns for the pool of C-NONE, an
aggregated demand model is needed. To this end, we adopt the approach proposed in
[26] to identify the aggregated energy consumption patterns of the whole C-NONE.
Different from [26], in this paper we have added a detailed analysis of the adopted
aggregated demand model such as its capability of ensuring a basic market behavior
and enabling the market operator or retailers to see the cross effect of usage switching.
At the retailer-side, with the demand modelling for different types of consumers
established, the pricing optimization problem for the retailer is formulated so as to
maximize its profit. Such a two-level interaction model with hybrid optimization (such
as integer programming for C-HEMS) and machine learning problems (such as proba7

bilistic Bayesian learning) at the customer-side and a quadratic programming problem
at the retailer-side is non-convex and discontinuous. To this end, we propose a GA
based solution framework to solve the retailer-side and customer-side problems in a
distributed and coordinated manner.
It is worth mentioning that we mainly focus on the pricing optimization problem
from the perspective of retailer in this paper. As a result, the benefits of customers are
not discussed to depth in this specific study and readers are referred to our previously
published works for more information [28, 29] [26]. Furthermore, it should be noted
that the obtained optimal dynamic prices will be applied to all types of customers. A
possible extension to the present work is to introduce a differential pricing framework
for the retailer to offer individualized prices to each type of customers. However, to
determine the ‘right’ pricing strategies for different types of customers requires further
research and substantial numerical experiments, which is part of our future work.

3. HEMS Optimization Model for C-HEMS
In this section, we provide the mathematical representation of the optimization
model for customers with HEMS. We define N1 = {1, 2, ..., N1} as the set of such
consumers.
For each customer n ∈ N1 , we denote the set of all the considered appliances as An ,
interruptible appliances (e.g., electric vehicles) as In , non-interruptible appliances (e.g.,
washing machine) as NIn , and curtailable appliances (e.g., air conditioners) as Cn . As
a result, we have An = In ∪ NIn ∪ Cn . Since both interruptible and non-interruptible
appliances can be regarded as shiftable appliances, S n is used to represent such an
union set, i.e., S n = In ∪ NIn .
We define H = {1, 2, ..., H}, where H is the scheduling horizon for appliance operations. Further, let ph denote the electricity price announced by the retailer at h ∈ H. For
each appliance a ∈ An , a scheduling vector of energy consumption over H is denoted
H
as xn,a = [x1n,a , ..., xhn,a, ..., xn,a
] where xhn,a ≥ 0 represents the n-th customer’s energy

consumption of appliance a at time h.

8

3.1. Interruptible Appliances
For each interruptible appliance a ∈ In , the scheduling window for each appliance
a can be set by each customer according to his/her preference and is defined as Hn,a ,
{αn,a , αn,a + 1, ..., βn,a}. Note that the operations of these appliances can be discrete,
i.e., it is possible to charge the EVs for one hour, then stop charging for one or several
hours and then complete the charging after that. It is further assumed that the appliances
consume a constant amount of energy (denoted as xrated
n,a ) for each running time period.
Finally, the payment minimization problem of each interruptible appliance is modelled as follows, which can be solved using existing integer linear programming solvers.
min JIn (a) = min
xhn,a

βn,a
X

ph × xhn,a

(1)

h=αn,a

s.t.
βn,a
X

xhn,a = En,a ,

(2)

h=αn,a

xhn,a ∈ {0, xrated
n,a }, ∀h ∈ Hn,a .

(3)

Constraint (2) represents that, for each appliance a, the total energy consumption to
accomplish the operations within the scheduling window is fixed, which can be found
from the technical specification of the appliance and is denoted as En,a . Constraint (3)
represents that appliance a consumes a constant amount of energy for each running
time period, i.e., xrated
n,a . Note that the actual running time period of an appliance a can
be derived from the vector of optimal energy consumptions, i.e. the appliance is ‘on’
at hour h if the corresponding optimal energy consumption is xrated
n,a . Otherwise, the
appliance is ‘off’.
3.2. Non-interruptible Appliances
For each non-interruptible appliance a ∈ NIn , the scheduling window is defined as
Hn,a , {αn,a , αn,a +1, ..., βn,a}. Different from interruptible appliances, the operations of
each non-interruptible appliance must be continuous, i.e., once the appliance starts, it
must operate continuously till complete its task. Further, the appliances are assumed to

9

consume a constant amount of energy (denoted as xrated
n,a ) for each running time period.
The length of operations for each no-interruptible appliance is denoted as Ln,a .
Finally, the bill minimization problem of each non-interruptible appliance is modelled as follows, which can be solved using existing integer linear programming solvers.
min JNIn(a) = min
δhn,a

βn,a
X

h
ph × xrated
n,a × δn,a

(4)

h=αn,a

s.t.
βn,a
X

δhn,a = Ln,a ,

(5)

δhn,a ∈ {0, 1}, ∀h ∈ Hn,a ,

(6)

h=αn,a

α −1

δn,an,a

= 0,

(7)

τ
δhn,a − δh−1
n,a ≤ δn,a , τ = h, ..., h + Ln,a − 1;

∀h ∈ {αn,a , ..., βn,a − Ln,a + 1}.

(8)

Constraint (5) represents that the total time required to accomplish the operations
of each non-interruptible appliance is predetermined and denoted as Ln,a . (6) indicates
that the decision variable is a 0/1 variable representing the on/off operations of the
appliance and (7) illustrates that the initial state of the appliance is ‘off’. (8) is adopted
to guarantee the continuous operations of the appliance.
3.3. Curtailable Appliances
For each curtailable appliance a ∈ Cn , we define the scheduling window Hn,a ,
{αn,a , αn,a + 1, ..., βn,a}. The key characteristics which make curtailable appliances fundamentally different from interruptible and non-interruptible appliances are: 1) their
energy demand cannot be postponed or shifted; 2) but their energy consumption level
can be adjusted.
In view of this, we define the energy consumption at time slot h for each curtailable
appliance xhn,a . The minimum acceptable and maximum affordable consumption levels,
which can be set in advance according to each individual customer’s preferences, are
defined as uhn,a and uhn,a respectively.
10

Finally, the optimization problem of each curtailable appliance is proposed for each
customer to minimize his/her payment bill subject to an acceptable total energy consumption, which can be solved via existing linear programming solvers.
minJCn(a) = min
xhn,a

βn,a
X

ph × xhn,a

(9)

h=αn,a

s.t.
uhn,a ≤ xhn,a ≤ uhn,a ,
βn,a
X

min
xhn,a ≥ Un,a
.

(10)
(11)

h=αn,a

Constraint (10) enforces that the energy consumption at each time slot is within
the minimum acceptable consumption level uhn,a and maximum affordable consumption level uhn,a . Constraint (11) indicates that for each curtailable appliance, there is a
minimum acceptable total energy consumption during the whole operation periods that
must be satisfied.

4. Appliance-level Learning Models for C-SM
For each customer n ∈ N2 , we define the set of shiftable appliances S n and curtailable appliances Cn .
For notation simplicity, we use s to denote each shiftable appliance and c for each
curtailable appliance. Further, subscript n is omitted in the rest of this section.
4.1. Shiftable Appliances
Denote the scheduling window for each shiftable appliance s as H s , {a s , ..., b s},
where a s is the earliest possible time to switch on the appliance s and b s is the latest
possible time to switch off. Let T s = b s − a s + 1 denote the length of the scheduling
window for s. Assume the available historical smart data for appliance s are electricity
consumption scheduling vectors xs (d) = [xas s (d), xas s +1 (d), ..., xbs s (d)] (d = 1, 2, ..., D),
where xhs (d) (h = a s , a s + 1, ..., b s) represents the electricity consumption during time
slot h by appliance s on day d. Suppose each shiftable appliance runs at a constant

11

power rate, and the total running time and electricity taken for appliance s to accomplish the operations are denoted as L s and E s respectively.
Based on the above historical data of a given customer showing when appliance
s has been used and the corresponding dynamic prices, the basic idea behind this
appliance-level learning model is to calculate the probabilities that appliance s was
used at the cheapest, second cheapest,..., or most expensive price. The above insights
can be represented as (12).
Pis (d) =

fi (d)
d

d = 1, 2, ...D

(12)

where fi (d) represents the number of days when appliance s is used i-th cheapest within
the past d days. Note that the superscript s at the right hand side of the equation has
been omitted for notation simplicity. Let the current day be d and then fi (d) and Pis (d)
can be derived based on historical data up to day d and (12) respectively.
Further, let δi (d + 1) (taking value as 1 or 0) represent the probability that appliance
s is used i-th cheapest on day d + 1 and then it becomes a new piece of information
to be used to obtain Pis (d + 1). As a result, (12) can be rewritten in a recursive way as
follows:
Pis (d + 1) =
= Pis (d) +

fi (d+1)
d+1

1
d+1 [δi (d

+ 1) − Pis (d)].

(13)

The above recursive formula shows that when a new piece of information δi (d + 1)
is received, the updated probability, Pis (d + 1), is equal to the existing probability Pis (d)
plus an adjusting term. The adjusting term includes the adjusting coefficient 1/(d + 1)
and the prediction error term [δi (d + 1) − Pis (d)]. Recall that δi (d) only takes its value
as 1 or 0 in (13), which also means the cost (sum of hourly electricity prices) of each
possible operation schedule for appliance s is different with each other. However,
under some circumstances, many hourly prices are the same within a day and possibly
for many days, which could result in two or more operation schedules having the same
costs such that there are more than one i-th cheapest operation schedules. To overcome
such uncertainties in the price signals, a systematic framework for obtaining δi (d + 1)
under different cases is to be given below.
Firstly, suppose that there are in total k possible operation schedules for appliance
12

s and the cost of each schedule (i.e. sum of the hourly prices) on day d + 1 is c j (d + 1)
where j = 1, ..., k is an unique index for each schedule. Secondly, c j (d + 1) is sorted
in an ascending order. For the cases where there are two or more schedules having the
same cost, these costs are treated as the order they appear in c j (d + 1) ( j = 1, ..., k). As
a result, the cost of m-th cheapest schedule can be denoted as rm (d + 1) (m = 1, ..., k).
Finally, when electricity prices and the usage data of each appliance are received at
the end of day d + 1, δi (d + 1) is calculated based on the following three cases.
• Case 1. s is not operated as the i-th cheapest schedule on day d + 1, then
δi (d + 1) = 0;
• Case 2. s is operated using the i-th cheapest schedule on day d + 1 with the cost
ri (d + 1) which satisfies ri (d + 1) , rm (d + 1) (∀m, m , i), then
δi (d + 1) = 1;
• Case 3. s is operated using the i-th cheapest schedule on day d + 1 with the cost
ri (d +1) but there are k0 additional operation schedules where rml (d +1) = ri (d +1) (l =
1, ..., k0), then
δi (d + 1) =

Pis (d)
.
P0 s
Pis (d) + kl=1
Pml (d)

Based on the above probabilistic usage model Pis , the expected bill of each shiftable
appliance s on a given day can be calculated from the perspective of retailer as follows.

X
s
s
(14)
Bs =
PCi × E s /L s × Pi
i

where

PCis

denote the cost of i-th cheapest schedule PT is on that given day.

Furthermore, the expected hourly energy consumption of each shiftable appliance
s can be calculated as follows.
y s,h =

X

h
E s /L s × Pis × Ii,s

i

h
where Ii,s
is defined as follows:

h
Ii,s




s



1 if h ∈ PT i
.
=




0 if h < PT is
13



(15)

4.2. Curtailable Appliances
The scheduling window of appliance c ∈ Cn is defined as Hc , {ac , ..., bc}. Let


yc,h (d), p̄(d) = yc,h (d), [pac (d), ..., pbc (d)] , d = 1, ..., D be the available historical
input-output data of an unknown demand function, where the input data p̄ = [pac (d), ...,

pbc (d)] represent the price signals during the scheduling window Hc on day d and the
output data yc,h (d) represent the energy consumption of appliance c at time slot h on
day d.
We use a linear demand function to model how a customer responds to dynamic
price signals when using curtailable appliances, which is formulated as follows.
ŷc,h = αc,h,0 + βc,h,ac pac + ... + βc,h,bc pbc

(16)

where ŷc,h represents the expected demand of appliance c at time h, ph is the electricity
price at time slot h, αc,h,0 , βc,h,ac , ..., βc,h,bc are the parameters to be identified.
In this paper, the least square is adopted to estimate model parameters β = [αc,h,0 , βc,h,ac ,
..., βc,h,bc ], where the best estimates β̂ are obtained by solving (17).
β̂ = argmin
β

PD

d=1


yc,h (d) − αc,h,0 − βc,h,ac pac (d) − ... − βc,h,bc pbc (d) 2 .

(17)

Finally, the expected hourly energy consumption of appliance c for a given day, denoted as yc,h , can be predicted based on the above established demand model. Further,
P h
the expected daily bill of c on that day can be represented as Bc =
p × yc,h .
h∈Hc

5. Aggregated Demand Modelling for C-NONE
In this section, an aggregated demand model is proposed to identify the demand
patterns of C-NONE.
Suppose the electricity prices and aggregated consumption data for all C-NONE
in last D days are available. We define the electricity price vector on day d ∈ D ,
h
i
{1, ..., D} as p(d) = p1 (d), ..., ph(d), ..., pH (d) where ph (d) represents the price at hour

h ∈ H on day d. Furthermore, we define the aggregated electricity consumption vector


on day d ∈ D as y(d) = y1 (d), ..., yh(d), ..., yH (d) , where yh (d) represents the aggregated consumption by all C-NONE at hour h.
14

It is believed that the aggregated electricity demand of C-NONE at hour h not only
depends on the price at h but also on prices at other hours due to the cross effect of
usage switching [22] [26]. Therefore the aggregated demand model at hour h can be
expressed as follows:
yh = Rh (p1 , p2 , ..., pH ).

(18)

As the mathematical form of Rh (·) is usually unknown, we need to find an estimated
demand function R̂h (p1 , p2 , ..., pH ) that is as close to Rh (p1 , p2 , ..., pH ) as possible. For
this purpose, we use a linear demand function to represent R̂h (p1 , p2 , ..., pH ) as follows.
R̂h (p1 , p2 , ..., pH ) = αh + βh,1 p1 + · · · + βh,h ph + · · · + βh,H pH .

(19)

where βh,h is called the self or direct price elasticity of demand, which measures the
responsiveness of electricity demand at hour h to changes in the electricity price at h.
When the price at hour h increases but prices at other times remain unchanged, the
demand at hour h typically decreases, and thus the self-elasticity is usually negative
[22] (see (20)). βh,l (h , l) is the cross-price elasticity, which measures the responsiveness of the demand for the electricity at hour h to changes in price at some other hour
l , h. When the price of electricity at hour l increases but prices at other times remain
unchanged, some demand at hour l will typically be shifted to hour h, and therefore the
demand at hour h increases. Thus, cross elasticities are usually positive [22] (see (21)).
Furthermore, we consider an important necessary and sufficient condition (see (22))
for the electricity to be a demand consistent retail product to ensure that the proposed
demand model follows a normal market behavior. That is, when the overall market
price is decreased, the overall market demand should increase or remain unchanged.
βh,h < 0.

(20)

βh,l > 0 if h , l.
X
βh,h +
βl,h ≤ 0

(21)
(22)

l∈H,l,h

It should be emphasized that the important reasons behind using linear demand
models are: 1) As the prices of electricity are normally changing slowly with time, at a
given time, we only need to model the demand around a small price interval or locally.
15

Since any non-linear behavior can be approximated well via a linear model locally,
it is the main reason that linear demand model is widely used in this research area
[26] [4] and selected in this work; 2) with conditions (20) - (22), it ensures the basic
market behavior that demands go down when prices go up and vice versa during the
pricing optimization. However, nonlinear demand models often fail to maintain this
basic market rule and could result in situations such as higher market prices leading
to higher usages. As a result, using such nonlinear demand models in the pricing
optimization could result in incorrect pricing for the retailer; 3) it enables the market
operator or retailers to see the cross effect of usage switching such as customers usually
only shift their usages to nearby hours but rarely to far away hours.
Finally, the demand model parameters βh,l , l = 1, ..., H can be identified by solving
the following optimization problem.
min

PD P H
d=1

h=1

λ(D−d) αh + βh,1 p1 (d) + · · · + βh,H pH (d) − yh (d)

subject to (20), (21), and (22).

2

(23)

where 0 ≤ λ ≤ 1 is the forgetting factor which exponentially discounts the influence
of old data and therefore the model will catch up the behavior change of customers
with time. (23) is a quadratic programming problem and can be solved using existing
solvers.

6. Pricing Optimization for the Retailer
From this section, we restart using the subscript n in all of the following mathematical representations, which has been omitted in Section 4.
We define a cost function Ch (Lh ) to represent the retailer’s cost of providing Lh
electricity to all customers at each hour h ∈ H. We make the same assumption as [31]
that the cost function Ch (Lh ) is convex increasing in Lh , which is designed as follows.
Ch (Lh ) = ah L2h + bh Lh + ch

(24)

where ah > 0 and bh ≥ 0, ch ≥ 0 for each hour h ∈ H.
We denote the minimum price (e.g., the wholesale price) that the retailer can offer
as pmin
h and the maximum price (e.g., the retail price cap due to retail market competi16

tion and regulation) as pmax
h . As a result, we have:
h
max
pmin
h ≤ p ≤ ph .

(25)

A maximum energy supply at each time slot, denoted as Ehmax , is imposed on the
retailer to respect the power network capacity. Thus, we have
Eh =

P P

n∈N1 a∈An

xhn,a +

P

P

n∈N2 s∈S n

yn,s,h +

P

c∈Cn


yn,c,h + R̂h (p1 , p2 , ..., pH ) ≤ Ehmax , ∀h ∈ H

(26)

Due to the retail market regulation, we add the revenue constraint to ensure a sufficient number of low price periods and thus to improve the acceptability of retailer’s
pricing strategies. That is, there exists a total revenue cap, denoted as RE max , for the
retailer. Thus, we have the following constraint 2 :
RE =

P

ph ×

n∈N1 a∈An

h∈H

P

c∈Cn

Bn,c) +

P P

P

xhn,a +

P

(

P

n∈N2 s∈S n

Bn,s+

ph × R̂h (p1 , p2 , ..., pH ) ≤ RE max

(27)

h∈H

Finally, the profit maximization problem for the retailer to optimize the electricity
prices for the next day is modelled as follows:
)
(
P
Ch (Eh )
max RE −
ph

h∈H

(28)

subject to constraints (25), (26), and (27).

7. GA based Solution Algorithms to the above Two-level Model
7.1. Solution Framework
As the proposed two-level pricing optimization problem consisting of the profit
maximization problem for the retailer and integrated optimization+ learning based demand modelling problems for customers is non-convex, non-differentiable and discontinuous, it is intractable for conventional non-linear optimization methods. As a result,
2 It

should be highlighted that such a revenue cap is necessary for the pricing optimization. Since the

electricity is the basic necessity in daily life and fundamentally less elastic, without such a revenue cap, a
retailer could lift its profit significantly by increasing its prices aggressively. However, such a pricing strategy
will anger customers and could lead to political consequences [1]. For such a reason, the revenue cap which
basically is the total customers’ bill cap is necessary to ensure the sensible pricing strategy for a retailer.

17

we adopt a genetic algorithm (GA) based solution methods to solve the problems for
retailer and its customers in a distributed and coordinated manner.
In our proposed genetic algorithms, binary encoding and deterministic tournament
selection without replacement is adopted. For the crossover and mutation operations,
we employ uniform crossover and bit flip mutation respectively. The constraints are
handled by the approach proposed in [11]. Readers are referred to [28] for more details
on our adopted GA.
Finally, the GA based distributed pricing optimization framework are given in Algorithm 1. Moreover, the optimal home energy management algorithm for C-HEMS is
given in Algorithm 2. The appliance-level learning algorithms for C-SM is presented in
Algorithm 3. For C-NONE, the retailer could directly use the established demand models presented in Section 5 to forecast customers’ consumptions. It is worth mentioning
that at the end of each day, the established demand models of C-SM and C-NONE will
be updated based on the newly available prices and usages data of that day. At the end,
the optimal dynamic prices are found for the retailer.
Algorithm 1 GA based pricing optimization algorithm to (28) executed by the retailer
1:

Population initialization by generating a population of PN chromosomes randomly; each chromosome represents a strategy (i.e. prices over H) of the retailer.

2:

for i=1 to PN do

3:

The retailer announces strategy i to customers.

4:

Receive the responsive demand from n ∈ N1 ∪ N2 (i.e., Algorithm 2 and 3).
In addition, the responsive demands from C-NONE are estimated based on the
aggregated demand model proposed in Section 5.

5:

Fitness evaluation and constraint handling [11] to satisfy constraints (25 - 27).

6:

end for

7:

A new generation are created by using deterministic tournament selection without
replacement, uniform crossover and bit flip mutation.

8:

Steps 2-7 are repeated until the stopping condition is reached and the retailer announces final prices to all the customers.

18

Algorithm 2 HEMS executed by each smart meter for C-HEMS
1:

Receive the price signals from the retailer via smart meter.

2:

The smart meter schedules energy consumption based on prices by solving optimization problems in Section 3.

3:

The smart meter only sends back the aggregated hourly demand of the household
to retailer via the two-way communication infrastructure.

Algorithm 3 Appliance-level learning executed by each smart meter for C-SM
1:

Receive the price signals from the retailer via smart meter.

2:

The smart meter calculates the expected hourly energy consumption and daily bill
payment of each appliance based on the learning models proposed in Section 4.

3:

The smart meter sends back aggregated hourly demand and daily bill information
of the household to the retailer via the two-way communication infrastructure.

7.2. Computational Aspects of the Model
The considered bilevel model has a hierarchical structure where the retailer acting
as the upper level agent and customers acting as decentralized lower level agents (for
C-NONE, the problem is solved directly at the retailer side). The subsequent proposed
solution framework solves the problem in a distributed and coordinated manner, where
the retailer determines the prices first and then customers (C-HEMS and C-SM) simultaneously determines their consumptions based on the price signal. Since each customer (C-HEMS and C-SM) is equipped with a smart meter which is assumed to have
the computational capacity to solve its own consumption scheduling problem independently and simultaneously when receiving the price signal, it is believed that increasing
the customer number does not increase the total computation time significantly. Similar conclusions have been reported in [33] where a simulated annealing algorithm is
adopted to solve their upper level pricing optimization problem with independent customers. In addition, a similar solution procedure as ours where the upper level problem
is firstly evaluated via metaheuristic optimization algorithms and the lower level problem is tackled via standard solvers (e.g., integer programming and linear programming
solvers) has been recently reported in [16] and been proved to be effective in solving

19

large scale bi-level problems.
Although promising, it should be noted that bilevel optimization problems are generally difficult to solve (e.g., for the simplest case where both upper and lower level
problems are linear programs, it is proved to be NP-hard [8]) and might face scalability issues in solving very large scale problems. One possible solution to overcome
the scalability issues is to find good initial solutions for the problem by utilizing and
learning from historical data using machine learning algorithms, which can therefore
greatly reduce the number of iterations needed. For instance, in our considered bilevel
problem, due to the daily pricing practice, there are many historical data of past daily
prices and customer responses (consumptions). By going through these data at the retailer side, some approximated optimal prices can be found, which can be chosen as
starting points for GA. As a result, the optimal prices for the next day are likely to be
found within a smaller number of iterations.

8. Simulation Results
In this section, we conduct simulations to evaluate the proposed pricing optimization model with different types of customers. Ideally, we would use observed data from
relevant trials in the simulations, however, not all of them are available. As a result, for
those data which are publicly available (e.g., the electricity price and demand data used
for the aggregated demand modelling [3]), relevant links/references have been cited in
the text. For those data which are not publicly available, we will simulate the required
data (e.g., the dynamic electricity price and consumption response data at the appliance
level used for customer behaviour learning model for C-SM) or provide the required
data directly in the paper (e.g., the parameter settings of appliances for the C-HEMS
models).
8.1. Simulation Set-up
We simulate a neighbourhood consisting of one retailer and three different types
of customers (i.e., C-HEMS, C-SM, C-NONE) where the total number of customers
is set to 100. It is assumed that each customer has 5 appliances: EV, dishwasher,

20

Table 1: Parameters for each interruptible appliance

xrated
n,a

Appliance Name

Ea

Ha

Dishwasher

1.8kWh

8PM-7AM

1kWh

PHEV

10kWh

7PM-7AM

2.5kWh

Table 2: Parameters for each non-interruptible appliance

Appliance Name

Ea

Ha

xrated
n,a

La

Washing machine

2kWh

8AM-9PM

1kWh

2hrs

Clothes Dryer

3kWh

8PM-6AM

1.5kWh

2hrs

Table 3: Parameters for each curtailable appliance

Appliance Name

Uamin

Ha

uha

uha

Air-conditioner

18kWh

12PM-12AM

1kWh

2kWh

washing machine, clothes dryer and air conditioner. Further, a fixed amount (0.05
kWh) of background consumption at each hour is considered for each household. The
scheduling window is set from 8AM to 8AM (the next day). It is worth mentioning
that customers are assumed to be homogeneous due to hardware constraints with the
aim to simply the model implementation process. For details on how to implement a
similar kind of model with heterogeneous customers, readers are referred to [33].
The parameter settings for HEMS optimization models of C-HEMS are given in
Tables 1 2 3. Despite an extensive search, however, we have not found any publicly
available real-world data for real-time prices and consequence demand response at the
individual appliance level, data which are required for our simulation for C-SM. As a
result, the historical usage data used in appliance-level customer behavior learning for
shiftable appliances in C-SM are generated by tuning HEMS optimization models with
waiting time costs [29] whereas the historical usage data for identifying the demand
model of curtailable appliances are simulated based on Section 3.3. For C-NONE,
the aggregated demand model is learned from history electricity price data and down-

21

Table 4: Parameter settings of GA

Parameter Name

Symbol

Values

Chromosome Length

Lg

10 × 24

Population Size

PN

300

Mutation Probability

Pg

0.005

Termination Generation

Tg

300

scaled energy consumption data (i.e., daily consumption of each household is scaled
down to the same amount as C-HEMS and C-SM) between 1 January 2012 and 21
December 2012 of ISO New England [3]. For the retailer, the maximum price and
minimum price at each hour are set to 6.00 cents and 14.00 cents respectively. Further,
the parameters of GA are set as Table 4. More specifically, the chromosome length Lg
is determined based on the value range (i.e. [6.00 cents, 14.00 cents] in our study) and
precision requirement (i.e. two digits after the decimal point) of each decision variable
ph , h = 1, 2, ...24. Since there are in total (14.00 − 6.00)/0.01 = 800 possible values
for each variable ph , at least 10 binary bits (29 < 800 and 210 > 800) are needed to
satisfy the precision requirement of each variable. Therefore, the chromosome, which
represents a vector of 24 decision variables, needs to be (at least) 240 binary bits long
[28]. To set the mutation rate Pg , we start with the standard mutation rate setting (i.e.
1/Lg ≈ 0.0042 in our study), and finally find that a mutation rate of 0.005 works well
for our problem. For the population size, which usually increases with the problem
size (dimensions), we start with the setting used in [11] (i.e. the population size is
set to 10 multiplied by the problem dimension – 240 in our study), and finally find
that a population size of 300 works well for our problem. Considering the problem
complexity, the termination generation is set to 300 to ensure sufficient evolutions of
the GA.
8.2. Results and Analysis
The simulations are implemented in the Matlab R2016b software environment on
a 64 bit Linux PC with Intel Core i5-6500T CPU @ 2.50GHz and 16 GB RAM.

22

Table 5: Combinations of different types of customers for pricing optimization

Case study number

C-HEMS

C-SM

C-NONE

1

0

0

100

2

0

30

70

3

0

100

0

4

30

70

0

5

100

0

0

6

50

30

20

7

0

70

30

8

70

30

0

9

30

60

10

10

20

30

50

We implement the proposed pricing optimization under each case study listed in
Table 5 where the evolution processes of GA are shown in Figure 2. The revenue, cost
and profit of the retailer as well as the CPU computation time under different case studies are given in Table 6. Note that for case studies where C-HEMS and C-SM coexist
(C-NONE are directly handled at the retailer side), the energy consumption problems
of C-HEMS and C-SM under each retailer’s pricing strategy are solved sequentially
in this paper, which leads to a CPU time of around 2000 seconds. However, since in
real applications customers’ energy consumption problems are tackled simultaneously
by each smart meter in parallel, the total computation time is only constrained by the
customers energy consumption problem with the highest computation time and will be
much shorter (i.e. around 1000 seconds for C-HEMS in this study). It is also worth
mentioning that our proposed optimal dynamic pricing for the retailer is updated every
24 hours, and therefore the solution method is sufficiently fast for this purpose.
In addition, it can be found from Table 6 that, if all customers are C-SM, the profit
of retailer will be $120.12 compared with that of $92.12 under 100% C-NONE. In addition, the profit of retailer can be further increased to $124.05 if all customers become
C-HEMS. The above results show that, without increasing its revenue, the retailer can

23

104

1.25

1.2

fitness value

1.15

Case 1
Case 2
Case 3
Case 4
Case 5
Case 6
Case 7
Case 8
Case 9
Case 10

1.1

1.05

1

0.95

0.9
0

50

100

150

200

250

300

generation number of GAs

Figure 2: The evolution process of GA with different penetration rates of smart meter and HEMS.
Table 6: Comparison of revenue, cost and profit of the retailer as well as the CPU computation time under
different case studies

Case study number

Revenue ($)

Cost ($)

Profit ($)

CPU time (s)

1

350

257.88

92.12

9

2

350

249.25

100.75

838

3

350

229.88

120.12

853

4

350

228.89

121.11

2015

5

350

225.95

124.05

1013

6

350

233.47

116.53

1999

7

350

238.14

111.86

838

8

350

227.20

122.80

2013

9

350

231.60

118.40

2010

10

350

242.99

107.01

1997

actually gain more profit with the installation of smart meters and HEMS in households,
which indicates that the retailers are likely to have strong motivations to participate in
and promote the proposed pricing based demand response programs.
24

Furthermore, the optimized electricity prices under several selected case studies are
shown in Figure 3 where the corresponding energy consumption of customers are plotted in Figure 4. It can be found from Figures 3 4 that, compared with that of C-NONE,
the demands of C-HEMS and SM are more responsive to prices, and are effectively
shifted from peak-demand periods (higher prices) to off-peak demand periods (lower
prices). In the case where 3 different types of customers co-exist, the resulted prices
and demands exhibit a mixed and synthesized behavior. For instance, the demand of a
mixed pool of customers under Case 6 is still responsive to price signals but less sensitive than that of C-HEMS (Case 3). In other words, in a realistic scenario like Case 6,
our proposed pricing optimization model can generate profitable electricity prices for
the retailer and lead to a reasonable consumption behavior for customers.
14

Electricity price (cents/kwh)

13
12
11
10
9
8
Case 1
Case 2
Case 3
Case 6

7
6
8AM

11AM

2PM

5PM

8PM

11PM

2AM

5AM

time

Figure 3: Optimal prices for different case studies.

8.3. Emerging Scenarios with PV Generation and Energy Storage
In the following, we consider the availability of PV generation for all types of
customers (e.g., C-HEMS, C-SM, C-NONE) and also battery energy storage for CHEMS. The pricing optimization for the retailer under such emerging scenarios are
investigated in this subsection.

25

500
Consumption under Case 1
Consumption under Case 2
Consumption under Case 3
Consumption under Case 6

450

Electricity consumption (kwh)

400
350
300
250
200
150
100
50
0
8AM

11AM

2PM

5PM

8PM

11PM

2AM

5AM

time

Figure 4: Electricity demand of customers under different case studies.

Suppose that a forecast of PV generation is known as a prior at the beginning of
each day. It is further assumed that PV generation will be firstly used by customers
whereas any surplus will be sold back to the grid at same retail price of that time.
The PV generation data used in this simulation is adopted from [48]. Furthermore,
the revenue cap imposed on the retailer is reduced accordingly from $350 to $270 due
to the availability of PV generation and therefore the reduction of energy demand of
customers. In addition, we assume that C-HEMS use energy storage for price arbitrage
to minimize their energy cost. The energy storage model is adopted from [48] and
we consider perfect charging and discharging, i.e., the charging/discharging efficiency
factor is equal to 1. The battery capacity is considered as 10 kWh and the maximum
amount of energy to be charged/discharged in each time period is constrained to 2 kWh.
Furthermore, the initial and final state of charge (SoC) are set to 80% (i.e., 8 kWh in this
simulation). Note that a full battery energy storage model considering self-discharging
and degradation [42] is out of scope of this paper.
The impact of PV penetration on the retailer is investigated under case studies
shown in Table 5, where the simulation results can be found in Table 7. Compared
with those in Table 6, we can see that the retailer achieves similar profit levels (i.e.,

26

Table 7: Comparison of revenue, cost and profit of the retailer under different case studies with PV generation

Case study number

Revenue ($)

Cost ($)

Profit ($)

1

270

198.64

71.36

3

270

170.66

99.34

5

270

167.29

102.71

6

270

174.63

95.37

Table 8: Comparison of revenue, cost and profit of the retailer under C-HEMS with PV and energy storage

Scenario

Revenue ($)

Cost ($)

Profit ($)

C-HEMS with PV and storage (no selling back)

270

145.45

124.55

C-HEMS with PV and storage (selling back)

270

124.98

145.02

ratio of profit to revenue). The above finding indicates that the profit of retailer is not
significantly influenced by the penetration of PV generation.
Additionally, we study the impact of battery energy storage on the retailer where
customers are C-HEMS. We consider two scenarios for C-HEMS (i.e., with/without the
capability of selling electricity back to the grid) where the profits of retailer are given
in Table 8. The above results reveal two-fold findings: 1) the retailer can improve its
profit with the energy storage penetration in households; 2) the retailer could gain even
more profit if customers (C-HEMS) have the capability of selling electricity back to the
grid. To be more specific, with battery energy storage, customers will have the demand
flexibility where some electricity can be bought at cheap price time periods beforehand and stored in the energy storage units for use in high price periods. As dynamic
prices reflect wholesale prices, the purchase cost of the retailer for such electricity in
the wholesale market will also be low. Without increasing its revenue, the retailer can
increase its profit. In addition, if customers can sell electricity back to the grid, the energy storage charging/discharging operations are no longer constrained by the amount
of electricity customers actually use (i.e. the energy storage units charge/discharge at
higher power rates), which gives customers more demand flexibility. Thus, more electricity can be bought at cheap price time periods beforehand, which on the other hand
27

leads to a lower wholesale electricity purchase cost for the retailer. As a result, without
increasing its revenue, the retailer can gain even more profit. Furthermore, the optimized prices and corresponding storage operations and appliance consumption profiles
in the above two scenarios are illustrated in Figures 5 and 6. It can be easily found out
that the customers with capacity of selling back electricity often charge/discharge the
battery at maximum rate in order to take full advantage of price arbitrage to minimize

15

15

10

10

PV generation
Storage charging-discharing
Home appliances electricity consumption
Electricity supplied by the retailer
optimized prices

5

5

0

Electricity prices (cents/kwh)

Electricity consumption (kwh)

their energy bills.

0

8AM

11AM

2PM

5PM

8PM

11PM

2AM

5AM

time

Figure 5: Storage operation and appliance consumption profile of one household (no selling back).

8.4. Solution Algorithms Comparison
In general, algorithms to solve bilevel problems can be approximated categorized
into three groups: iterative algorithms based on the definitions of bilevel/Stackelberg
equilibriums (e.g.,[27]), KKT based classical mathematical optimization algorithms
(i.e. KKT based single level reduction) and GA type of metaheuristic algorithms [38].
In this subsection, we conduct further simulations to compare our GA based solution
algorithm with the other two types of algorithms.
Firstly, we compare GA with a two-step iterative algorithm [27] on selected representative case studies listed in Table 5. Same as our GA based solution method,
the iterative algorithm is also working in a distributed manner that the retailer and cus-

28

15

10

10
PV generation
Storage charging-discharing
Home appliances electricity consumption
Electricity supplied by the retailer
optimized prices

5

5

0

Electricity prices (cents/kwh)

Electricity consumption (kwh)

15

0

8AM

11AM

2PM

5PM

8PM

11PM

2AM

5AM

time

Figure 6: Storage operation and appliance consumption profile of one household (selling back).

tomers solve their optimization problems sequentially. The description of the algorithm
in the context of our problem setting is given as follows: (1) find an initial feasible price
vector for the retailer; (2) given a price vector announced by the retailer, each customer
solves their energy consumption problem and obtains optimal energy consumption in
response to the price vector; (3) the retailer receives energy consumptions of all customers and treats them as known parameters in the profit maximization model Eq. (28).
Therefore, Eq. (28) becomes a linear programming problem, from solving which the
retailer obtains a new price vector; (4) If the previous two price vectors satisfy the termination criterion (i.e. prices are close enough), the best solution is recorded and the
algorithm is terminated; otherwise, go to step (2).
The solutions obtained by GA and the iterative algorithm are reported in Table 9.
Note that the reported results of the iterative algorithm are based on the best initial conditions among several attempts for each case study. From the results, we can find that
GA outperforms the iterative algorithm in all cases. It is also observed that the iterative
algorithm performs worst in the case where customers are all C-HEMS (mathematical optimization models at the lower level) whereas it performs best in the case where
customers are all C-NONE (analytical electricity demand functions at the lower level).
The above can explained by the fact that the iterative algorithm is a local search based

29

Table 9: Comparison of GA with the iterative algorithm

Case study number

GA

Iterative algorithm

Revenue

Profit

Revenue

Profit

1

350

92.12

350

89.98

3

350

120.12

350

80.05

5

350

124.05

350

73.48

6

350

116.53

350

80.50

heuristic and is more likely to be trapped in the local minima, especially for more complex problems. Instead, GA is a population based meta-heuristic algorithm with global
search characteristics and has more chances to find the global optimal/near-optimal
solutions.
Secondly, we are also interested in knowing how good solutions that our proposed
GA could achieve compared with theoretical optimal or near-optimal solutions, which
are usually obtained by classical mathematical optimization methods such as KKT
based single level reduction method. It should be noted that the KKT based method
solves the bilevel model in a centralized manner at the retailer’s side, by which it assumes that an optimistic bilevel model is adopted, i.e. customers are always expected
to make decisions that lead to the best possible profit of the retailer [38]. Clearly, the
above assumption is strong and therefore the best solutions obtained by the KKT based
centralized method (given that the real optimums are attained) are deemed to be better
than solutions obtained by distributed solution methods considering game behaviours
between the retailer and customers such as our GA based distributed method. Since
the KKT based method requires a well-defined convex and continuous lower level optimization problem, it cannot be directly used to solve our bilevel model. To make
the comparisons achievable, we modify our bilevel model such that only C-HEMS are
considered at the lower level problem. In addition, the integer linear programming
problems of interruptible and non-interruptible appliances of C-HEMS are modified to
linear programs. Finally, the modified bilevel model has a lower level with only linear
programming problems and the KKT based method is implemented in Matlab with the

30

Table 10: Comparison of GA with KKT based single level reduction method

Number of lower

GA

level decision variables

Profit

Profit

Optimality gap

1

63

124.05

124.05

0.0000%

2

1- 2

131

96.76

96.80

0.0000%

3

1- 3

221

127.47

127.53

0.0036%

4

1- 4

296

135.98

135.96

0.0281%

5

1- 5

351

141.62

141.58

0.0344%

6

1- 6

460

134.19

133.74

0.4142%

Test problem

Customer profiles 3

1

KKT

assistance of YALMIP toolbox [23].
In this particular simulation, we consider six different model instances (customer
profiles) of the relaxed C-HEMS model, which are named from C-HEMS-1 to CHEMS-6 respectively. Except for the first customer profile (C-HEMS-1) which is directly adapted from Tables 1 2 3, the other five customer profiles are generated by
adding random numbers to the above settings. Finally, we compare GA with KKT
based method on six test problems as shown in Table 10 . For all the test problems, GA
uses the same settings as Table 4. For KKT based method, we set the relative optimality gap of solvers to 0.01% and also a large amount of computation time to achieve as
best solutions as possible to provide a reliable benchmark.
The simulation results are reported in Table 10, from which we can find that for relatively small-scale test problems such as problems 1-3, KKT based centralized method
could achieve the theoretic optimums or very close optimums with a small optimality
gap. On the other side, GA based distributed solution method can attain the theoretic
optimum for test problem 1 and could also achieve solutions close to theoretic optimums for test problems 2-3. For larger-scale problems such as test problems 4-6, KKT
based centralized method could not achieve an optimality gap of 0.01% within reasonably large computation times (the computation time limit is set to 12000 seconds)
3 The

numbers 1 to 6 represents C-HEMS-1, C-HEMS-2, ... C-HEMS-6 respectively.

31

and only near optimums are attained. It is also observed that our GA based solution
method could achieve actually better near optimums than KKT based solution method
on these large scale test problems. As a result, from the above comparisons of GA with
the iterative algorithm and KKT based single level reduction method on different test
cases, it is reasonable to conclude that our proposed GA are good enough and efficient
in solving the proposed bilevel model.
It is also worth pointing out that the proposed GA based distributed solution method
is also a feasible and effective solution for the realistic cases of energy pricing problem
where there may be up to a few millions of customers. The reason is that, by simply
distributing the computing of all customers’ best responses to the retailer’s prices to a
small number (saying a few hundreds) of cloud computing devices in which each device
computes the best responses of a group of customers (saying a couple of thousands),
the corresponding cloud/parallel computing enables the time needed for computing all
customers’ best responses being largely similar to the time needed for computing of
each group of customers. In other words, the proposed GA based solution method
enables the parallel computing and leads to the feasibility and effectiveness for the
realistic cases of energy pricing with a large number of customers. This is in contrast
with the complexity of KKT based optimization algorithms in the same cases, for which
it requires the centralised computing with multi-millions of constraints in order to find
the feasible and optimal prices. As for the definition based iterative algorithms, the
local optimization feature of such algorithms makes it much weaker option compared
with our proposed approach.

9. Conclusion
In this paper, we study the dynamic pricing optimization problem in a realistic
scenario consisting of one retailer and three different types of customers (C-NONE,
C-SM, and C-HEMS). The interactions between retailer and customers are treated as
a two-level decision-making framework. Firstly, we propose an integrated optimization+ machine learning based demand modelling framework for customers. Secondly,
we propose a profit-maximization based dynamic pricing model for the retailer sub-

32

ject to realistic market constraints. Finally, GA based distributed pricing optimization
algorithms are proposed to tackle the above two-level decision making problems. Simulation results indicate that our proposed pricing optimization model and solution algorithms are feasible and effective. However, to understand the computational aspect
of bilevel problems and their solution algorithms thoroughly, much work remains to be
done. In our future work, we plan a separate, dedicated contribution on that subject
considering both our and more generalized bilevel problems, by taking advantage of
e.g., machine learning algorithms and distributed and parallel computational facilities.

Acknowledgements
This work was partly supported by the National Nature Science Foundation of
China (Grant No. 71301133), Humanity and Social Science Youth Foundation of Ministry of Education, China (Grant No. 13YJC630033), and the Engineering and Physical
Sciences Research Council, UK (Grant No. EP/I031650/1).

References
References
[1] http://www.bbc.co.uk/news/uk-politics-24213366, (accessed
August 30, 2016).

[2] https://www.ofgem.gov.uk/electricity/retail-market/metering/transition-smart(accessed July 16, 2017).
[3] http://iso-ne.com/markets/hstdata/znl_info/hourly/index.html,
(accessed March 01, 2013).
[4] H. Aalami, M. P. Moghaddam, G. Yousefi, Modeling and prioritizing demand
response programs in power markets, Electric Power Systems Research 80 (4)
(2010) 426–435.
[5] C. O. Adika, L. Wang, Autonomous appliance scheduling for household energy
management, IEEE Transactions on Smart Grid 5 (2) (2014) 673–682.
33

[6] A. Arabali, M. Ghofrani, M. Etezadi-Amoli, M. S. Fadali, Y. Baghzouz, Geneticalgorithm-based optimization approach for energy management, IEEE Transactions on Power Delivery 28 (1) (2013) 162–170.
[7] A. Asadinejad, M. G. Varzaneh, K. Tomsovic, C.-f. Chen, R. Sawhney, Residential customers elasticity estimation and clustering based on their contribution at
incentive based demand response, in: Power and Energy Society General Meeting
(PESGM), 2016, IEEE, 1–5, 2016.
[8] O. Ben-Ayed, C. E. Blair, Computational difficulties of bilevel linear programming, Operations Research 38 (3) (1990) 556–560.
[9] B. Chai, J. Chen, Z. Yang, Y. Zhang, Demand response management with multiple
utility companies: A two-level game approach, IEEE Transactions on Smart Grid
5 (2) (2014) 722–731.
[10] S. Datchanamoorthy, S. Kumar, Y. Ozturk, G. Lee, Optimal time-of-use pricing
for residential load control, in: Smart Grid Communications (SmartGridComm),
2011 IEEE International Conference on, IEEE, 375–380, 2011.
[11] K. Deb, An efficient constraint handling method for genetic algorithms, Computer
Methods in Applied Mechanics and Engineering 186 (2) (2000) 311–338.
[12] B. P. Esther, K. S. Kumar, A survey on residential Demand Side Management
architecture, approaches, optimization models and methods, Renewable and Sustainable Energy Reviews 59 (2016) 342–351.
[13] C. Flath, D. Nicolay, T. Conte, C. van Dinther, L. Filipova-Neumann, Cluster
Analysis of Smart Metering Data-An Implementation in Practice, Business &
Information Systems Engineering 4 (1) (2012) 31–39.
[14] X. Fu, X.-J. Zeng, X. R. Luo, D. Wang, D. Xu, Q.-L. Fan, Designing an intelligent decision support system for effective negotiation pricing: A systematic and
learning approach, Decision Support Systems 96 (2017) 49–66.

34

[15] V. Gómez, M. Chertkov, S. Backhaus, H. J. Kappen, Learning price-elasticity of
smart consumers in power distribution systems, in: Smart Grid Communications
(SmartGridComm), 2012 IEEE Third International Conference on, IEEE, 647–
652, 2012.
[16] J. Han, G. Zhang, Y. Hu, J. Lu, A solution to bi/tri-level programming problems
using particle swarm optimization, Information Sciences 370 (2016) 519–537.
[17] G. W. Hart, Nonintrusive appliance load monitoring, Proceedings of the IEEE
80 (12) (1992) 1870–1891.
[18] K. Herter, Residential implementation of critical-peak pricing of electricity, Energy Policy 35 (4) (2007) 2121–2130.
[19] J. Hosking, R. Natarajan, S. Ghosh, S. Subramanian, X. Zhang, Short-term forecasting of the daily load curve for residential electricity usage in the Smart Grid,
Applied Stochastic Models in Business and Industry 29 (6) (2013) 604–620.
[20] A. R. Khan, A. Mahmood, A. Safdar, Z. A. Khan, N. A. Khan, Load forecasting,
dynamic pricing and DSM in smart grid: A review, Renewable and Sustainable
Energy Reviews 54 (2016) 1311–1322.
[21] A. Khotanzad, E. Zhou, H. Elragal, A neuro-fuzzy approach to short-term load
forecasting in a price-sensitive environment, IEEE Transactions on Power Systems 17 (4) (2002) 1273–1282.
[22] D. S. Kirschen, G. Strbac, P. Cumperayot, D. de Paiva Mendes, Factoring the
elasticity of demand in electricity prices, IEEE Transactions on Power Systems
15 (2) (2000) 612–617.
[23] J. Lofberg, YALMIP: A toolbox for modeling and optimization in MATLAB, in:
Computer Aided Control Systems Design, 2004 IEEE International Symposium
on, IEEE, 284–289, 2004.
[24] J. Lu, J. Han, Y. Hu, G. Zhang, Multilevel decision-making: a survey, Information
Sciences 346 (2016) 463–487.
35

[25] T. Lv, Q. Ai, Y. Zhao, A bi-level multi-objective optimal operation of gridconnected microgrids, Electric Power Systems Research 131 (2016) 60–70.
[26] Q. Ma, X.-J. Zeng, Demand modelling in electricity market with day-ahead dynamic pricing, in: 2015 IEEE International Conference on Smart Grid Communications (SmartGridComm), IEEE, 97–102, 2015.
[27] C. Mediwaththe, E. Stephens, D. Smith, A. Mahanti, Competitive Energy Trading Framework for Demand-side Management in Neighborhood Area Networks,
IEEE Transactions on Smart Grid (2017) (in press).
[28] F.-L. Meng, X.-J. Zeng, A Stackelberg game-theoretic approach to optimal realtime pricing for the smart grid, Soft Computing 17 (12) (2013) 2365–2380.
[29] F.-L. Meng, X.-J. Zeng, A Profit Maximization Approach to Demand Response
Management with Customers Behavior Learning in Smart Grid, IEEE Transactions on Smart Grid 7 (3) (2016) 1516–1529.
[30] A.-H. Mohsenian-Rad, A. Leon-Garcia, Optimal residential load control with
price prediction in real-time electricity pricing environments, IEEE Transactions
on Smart Grid 1 (2) (2010) 120–133.
[31] A.-H. Mohsenian-Rad, V. W. Wong, J. Jatskevich, R. Schober, A. Leon-Garcia,
Autonomous demand-side management based on game-theoretic energy consumption scheduling for the future smart grid, IEEE Transactions on Smart Grid
1 (3) (2010) 320–331.
[32] N. G. Paterakis, O. Erdinc, A. G. Bakirtzis, J. a. P. Catalão, Optimal household appliances scheduling under day-ahead pricing and load-shaping demand response
strategies, IEEE Transactions on Industrial Informatics 11 (6) (2015) 1509–1519.
[33] L. P. Qian, Y. J. A. Zhang, J. Huang, Y. Wu, Demand response management via
real-time electricity price control in smart grids, IEEE Journal on Selected areas
in Communications 31 (7) (2013) 1268–1280.

36

[34] B. Qu, J. Liang, Y. Zhu, Z. Wang, P. N. Suganthan, Economic emission dispatch
problems with stochastic wind power using summation based multi-objective evolutionary algorithm, Information Sciences 351 (2016) 48–66.
[35] Y. Ren, P. N. Suganthan, N. Srikanth, G. Amaratunga, Random vector functional
link network for short-term electricity load demand forecasting, Information Sciences 367 (2016) 1078–1093.
[36] P. Samadi, A.-H. Mohsenian-Rad, R. Schober, V. W. Wong, J. Jatskevich, Optimal real-time pricing algorithm based on utility maximization for smart grid, in:
Smart Grid Communications (SmartGridComm), 2010 First IEEE International
Conference on, IEEE, 415–420, 2010.
[37] P. Siano, Demand response and smart grids – A survey, Renewable and Sustainable Energy Reviews 30 (2014) 461–478.
[38] A. Sinha, P. Malo, K. Deb, A Review on Bilevel Optimization: From Classical to
Evolutionary Approaches and Applications, IEEE Transactions on Evolutionary
Computation (2017) (in press).
[39] D. Srinivasan, S. Rajgarhia, B. M. Radhakrishnan, A. Sharma, H. Khincha,
Game-Theory based dynamic pricing strategies for demand side management in
smart grids, Energy 126 (2017) 132–143.
[40] P. R. Thimmapuram, J. Kim, Consumers’ price elasticity of demand modeling
with economic effects on electricity markets using an agent-based model, IEEE
Transactions on Smart Grid 4 (1) (2013) 390–397.
[41] A. Trivedi, D. Srinivasan, S. Biswas, T. Reindl, A genetic algorithm–differential
evolution based hybrid framework: Case study on unit commitment scheduling
problem, Information Sciences 354 (2016) 275–300.
[42] J. Vetter, P. Novák, M. Wagner, C. Veit, K.-C. Möller, J. Besenhard, M. Winter, M. Wohlfahrt-Mehrens, C. Vogler, A. Hammouche, Ageing mechanisms in
lithium-ion batteries, Journal of Power Sources 147 (1) (2005) 269–281.

37

[43] W. Wei, F. Liu, S. Mei, Energy pricing and dispatch for smart grid retailers under
demand response and market price uncertainty, IEEE Transactions on Smart Grid
6 (3) (2015) 1364–1374.
[44] Z. Wu, S. Zhou, J. Li, X.-P. Zhang, Real-time scheduling of residential appliances via conditional risk-at-value, IEEE Transactions on Smart Grid 5 (3) (2014)
1282–1291.
[45] M. Yu, S. H. Hong, A real-time demand-response algorithm for smart grids: A
stackelberg game approach, IEEE Transactions on Smart Grid 7 (2) (2016) 879–
888.
[46] M. Yu, S. H. Hong, Supply–demand balancing for power management in smart
grid: A Stackelberg game approach, Applied Energy 164 (2016) 702–710.
[47] Z. Yun, Z. Quan, S. Caixin, L. Shaolan, L. Yuming, S. Yang, RBF neural network and ANFIS-based short-term load forecasting approach in real-time price
environment, IEEE Transactions on Power Systems 23 (3) (2008) 853–858.
[48] Y. Zhang, R. Wang, T. Zhang, Y. Liu, B. Guo, Model predictive control-based
operation management for a residential microgrid with considering forecast uncertainties and demand response strategies, IET Generation, Transmission & Distribution 10 (10) (2016) 2367–2378.
[49] M. Zugno, J. M. Morales, P. Pinson, H. Madsen, A bilevel model for electricity
retailers’ participation in a demand response market environment, Energy Economics 36 (2013) 182–197.

38

