1 Introduction

Maintaining the balance between the power generation and the demand is a key issue in power system operation. Traditionally, the generation side and interconnection lines are primarily used for this purpose [1]. With the increased penetration of renewable energy sources, conventional control strategies may be not enough to respond to the uncertainty of these renewable energy sources. Demand response has potential to help match the supply and the demand of power systems owing to the flexibility of controllable loads [2, 3]. Because thermostatically controlled loads (TCLs) can store energy in the form of temperature gradients, they represent a promising end-use category to engage in power system services [4]. Air conditioners are typical TCLs. The percentage of energy consumed by air conditioners of buildings in a city, like Jeddah, Saudi Arabia, is even over 50% of the total electric energy during the summer [5]. Applying appropriate control to air conditioners will play an important role in energy conservation and power system control [6,7,8,9].

Aggregation of air conditioners is essential to the control of air conditioners. To simulate the behavior of the air conditioner population, the most direct method is to aggregate thousands of air conditioners. In [10], the Monte Carlo method combined with smoothing techniques was proposed for numerical simulations. However, this would be computationally intensive and the aggregate system would not be in a form amenable to many control techniques. To facilitate the control of air conditioners, the main idea is to establish the aggregate model, which can characterize the temperature probability density evolution of the air conditioner population. In [11] and [12], the state-bin-based 1st-order TCL model was proposed and the state space matrix was identified by a Kalman filter. However, this identification approach may not converge when the number of states becomes large and it may not perform well for online estimation [13]. In [7] and [13], state-bin-based 1st-order TCL models considering the device lockout time were proposed for different control purposes. The state-bin-based heterogeneous 2nd-order TCL model was proposed in [14]. Besides, some aggregate models that did not consider the temperature probability density evolution have been proposed and received extensive concern. The aggregate duty cycle was used to aggregate TCLs in [15, 16]. This method was often applied to primary frequency control. In [17], the proposed model analytically characterized the aggregate power response of the step change in temperature set points. In [8], a population of TCLs was modeled as a battery. In [18], a virtual power plant model was applied to aggregate TCLs.

However, all of these models neglected the randomness of air conditioning loads. Coupled Fokker–Planck equations (CFPEs) were applied to aggregation of TCLs considering the randomness in [19]. It should be noted that the above methods mainly focused on point estimation which is inadequate to describe the stochastic behavior in aggregating air conditioning loads.

The stationary solutions of CFPEs are important because they can provide the initial and final conditions for state equations. In [20], Laplace transformation and inverse transformation were applied to the simplified CFPEs and the analytical stationary solutions were given. Reference [21] obtained the form of analytical stationary solutions of CFPEs by analyzing their eigenvalues and eigenfunctions. However, the coefficients of the analytical solutions were not provided in analytical form. Therefore, they can only be solved by numerical methods. The stationary solutions need to be developed further to be useful for real-time control.

Time-domain solutions of CFPEs are essential to the aggregation of air conditioning loads. CFPEs are linear second-order parabolic partial differential equations with coupled boundary conditions. As the analytical solutions cannot be obtained in time domain at present, numerical solutions are necessary. The finite difference method (FDM) is effective in solving partial differential equations, and correct grid spacings, including temperature step and time step, are essential because the improper grid spacings will lead to inaccurate solutions. In [22], the grid spacing was selected for the linear second-order parabolic partial differential equation with defined boundary conditions. The boundary conditions of CFPEs for aggregating air conditioning loads are coupled, which means the results reported in [22] cannot be used directly. The grid spacing selection of CFPEs should receive careful attention.

The main contributions of this paper are as follows:

  1. 1)

    The linear state equations, which characterize the temperature probability density evolution of the air conditioner population considering randomness, are proposed by solving CFPEs using the FDM to aggregate air conditioning loads.

  2. 2)

    By analyzing the numerical stability and convergence of the difference scheme of CFPEs, the grid spacings are properly determined.

  3. 3)

    Both analytical and numerical methods are proposed to get stationary solutions of CFPEs.

  4. 4)

    A classification method using dimension reduction is proposed for heterogeneous loads.

  5. 5)

    Interval estimation is introduced to reflect the stochastic behavior of air conditioning loads.

The rest of the paper is organized as follows. In Section 2, a stochastic space thermal model for air conditioners is described. The aggregate model using Fokker–Planck equations is presented in Section 3. The aggregate model for heterogeneous loads is presented in Section 4. Simulation results are shown in Section 5 to verify the methods proposed in previous sections. Finally, conclusions are drawn in Section 6.

2 Stochastic individual load model

The dynamic model for temperature of a room with air conditioners can be expressed by a first order differential equation which describes the relationship between the indoor temperature, the outdoor temperature and the rate of energy transfer from outdoors to indoors by the air conditioner. Compared with higher order models, it is relatively easy to apply control strategies to an air-conditioning system by using a first order model with fewer parameters. The first order model shown in (1) describes the thermal process [23].

$$\frac{{{\text{d}}x}}{{{\text{d}}t}} = \frac{K}{C}\left( {x_{o} - x} \right) + \frac{{s\alpha P_{e} }}{C}$$
(1)

where x is the temperature inside the space (°C); xo is the temperature outside the space (°C); C is the thermal capacity of the space (J/°C); K is the thermal conductance of the space (W/°C); Pe is the electrical power generated by air conditioners inside the space (W); s is the value stands for working mode of air conditioners, for heating mode s = 1 and for cooling mode s = − 1; α is the coefficient of performance (COP) of air conditioners inside the space and the thermal power generated by the air condition inside the space Ph = sαPe; t is the time (second).

The electrical power used by air conditioners inside the space is related to the thermostat state m, a dimensionless discrete variable equal to 0 (off) or 1 (on). That is:

$$P_{e} = mP_{N}$$
(2)

where PN is the rated power of the air conditioner.

The evolution of the discrete state m is governed by the thermostat with temperature setting xset and dead band δ. That is:

$$m\left( {t_{n + 1} } \right) = \left\{ {\begin{array}{*{20}l} 1 \hfill & {s\left[ {x - \left( {x_{set} - \frac{s\delta }{2}} \right)} \right] < 0} \hfill \\ 0 \hfill & {s\left[ {x - \left( {x_{set} + \frac{s\delta }{2}} \right)} \right] > 0} \hfill \\ {m\left( {t_{n} } \right)} \hfill & {\text{otherwise}} \hfill \\ \end{array} } \right.$$
(3)

To facilitate the aggregation of air conditioners, stochastic heat gain or heat loss (such as fluctuating number of people in the residence, doors and windows being opened and closed, and appliances being used) should be considered on the basis of the space thermal model [24]. A stochastic space thermal model, which is a stochastic differential equation can be formulated as:

$${\text{d}}x = \left[ {\frac{K}{C}\left( {x_{o} - x} \right) + \frac{{s\alpha P_{e} }}{C}} \right]{\text{d}}t + {\text{d}}v_{t}$$
(4)

where vt is a Wiener process with variance parameter σ2.

3 Aggregate model of homogeneous loads using Fokker–Planck equations

3.1 Description of Fokker–Planck equations

By considering the probability distribution (by temperature) of a population of air conditioners and making the assumption that the population is homogeneous, Malhamé and Chong (M&C) [19] proved that it is possible to construct a system of CFPEs to describe the dynamics of the population. This paper takes the cooling mode as the working mode of air conditioners, and the main equations of M&C’s model can be written in continuous time as follows:

$$\frac{{\partial f_{1} \left( {x,t} \right)}}{\partial t} = \frac{{\partial F_{1} \left( x \right)f_{1} \left( {x,t} \right)}}{\partial x} + \frac{{\sigma^{2} }}{2}\frac{{\partial^{2} f_{1} \left( {x,t} \right)}}{{\partial x^{2} }}$$
(5)
$$\frac{{\partial f_{0} \left( {x,t} \right)}}{\partial t} = \frac{{\partial F_{0} \left( x \right)f_{0} \left( {x,t} \right)}}{\partial x} + \frac{{\sigma^{2} }}{2}\frac{{\partial^{2} f_{0} \left( {x,t} \right)}}{{\partial x^{2} }}$$
(6)

where f1(x,t) and f0(x,t) are the probability densities of loads in the on and off states, respectively; F1(x) = [K(x − x0) + αPN]/C and F0(x) = K(x − x0)/C are the negative gradient of temperature inside the space in the on and off states, respectively.

The temperature range (− ∞, + ∞) is divided into three temperature regions: region a (− ∞, x], region b [x, x+] and region c [x+, + ∞), where x = xset − δ/2 is the temperature lower limit and x+ =  xset + δ/2 is the temperature upper limit. The following boundary conditions must hold for all t.

Absorbing boundaries:

$$f_{1b} \left( {x_{ - } ,t} \right) = f_{0b} \left( {x_{ + } ,t} \right) = 0$$
(7)

where f0b and f1b are the probability densities of loads of region b in the off and on states, respectively.

Conditions at infinity:

$$f_{0a} \left( { - {\infty },t} \right) = f_{1c} \left( { + {\infty },t} \right) = 0$$
(8)

where f0a is the probability density of loads of region a in the off state; f1c is the probability density of loads of region c in the on state.

Continuity conditions:

$$f_{0a} \left( {x_{ - } ,t} \right) = f_{0b} \left( {x_{ - } ,t} \right)$$
(9)
$$f_{1b} \left( {x_{ + } ,t} \right) = f_{1c} \left( {x_{ + } ,t} \right)$$
(10)

Probability conservation:

$$- \frac{{\partial f_{0a} \left( {x_{ - } ,t} \right)}}{\partial x} + \frac{{\partial f_{0b} \left( {x_{ - } ,t} \right)}}{\partial x} + \frac{{\partial f_{1b} \left( {x_{ - } ,t} \right)}}{\partial x} = 0$$
(11)
$$\frac{{\partial f_{1c} \left( {x_{ + } ,t} \right)}}{\partial x} - \frac{{\partial f_{1b} \left( {x_{ + } ,t} \right)}}{\partial x} - \frac{{\partial f_{0b} \left( {x_{ + } ,t} \right)}}{\partial x} = 0$$
(12)

Because of the probability conservation conditions, the integrated probability density will always be unity, that is:

$$\begin{aligned} & \int_{ - \infty }^{{x_{ - } }} {f_{0a} \left( {x,t} \right){\text{d}}x} + \int_{{x_{ - } }}^{{x_{ + } }} {\left( {f_{0b} \left( {x,t} \right) + f_{1b} \left( {x,t} \right)} \right){\text{d}}x} \\ & \quad + \int_{{x_{ - } }}^{{x_{ + } }} {f_{1c} \left( {x,t} \right){\text{d}}x} = \int_{ - \infty }^{{x_{ - } }} {f_{0a} \left( {x,0} \right){\text{d}}x} \\ & \quad + \int_{{x_{ - } }}^{{x_{ + } }} {\left( {f_{0b} \left( {x,0} \right) + f_{1b} \left( {x,0} \right)} \right){\text{d}}x} + \int_{{x_{ - } }}^{{x_{ + } }} {f_{1c} \left( {x,0} \right){\text{d}}x} = 1 \\ \end{aligned}$$
(13)

The total number of air conditioners is Nac. At time t, the average proportion of air conditioners in the on state is:

$$\bar{m}\left( t \right) = \int_{{x_{ - } }}^{{x_{ + } }} {f_{1b} \left( {x,t} \right){\text{d}}x} + \int_{{x_{ - } }}^{{x_{ + } }} {f_{1c} \left( {x,t} \right){\text{d}}x}$$
(14)

The operating characteristics of air conditioners are independent of one another. So the number of air conditioners in the on state X(t) is subject to the binomial distribution \(X\left( t \right)\sim\,B\left( {N_{ac} ,\bar{m}\left( t \right)} \right)\). The expected value and variance of X(t) are:

$$E\left( {X\left( t \right)} \right) = N_{ac} \bar{m}\left( t \right)$$
(15)
$$D\left( {X\left( t \right)} \right) = N_{ac} \bar{m}\left( t \right)\left( {1 - \bar{m}\left( t \right)} \right)$$
(16)

3.1.1 Point estimation

The average aggregate power of air conditioners is:

$$\bar{P}\left( t \right) = E\left( {X\left( t \right)} \right)P_{N}$$
(17)

This provides a point estimate for aggregation.

3.1.2 Interval estimation

The aggregate power of air conditioners P(t) is a random variable. Interval estimation is needed, which is given by:

$$P_{r} \left( {P_{1} \left( t \right) \le P\left( t \right) \le P_{2} \left( t \right)} \right) = \gamma$$
(18)

where P1(t) and P2(t) denote the lower and upper confidence limits of aggregate power, respectively; γ∈(0,1) is the confidence level; Pr(·) is the probability function. It is not convenient to use the binomial distribution directly in interval estimation, because the calculation of probability is complicated especially when Nac is large. The normal distribution is suitable for interval estimation and X(t) has approximately a normal distribution N(E(X(t)), D(X(t))) because the binomial distribution can be approximated by the normal distribution [25]. In practice, the approximation is adequate provided that both \(N_{ac} \bar{m}\left( t \right) \ge 10\) and \(N_{ac} \left( {1 - \bar{m}\left( t \right)} \right) \ge 10\), and then interval estimates can be obtained easily. Two common used interval estimates are given below:

$$\begin{aligned} & P_{r} \left( {E\left( {X\left( t \right)} \right) - 2\sqrt {D\left( {X\left( t \right)} \right)} \le X\left( t \right)} \right. \\ & \quad \left. { \le E\left( {X\left( t \right)} \right) + 2\sqrt {D\left( {X\left( t \right)} \right)} } \right) \approx 95.4\% \\ \end{aligned}$$
(19)
$$\begin{aligned} & P_{r} \left( {E\left( {X\left( t \right)} \right) - 3\sqrt {D\left( {X\left( t \right)} \right)} \le X\left( t \right)} \right. \\ & \quad \left. { \le E\left( {X\left( t \right)} \right) + 3\sqrt {D\left( {X\left( t \right)} \right)} } \right) \approx 99.7\% \\ \end{aligned}$$
(20)

The interval estimate for homogeneous loads is (18).

The average proportion \(\bar{m}\left( t \right)\) is important for either point estimation or interval estimation. However, exact solutions for the CFPEs are difficult to obtain. Appropriate numerical methods should be used to solve the CFPEs.

3.2 Time-domain solutions of CFPEs using FDM

CFPEs are partial differential equations, so the FDM can be applied to solve them. The temperature range of (− ∞, + ∞) is impossible for numerical calculation, so the temperature range can be set as [xmin, xmax], where probability densities of loads in x < xmin and x > xmax are 0 consistently with their limiting trend. The time step is τ = tj+1 − tj and the temperature step is h = xi+1 − xi. There are Na + 1, Nb + 1 and Nc + 1 temperature points in region a [xmin, x], region b [x, x+] and region c [x+, xmax], respectively, and there are N + 1 time points. The implicit central finite-difference scheme [26] is applied to solve CFPEs. At interior temperature points,

$$\begin{aligned} \frac{{f_{i,j + 1} - f_{i,j} }}{\tau } = & \,\frac{1}{2}\left( {\frac{K}{C}f_{i,j} + F\left( {x_{i} } \right)\frac{{f_{i + 1,j} - f_{i - 1,j} }}{2h}} \right. \\ & \left. { + \frac{{\sigma^{2} }}{2}\frac{{f_{i + 1,j} + f_{i - 1,j} - 2f_{i,j} }}{{h^{2} }}} \right) + \frac{1}{2}\left( {\frac{K}{C}f_{i,j + 1} } \right. + F\left( {x_{i} } \right) \\ & \left. { \cdot \frac{{f_{i + 1,j + 1} - f_{i - 1,j + 1} }}{2h} + \frac{{\sigma^{2} }}{2}\frac{{f_{i + 1,j + 1} + f_{i - 1,j + 1} - 2f_{i,j + 1} }}{{h^{2} }}} \right) \\ \end{aligned}$$
(21)

where fi,j  =  fm (xi, tj) is the probability density of loads in state m, and state m does not appear in these equations because it does not affect their form; F(xi) = Fm(xi) is the negative temperature gradient inside the space in the m state.

At boundary temperature points, according to finite volume method [26],

$$\begin{aligned} \frac{{f_{0,j + 1} - f_{0,j} }}{\tau } = & \,\frac{1}{2}\left[ {\frac{K}{C}f_{0,j} + F\left( {x_{0} } \right)\frac{{f_{1,j} - f_{0,j} }}{h}} \right. \\ & \left. { + \frac{{\sigma^{2} }}{h}\left( {\frac{{f_{1,j} - f_{0,j} }}{h} - \frac{{\partial f_{0,j} }}{\partial x}} \right)} \right] + \frac{1}{2}\left[ {\frac{K}{C}f_{0,j + 1} + F\left( {x_{0} } \right)} \right. \\ & \left. { \cdot \frac{{f_{1,j + 1} - f_{0,j + 1} }}{h} + \frac{{\sigma^{2} }}{h}\left( {\frac{{f_{1,j + 1} - f_{0,j + 1} }}{h} - \frac{{\partial f_{0,j + 1} }}{\partial x}} \right)} \right] \\ \end{aligned}$$
(22)
$$\begin{aligned} \frac{{f_{N,j + 1} - f_{N,j} }}{\tau } = & \,\frac{1}{2}\left[ {\frac{K}{C}f_{N,j} + F\left( {x_{N} } \right)\frac{{f_{N,j} - f_{N - 1,j} }}{h}} \right. \\ & \left. { + \frac{{\sigma^{2} }}{h}\left( { - \frac{{f_{N,j} - f_{N - 1,j} }}{h} + \frac{{\partial f_{0,j} }}{\partial x}} \right)} \right] + \frac{1}{2}\left[ {\frac{K}{C}f_{N,j + 1} + F\left( {x_{N} } \right)} \right. \\ & \left. { \cdot \frac{{f_{N,j + 1} - f_{N - 1,j + 1} }}{h} + \frac{{\sigma^{2} }}{h}\left( { - \frac{{f_{N,j + 1} - f_{N - 1,j + 1} }}{h} + \frac{{\partial f_{N,j + 1} }}{\partial x}} \right)} \right] \\ \end{aligned}$$
(23)

fi,j, \({{\partial f_{0,j + 1} } \mathord{\left/ {\vphantom {{\partial f_{0,j + 1} } {\partial x}}} \right. \kern-0pt} {\partial x}}\) and \({{\partial f_{N,j + 1} } \mathord{\left/ {\vphantom {{\partial f_{N,j + 1} } {\partial x}}} \right. \kern-0pt} {\partial x}}\) are the unknown variables of which the total number is Na + 2Nb + Nc + 12.

Absorbing boundary conditions:

$$f_{1b} \left( {x_{0} ,t_{j} } \right) = f_{0b} \left( {x_{{N_{b} }} ,t_{j} } \right) = 0$$
(24)

where x0 is the initial point of each region and x0 is not same in each region.

Conditions at infinity:

$$2F_{0} \left( {x_{0} } \right)f_{0a} \left( {x_{0} ,t_{j} } \right) + \sigma^{2} \frac{{\partial f_{0a} \left( {x_{0} ,t_{j} } \right)}}{\partial x} = 0$$
(25)
$$2F_{1} \left( {x_{{N_{c} }} } \right)f_{1c} \left( {x_{{N_{c} }} ,t_{j} } \right) + \sigma^{2} \frac{{\partial f_{1c} \left( {x_{{N_{c} }} ,t_{j} } \right)}}{\partial x} = 0$$
(26)

Continuity conditions:

$$f_{0a} \left( {x_{{N_{a} }} ,t_{j} } \right) = f_{0b} \left( {x_{0} ,t_{j} } \right)$$
(27)
$$f_{1b} \left( {x_{{N_{b} }} ,t_{j} } \right) = f_{1c} \left( {x_{0} ,t_{j} } \right)$$
(28)

Probability conservation:

$$- \frac{{\partial f_{0a} \left( {x_{{N_{a} }} ,t_{j} } \right)}}{\partial x} + \frac{{\partial f_{0b} \left( {x_{0} ,t_{j} } \right)}}{\partial x} + \frac{{\partial f_{1b} \left( {x_{0} ,t_{j} } \right)}}{\partial x} = 0$$
(29)
$$\frac{{\partial f_{1c} \left( {x_{0} ,t_{j} } \right)}}{\partial x} - \frac{{\partial f_{1b} \left( {x_{{N_{b} }} ,t_{j} } \right)}}{\partial x} - \frac{{\partial f_{0b} \left( {x_{{N_{b} }} ,t_{j} } \right)}}{\partial x} = 0$$
(30)

By linear transformation, 8 partial differential variables, 2 variables at absorbing boundaries and 2 of the variables in continuity conditions can be eliminated.

At every time step, there are Na + 2Nb + Nc equations and every equation is linear equation. The following linear equation system can be obtained:

$$\varvec{A}_{1} \varvec{f}\left( {t_{j + 1} } \right) = \varvec{A}_{2} \varvec{f}\left( {t_{j} } \right)$$
(31)
$$\varvec{ f}\left( {t_{j} } \right) = \left[ {\begin{array}{*{20}c} {\varvec{f}_{0a}^{\text{T}} \left( {t_{j} } \right)} & {\varvec{f}_{0b}^{\text{T}} \left( {t_{j} } \right)} & {\varvec{f}_{1b}^{\text{T}} \left( {t_{j} } \right)} & {\varvec{f}_{1c}^{\text{T}} \left( {t_{j} } \right)} \\ \end{array} } \right]^{\text{T}}$$
(32)
$$\varvec{f}_{0a} \left( {t_{j} } \right) = \left[ {\begin{array}{*{20}c} {f_{0a} \left( {x_{0} ,t_{j} } \right)} & \cdots & {f_{0a} \left( {x_{{N_{a} }} ,t_{j} } \right)} \\ \end{array} } \right]^{\text{T}}$$
(33)
$$\varvec{f}_{0b} \left( {t_{j} } \right) = \left[ {\begin{array}{*{20}c} {f_{0b} \left( {x_{1} ,t_{j} } \right)} & \cdots & {f_{0b} \left( {x_{{N_{b} - 1}} ,t_{j} } \right)} \\ \end{array} } \right]^{\text{T}}$$
(34)
$$\varvec{f}_{1b} \left( {t_{j} } \right) = \left[ {\begin{array}{*{20}c} {f_{1b} \left( {x_{1} ,t_{j} } \right)} & \cdots & {f_{{1{\text{b}}}} \left( {x_{{N_{b} - 1}} ,t_{j} } \right)} \\ \end{array} } \right]^{\text{T}}$$
(35)
$$\varvec{f}_{1c} \left( {t_{j} } \right) = \left[ {\begin{array}{*{20}c} {f_{1c} \left( {x_{0} ,t_{j} } \right)} & \cdots & {f_{{1{\text{c}}}} \left( {x_{{N_{c} }} ,t_{j} } \right)} \\ \end{array} } \right]^{\text{T}}$$
(36)

The derivation of A1 and A2 is shown in the Appendix A. The number of unknown variables is also Na + 2Nb + Nc, and accordingly, unique solutions can be obtained.

The finite volume method [26] is used to implement the difference schemes for boundary temperature points, and the total probability in the system will always be unity due to the trapezoidal rule. That is:

$$I_{0} \left( {t_{j} } \right) = \frac{h}{2}\left( {f_{0a} \left( {x_{0} ,t_{j} } \right) + 2\mathop \sum \limits_{i = 1}^{{N_{a} }} f_{0a} \left( {x_{i} ,t_{j} } \right) + 2\mathop \sum \limits_{i = 1}^{{N_{b} - 1}} f_{0b} \left( {x_{i} ,t_{j} } \right)} \right)$$
(37)
$$I_{1} \left( {t_{j} } \right) = \frac{h}{2}\left( {2\mathop \sum \limits_{i = 1}^{{N_{b} - 1}} f_{1b} \left( {x_{i} ,t_{j} } \right) + 2\mathop \sum \limits_{i = 0}^{{N_{c} - 1}} f_{1c} \left( {x_{i} ,t_{j} } \right) + f_{1c} \left( {x_{{N_{c} }} ,t_{j} } \right)} \right)$$
(38)
$$I_{0} \left( {t_{j + 1} } \right) + I_{1} \left( {t_{j + 1} } \right) = I_{0} \left( {t_{j} } \right) + I_{1} \left( {t_{j} } \right)$$
(39)

It should be noted that (39) can be derived by the elementary line transformation of (31). And (39) cannot be got by line operation with the loss of any equations of (31).

Furthermore, the linear state equations can be established, which are:

$$\varvec{f}\left( {t_{j + 1} } \right) = \varvec{A}\varvec{f}\left( {t_{j} } \right)$$
(40)
$$\bar{m}\left( {t_{j + 1} } \right) = I_{1} \left( {t_{j + 1} } \right)$$
(41)

where \(\varvec{A} = \varvec{A}_{1}^{ - 1} \varvec{A}_{2}\).

The aggregate power of air conditioners is:

$$\bar{P}\left( {t_{j + 1} } \right) = \bar{m}\left( {t_{j + 1} } \right)N_{ac} P_{N} = I_{1} \left( {t_{j + 1} } \right)N_{ac} P_{N}$$
(42)

The aggregate modeling of air conditioning loads is shown in (40)–(42), in which linear state equations are developed by solving CFPEs using the FDM.

The aggregate model proposed in this paper can also be applied to many proposed control strategies based on temperature density evolution models. The state space matrixes of many temperature density evolution models were decided by identification of air conditioning loads in the aggregator using a Kalman filter. The state space matrix of proposed aggregate model can be decided using the parameters identified in each room, which is more convenient in on-line application. Some suitable parameter identification methods are available, such as the window-varying particle filter proposed in [27].

The choice of grid spacings is essential to ensuring the accuracy of solutions. If the grid spacings are too large, the solutions are not accurate, but if too small, the computation time will increase. The stability and convergence criterion of the FDM determine the best grid spacings. We obtain the following criteria according to the maximal principle and they are a sufficient condition for convergence to an accurate solution.

$$\left\{ {\begin{array}{*{20}l} {2\left( {1 - \frac{1}{2}\frac{K}{C}\tau } \right) - \frac{1}{2}\frac{\tau }{{h^{2} }}\left( {\sigma^{2} - \left| {F\left( {x_{i} } \right)} \right|_{ \hbox{max} } h} \right) > 0} \hfill \\ {\sigma^{2} - \left| {F\left( {x_{i} } \right)} \right|_{ \hbox{max} } h \ge 0} \hfill \\ {1 + \frac{1}{2}\frac{K}{C}\tau - \frac{1}{2}\sigma^{2} \frac{\tau }{{h^{2} }} \ge 0} \hfill \\ \end{array} } \right.$$
(43)

where \(\left| {F\left( {x_{i} } \right)} \right|_{ \hbox{max} }\) is the maximum value of \(\left| {F_{0} \left( x \right)} \right|\) for \(x \in \left[ {x_{ \hbox{min} } ,x_{ + } } \right]\) and \(\left| {F_{1} \left( x \right)} \right|\) for \(x \in \left[ {x_{ - } ,x_{ \hbox{max} } } \right]\).

Equation (43) is the suggested guide to choose grid spacings.

3.3 Stationary solutions

It is important to get the stationary solutions of CFPEs, which provide the initial and final conditions for state equations.

3.3.1 Analytical stationary solutions

In [21], the author derives the following stationary solutions with 8 coefficients to solve:

$$\begin{aligned} f_{1} \left( x \right) = & \,\text{e}^{{ - \left( {\frac{{x - x_{o} + P_{N} R}}{{\sigma \sqrt {CR} }}} \right)^{2} }} \\ & \cdot \left( {a_{01} - \frac{1}{2}a_{11} {\text{ierf}}\left( {{\text{i}}\frac{{x - x_{o} + P_{N} R}}{{\sigma \sqrt {CR} }}} \right)\sqrt {\uppi CR} \sigma } \right) \\ \end{aligned}$$
(44)
$$\begin{aligned} f_{0} \left( x \right) = & \,\text{e}^{{ - \left( {\frac{{x - x_{o} }}{{\sigma \sqrt {CR} }}} \right)^{2} }} \\ & \cdot \left( {a_{00} - \frac{1}{2}a_{10} {\text{ierf}}\left( {{\text{i}}\frac{{x - x_{o} }}{{\sigma \sqrt {CR} }}} \right)\sqrt {{{\uppi }}CR} \sigma } \right) \\ \end{aligned}$$
(45)

where \({\text{ierf}}\left( {{\text{i}}x} \right) = \frac{2}{{\sqrt {{\uppi }} }}\int_{0}^{x} {{\text{e}}^{{t^{2} }} {\text{d}}t}\); \(R = 1/K\).

The 8 coefficients are a00a, a10a, a00b, a10b, a01b, a11b, a01c and a11c which must be separately determined for each temperature region and operating state.

The author uses 9 equations to solve these 8 coefficients, which is feasible in numerical calculation. Two of these 9 equations, which are the conditions at infinity, are satisfied automatically by (44) and (45) and may therefore be ignored. Based on (44) and (45), we provide the completely analytical stationary solutions for CFPEs, which are:

$$\begin{aligned} & f_{0a} \left( {x,\infty } \right) \\ & \quad = a_{10b} \sqrt {CR} \sigma \int_{{\frac{{x_{ - } - x_{o} }}{{\sigma \sqrt {CR} }}}}^{{\frac{{x_{ + } - x_{o} }}{{\sigma \sqrt {CR} }}}} {{\text{e}}^{{t^{2} - \left( {\frac{{x - x_{o} }}{{\sigma \sqrt {CR} }}} \right)^{2} }} {\text{d}}t} \quad \, x \in \left( { - \infty ,x_{ - } } \right] \\ \end{aligned}$$
(46)
$$\begin{aligned} & f_{0b} \left( {x,\infty } \right) \\ & \quad = a_{10b} \sqrt {CR} \sigma \int_{{\frac{{x - x_{o} }}{{\sigma \sqrt {CR} }}}}^{{\frac{{x_{ + } - x_{o} }}{{\sigma \sqrt {CR} }}}} {{\text{e}}^{{t^{2} - \left( {\frac{{x - x_{o} }}{{\sigma \sqrt {CR} }}} \right)^{2} }} {\text{d}}t} \quad x \in \left[ {x_{ - } ,x_{ + } } \right] \\ \end{aligned}$$
(47)
$$\begin{aligned} & f_{1b} \left( {x,\infty } \right) \\ & \quad = a_{10b} \sqrt {CR} \sigma \int_{{\frac{{x_{ - } - x_{o} + P_{N} R}}{{\sigma \sqrt {CR} }}}}^{{\frac{{x - x_{o} + P_{N} R}}{{\sigma \sqrt {CR} }}}} {{\text{e}}^{{t^{2} - \left( {\frac{{x - x_{o} + P_{N} R}}{{\sigma \sqrt {CR} }}} \right)^{2} }} {\text{d}}t} \quad x \in \left[ {x_{ - } ,x_{ + } } \right] \\ \end{aligned}$$
(48)
$$\begin{aligned} & f_{{1{\text{c}}}} \left( {x,\infty } \right) \\ & \quad = a_{10b} \sqrt {CR} \sigma \int_{{\frac{{x_{ - } - x_{o} + P_{N} R}}{{\sigma \sqrt {CR} }}}}^{{\frac{{x_{ + } - x_{o} + P_{N} R}}{{\sigma \sqrt {CR} }}}} {{\text{e}}^{{t^{2} - \left( {\frac{{x - x_{o} + P_{N} R}}{{\sigma \sqrt {CR} }}} \right)^{2} }} {\text{d}}t} \quad x \in \left[ {x_{ + } , + \infty } \right) \\ \end{aligned}$$
(49)

It should be noted that:

$$\begin{aligned} & \int_{ - \infty }^{{x_{ - } }} {f_{0a} \left( {x,\infty } \right){\text{d}}x} + \int_{{x_{ - } }}^{{x_{ + } }} {\left( {f_{0b} \left( {x,\infty } \right) + f_{1b} \left( {x,\infty } \right)} \right){\text{d}}x} \\ & \quad + \int_{{x_{ - } }}^{{x_{ + } }} {f_{1c} \left( {x,\infty } \right){\text{d}}x} = 1 \\ \end{aligned}$$
(50)

The unique a10b can be decided by substituting (46)–(49) to (50) and the stationary solutions can be obtained.

The analytical stationary solutions for CFPEs are (46)–(50).

3.3.2 Numerical stationary solutions

Analytical solutions are exact but complex integrals need to be calculated. Numerical solutions are required for fast calculation.

From (31), the stationary solutions should satisfy

$$\varvec{A}_{1} f\left( \infty \right) = \varvec{A}_{2} f\left( \infty \right)$$
(51)

where f(∞) is the numerical stationary solution. According to the line transformation from (31) to (39), both of the left-hand side (LHS) and right-hand side (RHS) of (51) can be transformed to I0(∞) + I1(∞), which also means zero vector can be obtained by line operation of A1 − A2. In other words, the row vectors of A1 − A2 are linearly dependent. Zero vector cannot be got by line operation of A1 − A2 with the loss of any row. Thus the rank of A1 − A2 is Na + 2Nb + Nc − 1 and an additional equation should be added to solve f(∞). This equation is provided by:

$$I_{0} \left( \infty \right) + I_{1} \left( \infty \right) = 1$$
(52)

By using (52) and the Na + 2Nb + Nc − 1 equations of (51), the numerical stationary solutions can be obtained.

4 Aggregate model of heterogeneous loads

4.1 Parameter classification

This paper considers a realistic scenario in which the parameters of air conditioners are heterogeneous. It will focus on the effect of varying C, K and PN, the fundamental parameters of the space thermal model, which are assumed to follow log-normal distributions as in [21]. To deal with load heterogeneity, parameters are classified into several clusters and a homogeneous aggregate model is computed for each cluster. There will be many clusters when these three parameters are classified directly according to varying C, K and PN. Dimension reduction can be achieved by defining p1 = K/C and p2 = PN/C to determine the space thermal model, so that the number of clusters is reduced a lot when classified according to p1 and p2.

With dimension reduction, two steps are needed when grouping heterogeneous parameters considering reasonable parameter combinations, which means the indoor temperature can approach to the lower limit x- in cooling mode (or the upper limit x+ in heating mode) and the following condition should be satisfied:

$$p_{1} \left[ { - sx_{\text{o}} + \frac{1}{2}\left( {s - 1} \right)x_{ - } + \frac{1}{2}\left( {s + 1} \right)x_{ + } } \right] \le \alpha p_{2}$$
(53)

Firstly, n1 clusters of p1 and p2 are classified according to the probability density function of p1 and p2, with weight wi of each cluster as defined by (54)–(56).

$$\begin{aligned} w_{i} & \propto f\left( { \lg p_{1} , \lg p_{2} { | }p_{1}\left[ { - sx_{\text{o}} + \frac{(s - 1)x_{ - } }{2}+ \frac{(s + 1)x_{ + }}{2} } \right] \le \alpha p_{2} } \right) \\ & \propto f\left( { \lg p_{1} , \lg p_{2} } \right) \propto \int f\left( { \lg p_{1} , \lg p_{2} ,\lg P_{N} } \right){\text{d}}\left( {\lg P_{N} } \right) \\ \end{aligned}$$
(54)
$$\begin{aligned} & f\left( {\lg p_{1} , \lg p_{2} ,\lg P_{N} } \right) = f\left( { \lg C = \lg P_{N} - \lg p_{2} } \right) \\ & \quad \cdot f\left( { \lg K = \lg p_{1} + \lg P_{N} - \lg p_{2} } \right)f\left( {\lg P_{N} } \right) \\ \end{aligned}$$
(55)
$$\mathop \sum \limits_{i = 1}^{{n_{1} }} w_{i} = 1$$
(56)

where f(·) is the probability density function.

Secondly, for the ith cluster of p1 and p2, n2 clusters are classified according to the probability density function of PN, with weight wij of each cluster, as defined by (57) and (58).

$$w_{ij} \propto f\left( {\lg P_{N} | {\text{lg }}p_{1} ,{ \lg }\; p_{2} } \right) \propto f\left( {{ \lg }\; p_{1} ,{ \lg }\; p_{2} ,\lg P_{N} } \right)$$
(57)
$$\mathop \sum \limits_{j = 1}^{{n_{2} }} w_{ij} = 1$$
(58)

4.2 Aggregate model of heterogeneous loads

It can be seen that there are n1×n2 clusters of C, K and PN, and only n1 homogeneous aggregate models are calculated. The number of air conditioners of the ith cluster in the on state Xij(t) is subject to the binomial distribution:

$$X_{ij} \left( t \right)\sim\,B\left( {N_{ac} w_{i} w_{ij} ,\bar{m}_{ij} \left( t \right)} \right)$$
(59)

The average electrical power consumption of an individual air conditioner is:

$$P\left( t \right) = \frac{1}{{N_{ac} }}\mathop \sum \limits_{i = 1}^{{n_{1} }} \mathop \sum \limits_{j = 1}^{{n_{2} }} P_{N,j} X_{ij} \left( t \right)$$
(60)

where PN,j is the rated power of the air conditioner in the jth cluster.

The expectation and variance of the average electrical power are:

$$E\left( {P\left( t \right)} \right) = \mathop \sum \limits_{i = 1}^{{n_{1} }} \mathop \sum \limits_{j = 1}^{{n_{2} }} P_{N,j} w_{i} w_{ij} \bar{m}_{ij} \left( t \right)$$
(61)
$$D\left( {P\left( t \right)} \right) = \frac{1}{{N_{ac} }}\mathop \sum \limits_{i = 1}^{{n_{1} }} \mathop \sum \limits_{j = 1}^{{n_{2} }} P_{N,j}^{2} w_{i} w_{ij} \bar{m}_{ij} \left( t \right)\left( {1 - \bar{m}_{ij} \left( t \right)} \right)$$
(62)

Considering that the binomial distribution can be approximated by the normal distribution and the linear combination of normal distributions is also a normal distribution [25], the average electrical power consumption of an individual air conditioner has approximately a normal distribution:

$$P\left( t \right)\sim\,N\left( {E\left( {P\left( t \right)} \right),D\left( {P\left( t \right)} \right)} \right)$$
(63)

The point estimation and the interval estimation of power consumption of heterogeneous loads can be obtained based on this normal distribution.

5 Simulation results

The thermal model parameters, which are chosen using [21], are shown in Table 1. Numerical methods in Sections 3 and 4 are conducted separately based on these parameters. The Monte Carlo method is applied to verify the effectiveness of the methods. It is assumed that the temperature set point undergoes a positive 0.2 °C step change at time 5000 s.

Table 1 Model parameter values

5.1 Results of FDM

The time step τ = 1 s and the temperature step h = 0.01 °C are chosen according to (43). The initial states can be acquired by calculating the stationary solutions before the temperature set point is changed using the proposed methods in Section 3.3. The results of the FDM, which are the probability density of air conditioners in the off and on states, are shown in Fig. 1a and Fig. 1b, respectively. It can be observed that the probability density of air conditioners in the off state firstly climbs up, and then declines after 5000 s. The trend of the probability density of air conditioners in the on state is opposite after 5000 s.

Fig. 1
figure 1

Probability density of air conditioners in off and on states

Figure 2 shows the proportion of air conditioners in the on state. The proportion of air conditioners in the on state firstly decreases when the step change is introduced at 5000 s, and then increases afterwards. The stable value that it reaches is smaller than the value before, which matches the expectation. To verify the accuracy of the FDM, the Monte Carlo method is implemented. From Fig. 2, we can see that the results of Monte Carlo method are around the results of the FDM, which indicates that the results of the FDM are accurate. To obtain the fluctuation behavior of the proportion, the confidence coefficient for interval estimation is set as 95%, and the upper and lower confidence limits are also illustrated in Fig. 2. The majority of results of the Monte Carlo method are within the confidence interval, which verifies the effectiveness of interval estimation.

Fig. 2
figure 2

Proportion of air conditioners in on state with 10000 air conditioners

This paper also examines the different fluctuation behaviors of various amounts of air conditioners. The proportion of air conditioners in the on state is compared for 1000 and 100000 air conditioners in Fig. 3a and Fig. 3b, respectively. It can be seen that point estimations (the mean values) do not change with different amounts of air conditioners. But the Monte Carlo results show that the fluctuation is more obvious when the number of air conditioners is small. The interval estimates are also shown and they correctly estimate the fluctuation behavior of the Monte Carlo results.

Fig. 3
figure 3

Proportion of air conditioners in on state with 1000 and 100000 air conditioners

5.2 Influence of grid spacings

The choice of grid spacings is important to achieve accurate results from numerical methods. The proper grid spacing zone is shown by the green area of Fig. 4a according to (43). Because the criterion is a sufficient condition for the stability of the numerical method, the numerical results are not necessarily inaccurate with grid spacings that are outside this zone. For example, the time step τ = 100 s with the temperature step h = 0.01 °C is not in the proper grid spacing zone but the numerical results are still accurate, because the difference scheme remains quite stable. However, if the grid spacings are too large, such as the time step τ = 500 s and the temperature step h = 0.01 °C, the numerical results will be inaccurate, as indicated in Fig. 4b.

Fig. 4
figure 4

Influence of grid spacings when thermal capacity is large

The choice of grid spacing is particularly important when the thermal capacity is small. For example, consider a simulation in which the thermal capacity is C = 106 J/°C, the set point is xset = 23 °C, the thermostat dead band is δ = 2 °C and the other parameters are the same as in Table 1. It is assumed that the set point undergoes a positive 1 °C step change at 600 s. The proper grid spacing zone is shown in the filled area of Fig. 5a and the numerical simulation results are shown in Fig. 5b. It can be seen that, when the time step is τ = 60 s and the temperature step is h = 0.01 °C, the results are inaccurate and sometimes less than 0, which is not physically correct.

Fig. 5
figure 5

Influence of grid spacings when the thermal capacity is small

5.3 Stationary solutions

Before changing the set point, stationary solutions in the off and on states are shown in Fig. 6a and Fig. 6b, respectively. It can be observed that analytical and numerical solutions are almost coincident, which supports the correctness of both methods. The stationary solutions for the scenario of small thermal capacity, developed in Section 5.2, are shown before changing the set point in Fig. 7a and Fig. 7b. These results also verify the methods proposed in Section 3.3.

Fig. 6
figure 6

Stationary solutions in off and on states based on large thermal capacitance before changing set point

Fig. 7
figure 7

Stationary solutions in off and on states based on small thermal capacitance before changing set point

5.4 Results for heterogeneous loads

In this paper, the load heterogeneity is modelled by varying the parameters C, K and PN. These are the fundamental parameters of the space thermal model and they obey lognormal distributions [21]. It should be noted that the parameters are independent, although for the purpose of clustering a dimension reduction is used in Section 4.1. The mean and variance of each parameter have been shown in Table 1. Here we provide a parameter sensitivity analysis based on changes of heterogeneous parameters. The influence of parameters is evaluated by root mean square errors (RMSEs) between the results of Monte Carlo simulation using heterogeneous parameters and the results of the Fokker–Planck equations using average parameters. The sensitivity analysis results are shown in Fig. 8. It can be seen that the parameters K and PN have a greater impact on the results than the parameter C. The scale of impact suggests that it is necessary to consider heterogeneous parameters.

Fig. 8
figure 8

Parameter sensitivity analysis

Figure 9 shows the average electrical power consumption of an individual air conditioner considering heterogeneous parameters. The results of Monte Carlo method are used as the reference. We can see that the results of the FDM are accurate and reliably indicate the confidence interval. The confidence coefficient of interval estimation is set as 95% and the upper and lower confidence limits are illustrated in Fig. 9.

Fig. 9
figure 9

Average electrical power consumption of an individual air condition among a total population of 10000

5.5 Application to regulation services

In Section 3.2, linear state equations are developed by solving CFPEs using FDM, which is helpful for designing control systems. The proposed aggregate model is applied to regulation services. The control strategy proposed in [14] is used in this paper. The aggregator collects information about air conditioning loads, such as their working state (“on” or “off”), the indoor temperature and so on. The control signal is decided by the aggregate model and the control strategy includes a lock time constraint to avoid short-cycling of devices. The control signal, which is a scalar ρ∈[− 1, 1], is broadcast to the controlled air conditioners. If an air conditioner is working in the “off” state and ρ is positive, the air conditioner will have probability ρ of turning “on” provided it is not locked. If the air conditioner is working in the “on” state and ρ is negative, the air conditioner will have probability –ρ of turning “off”.

The number of controlled air conditioners is 1000 and their total load power capacity is about 5.6 MW. The stationary power of air conditioning loads before control is about 2.4 MW. The lockout time for changing the state of air conditioners is set as 5 minutes and the control interval is 30 seconds. We choose the regulation signal from time 12:00 to 12:40 on 1 June 2016 available on the PJM website [28] and the range of the regulation signal is adjusted to 4 MW. The Monte Carlo method is used to simulate the scenario. The tracking response is illustrated in Fig. 10. It can be seen that the aggregate power of the air conditioning loads can follow the reference signal well. However, the performance is poorer at some time points due to the influence of lock time constraint.

Fig. 10
figure 10

Tracking performance of following regulation signal

6 Conclusion

In this paper, CFPEs are applied to aggregate air conditioning loads. The aggregate model using Fokker–Planck equations is accurate, however this model was not suitable for control since the partial differential equations are difficult to solve. The derivations in this paper successfully apply the aggregate model using Fokker–Planck equations to control design. Compared with other aggregate models, the aggregate model using Fokker–Planck equations takes the randomness of air conditioning loads into consideration, leading to practical solutions.

Because the analytical solutions of CFPEs cannot be derived at present, linear state equations, which characterize the temperature probability density evolution of the air conditioner population considering randomness, are developed by solving CFPEs using the finite difference method (FDM). The grid spacings of difference scheme are obtained by analyzing numerical stability and convergence based on the maximal principle. Both analytical and numerical methods are used to obtain stationary solutions.

Considering that the parameters may be heterogeneous, a classification method using dimension reduction is proposed. To avoid the limitations of point estimation, interval estimation is applied to describe the stochastic behavior according to the normal distribution, which is used to approximate the binomial distribution. Simulation results of point estimation and interval estimation are verified by Monte Carlo simulation. The selection of appropriate grid spacings is shown to be important for numerical methods.

Regarding stationary solutions, the simulation results of analytical and numerical methods are almost the same, indicating that the methods proposed in the paper are effective. The aggregate model is successfully applied to an existing control strategy to follow the reference signal for regulation services, and the performance is good. In the future, new control strategies for air conditioning loads can be developed using the proposed methods.