Collective effects and synchronization of demand in real-time demand response

Sustainable energy systems require flexible elements to balance the variability of renewable energy sources. Demand response aims to adapt the demand to the variable generation, in particular by shifting the load in time. In this article, we provide a detailed statistic analysis of the collective operation of many demand response units. We establish and simulate a model for load shifting in response to real-time electricity pricing using local storage systems. We show that demand response drives load shifting as desired, but also induces strong collective effects that may threaten system stability. The load of individual households synchronizes, leading to extreme demand peaks. We provide a detailed statistical analysis of the grid load, and quantify both the likeliness and extent of extreme demand peaks.

prices in almost real-time to reduce overall costs [16]. However, the adaption of DR at the household level is lacking behind [17] as social and behavioral obstacles are not overcome.
In this article, we address the operation and implications of DR from a systemic statistical perspective. Without DR, the actions of single consumers, i.e., the switching of a single device, can be considered an independent stochastic event. In a large interconnected power system, demand fluctuations of individual households average out, and the total grid load varies rather smoothly. In the spirit of the central limit theorem, we can assume that the residual fluctuations of the total grid load around the smooth daily profile follow a normal distribution. This assumption is no longer valid for real-time DR, where the customer demands are adapted according to a common input signal, the electricity price, and thus are no longer independent. Collective effects may then fundamentally alter the statistics of the electricity demand.
To study the potential impacts of DR, we simulate the operation of a household DR system based on real-time pricing using a coarse-grained model and investigate the impact on the resulting electricity demand time series. On average, demand is shifted to periods of low prices as desired, but we instead focus on the statistics of the time series and collective effects emerging for many households all reacting to the same real-time price signals. It has been shown in the statistical physics community that such common inputs can fundamentally change the statistics [18,19]. In fact, the behaviour of different households can synchronize, which leads to heavy-tailed distributions of the aggregated demand. Events with a strongly simultaneous demand may arise, which may be adverse to power system stability.

II. MODELS AND METHODS
We consider a coarse-grained model of real-time DR. A set of N households try to minimize their electricity costs by adapting their power supply, as shown in Fig. 1. Each household j = 1, . . . , N is characterized by its residual power demand time series D j (t), which equals the final demand minus local renewable generation, e.g., by a photovoltaic source.
The DR is realized via a small battery electric storage system (BESS) with capacity S Cap , which allows for a shifting of electricity consumption. That is, we consider only DR actions that do not require any active participation or behavioural changes by the consumer, i.e., fully automated by a controller. The residual power demand D j (t) of each household j can household demands the electric power D(t) during time interval t. This demand can either be satisfied by drawing power from the grid or a local battery electric storage system (BESS) with capacity S Cap . Whether power is drawn from the grid to meet the demand and charge the BESS is decided by a controller on the basis of the real-time price p(t) and the state of charge of the BESS S(t). We consider an elementary control law, where p(t) is compared to an acceptable price p a , that is a monotonously decreasing function of S(t).
be covered either by electricity stored in the battery or by buying electricity from the market by paying the price p(t) per unit of energy. Market prices are typically updated in hourly or quarter-hourly steps. Hence, we simulate system operation in discrete time steps of length ∆t = one hour. In the following, energy is always given in units of kWh, and the power demand is given in units of kW.
The basic operation of the BESS system is determined by a controller that consider the current price and the state of the BESS. In each time interval t, the controller at household j determines the amount of energy E j (t) purchased from the grid. Neglecting losses, the energy stored in the BESS increases by a portion of the purchased energy and decreases by the residual energy due to demand D j (t) · ∆t. The state of charge of the BESS S j (t), defined relative to the capacity S Cap , thus evolves as 4 The characteristics of the demand time series D j (t) and the operation of the controller that determines E j (t) are discussed below.

A. Demand patterns
This paper deals with the statistical properties of electricity consumption and collective effects emerging in the system compromised of many users, such that a large amount of input data is required. We use a recently developed statistical model for the demand time series D j (t), which captures essential features of real-world demand fluctuation patterns [20].
In the model, the demand time series of a household is given by a stochastic process where the x k (t) are independent Ornstein-Uhlbeck (OU) processes with zero mean, diffusion constant σ OU and mean-reversion strength γ D [21] and we choose L = 3 following [20].
This model leads to the stationary distribution of the demand D j being described by the

Maxwell-Boltzmann distribution
We note that the standard deviation of the individual Ornstein-Uhlenbeck processes equals the scale parameter of the Maxwell-Boltzmann distribution, σ M B = σ OU . Hence, distributions with different variability can be readily generated by tuning the diffusion parameter in the individual OU processes x k (t).
In the numerical simulation, we generate the individual OU processes using a Markov Chain Monte Carlo method. The transition probability from state x 0 at time t 0 to state x 1 at time t 0 + ∆t is given by While the authors in Ref. [20] used the offset µ M B to fit different measured load time series, our analysis only necessitates the correct stochastic behavior of the resulting load time series and thus we set µ M B = 0 for the analysis. Furthermore, we choose the scale parameter to give an average demand of D j = 0.5kW, resulting in about 12kWh consumption per household and day. The choice of the mean reversion rate γ D determines the time scale of the stochastic demand series. We choose this to be set to γ D = 1h −1 .

B. Price time series
The real-time electricity price p(t) is the essential variable driving the operation of the BESS controller. To enable more detailed stochastic investigations, we use synthetic time series, which are designed to reproduce essential statistic features of real-world time series.
In particular, we model p(t) as a one-dimensional OU process with parameters µ p , σ p , and γ p . The mean and the standard deviation are are set to µ p = 39.46 ct/kWh and σ p = 20.69 ct/kWh, respectively, corresponding to the value observed in German intraday spot market in the year 2014-2020. The mean reversion rate γ p is kept as a tunable parameter to analyze the impact of correlations on the DR effect. We mostly use γ p = 0.2 h −1 for illustrative purposes, but give the final results for different values of γ p . The transition probabilities are given by an analog expression as in (4).
We note that consumer prices are generally much higher than wholesale market prices.
However, any constant shift or scaling of the prices does not affect the results of our simulations. In fact, such a rescaling will only lead to an equivalent rescaling of the acceptable prices p a,j .

C. Controller model
The BESS control system must determine how much electrical energy E j (t) is purchased from the grid in the time interval t. The development of optimal control algorithms for DR is a wide research field, and important progress has been made (see [22,23] for recent reviews). The scope of this study is a very different one, focusing on collective effects and emergent statistical properties. Hence, we keep the controller model as concise as possible.
First, we do not include any forecasting in the control law. Decisions are made on the basis of the current state of charge of the BESS S j (t) and the electricity price p(t). In addition, the controller must take into account the variable D j (t) to ensure that the demand is always met and the battery limits are obeyed.
Second, we assume that the controller has only two basic options: Either it chooses to cover the demand completely from the battery such that E j (t) = 0 kWh, or it chooses to draw power from the grid to recharge and satisfy the demand. Recharging is always done at a maximum charging rate c r S Cap , where c r ∈ [0, 1] h −1 is a tunable parameter. In this case, the household will draw the energy from the grid. Small adjustments must be made to ensure the demand is always met and the battery is never overloaded, i.e., S j (t + 1) ∈ [0, 1] is always satisfied. Revisiting Eq. (1), we find the following constraints. If the state of charge is too low to cover the demand in the current time interval, E j (t) = 0 is impossible, and the BESS has to draw the energy If the BESS is almost full such that Eq. (5) would lead to overloading, the BESS can only draw the energy D j (t) ∆t from the grid.
Finally, we assume that the decision of whether to draw energy from the grid or not is reached by comparing the market price p(t) to an acceptable price p a,j (t). Hence, the control law can be formulated as The acceptable price depends on the state of change S j (t) of the BESS. If the BESS is almost fully charged, there is no need to purchase electricity such that p a,j will be large. If the BESS is almost empty, recharging is urgent, and p a,j will be small. In the following, we assume a simple affine linear law Note, the parameters for q and k in Eq. (7) give the acceptable price for a full and empty BESS, respectively. The actual value of the parameters q and k are determined to optimize the total costs of a single household and depend on the properties of the demand, price statistics, and the BESS itself. We will discuss this aspect in the following section.

III. DEMAND RESPONSE EFFECT AT THE HOUSEHOLD LEVEL
The DR system shifts the electricity demand of the households in time. Without DR, a household consumes the demand D j (t) directly from the grid; with DR, the purchases are instead given by the time series E j (t). By shifting to time intervals of lower prices, DR can thus reduce the total electricity cost of a household. We first analyze this effect from the perspective of a single household before we turn to systemic effects and statistical properties in the next section. A sample simulation can be seen in Fig. 2. As the price is modeled as an Ornstein-Uhlenback process, its stationary distribution P (p) follows a Gaussian distribution, while the demand distribution follows a Maxwell-Boltzmann distribution (left column of Fig. 2). Using the control function described in Section II C, the state of charge S and acceptable price p a interact to drive the system dynamics.
To understand the underlying dynamics, we need a closer look at the time evolution of the price p, acceptable price p a , and the state of charge S. In Fig. 3 of the same simulation as in Fig. 2 is presented. The time windows where the acceptable price p a is above the market price p(t), i.e., where the battery is charged if the limits are not exceeded, are indicated by the green shaded regions. At times where the price is too large, the battery can be used to cover the demand. Thus, the demand has been shifted away from the times of high prices to the green shaded time regions. To quantify the impact of the DR system for a single household, we consider the average cost that a household j has to pay for the energy drawn from the grid in N t time steps, as well as its volatility expressed by the standard deviation σ C . We assume that all customers individually minimize their average costs µ C and design the controller accordingly.
Furthermore, we consider the mean µ and the standard deviation σ of the time series S(t) and E(t) to characterize the operation of the DR system. Obviously, all characteristics depend on the properties of the BESS system and the controller as well as the properties of the stochastic processes D j (t) and p(t). In the following, we fix the parameters of the stochastic processes to the values given in the previous section and focus on the BESS and control system.
To begin with, we consider an even simpler control law with a constant acceptable price p a,j = k, see Fig. 4. This simplified treatment provides some fundamental insights into the operation of the BESS, which is helpful for the analysis of the full system provided below.
We find that even in this simple case, a substantial reduction of the electricity costs is possible. For a large BESS with capacity S Cap = 40, we find a reduction by reduction by more than 50%.
In all cases, we find that there is an optimum value of the acceptable price k * , for which the average electricity price µ C assumes a minimum. Notably, this optimum value is considerably lower than the average market price. For p a,j = k * , the system makes use of the battery in an optimum way. It is heavily charged and discharged such that the standard deviation σ S assumes a maximum. States with high and low charges are equally probable such that. The purchases E j (t) are also most volatile at the optimum point.
We now turn back to the original control law given in Eq. (7), where the controller takes into account the state of charge of the battery. The control law is characterized by two parameters, k and q, which are chosen to minimize the average costs µ C . In particular, we carry out a parameter scan for any given BESS system to find the optimum values q * and k * , as shown in Fig. 5. We find that a household can reduce its electricity costs considerably by the DR system depending on the size of the BESS. For a BESS capacity of S Cap = 40 kWh, we find a reduction of µ C by more than a factor of 4 at optimum parameters. In the following simulations, we will always assume that all households set the control parameters to the optimum values k * and q * .  which is assumed to be constant here. We observe a minimum in the average price µ C that gets more pronounced with increasing storage capacity S Cap . At the this optimum point, σ E and σ S assume a maximum.
A systematic study of the impact of the technical parameters of the BESS on the DR effect is provided in Fig. 6. We find that the average electricity cost µ C at optimum parameter choices decreases monotonically with the available storage capacity S Cap . That is, the larger the BESS, the more it can contribute to load shifting and hence to a reduction of household electricity cost. The slope decreases slightly with the capacity S Cap , but we see

IV. SYSTEMIC EFFECTS AND STATISTICS OF DR
The result of the previous section confirms that DR can lead to a substantial reduction of a household's electricity costs by shifting electricity purchases to time intervals with lower prices. As low prices typically correspond to periods of high renewable power generation, this is considered beneficial for the operation and stability of the entire power system. We will now demonstrate an important limitation to this general conclusion due to the collective effects induced by real-time DR.
To quantify the collective effects and the impact on the system, we simulate the operation of many households. All households j = 1, . . . , N have different demand patterns D j (t) but react to the same price signal p(t). For the sake of simplicity, we furthermore assume that the parameters of the BESS are identical and that each household chooses the same optimal control parameters p * and k * . The impact on the electricity system is analyzed in terms of (i) the statistics of the total grid load E tot (t) = N j=1 E j (t) and (ii) the fraction of electricity  purchased at a certain price p. The latter quantity is estimated from the simulation results as Here, the sum over the variable t is restricted to time steps where the price satisfies p(t) ∈ [p, p + ∆p], i.e., where it falls in a small interval around the given price p. The variable N denotes a normalization constant which ensures that the integral over Z(p) equals one such that we can interpret Z(p) as the density of purchases at a certain price.
Consider first the case of no DR, which is recovered in the above model by setting S Cap = 0 kWh. Electricity is drawn from the grid whenever demanded, E j (t) = D j (t), independent of the actual price p(t). Hence, the likeliness of buying at a certain price, Z(p), equals the PDF of the market price p(t), see Fig. 7. The individual purchases E j (t) fluctuate strongly, but the total system load E tot (t) does not. In fact, the individual fluctuations average out such that the total grid load is almost constant at a level of where the brackets denote averaging over time steps and households. The residual small In the presence of DR (S Cap > 0 kWh, solid lines), customers can shift the purchases to periods with lower prices. Hence, the density function Z(p) is strongly shifted to lower values of p. In all cases, we use optimized parameters k * and q * for the controller. The charging flow to the batteries c r · S Cap was chosen as 2kW and 6kW for the results presented on the left and right sides, respectively.
fluctuations around this value are well described by a narrow Gaussian PDF, see Fig. 8.
According to the central limit theorem, the relative width of the Gaussian decreases as This picture is completely altered in the presence of real-time DR. Customers shift their load to periods with lower prices to reduce their costs. Hence, the density function Z(p) of purchases in a certain price interval is strongly shifted to lower values of p, as shown in which is equivalent to the distribution of the demand D. When the time spent in either high or low price regimes is short enough to allow the battery device to be used effectively, the distribution of the total purchased energy E tot , i.e., the stress to the grid, is broad, and situations with large total demand become very likely. As the price dynamics gets slower, the distribution changes from an almost horizontal shape by narrowing considerably. and the central limit theorem no longer applies. The impact on the statistics of the total grid E tot (t) is dramatic, as shown in Fig. 8. Instead of a narrow normal distribution, we now find a wide bathtub-shaped distribution. Events where all customers synchronously draw the maximum amount of power are quite likely. In particular, such events take place after a longer period of high prices, where all BESS are empty, the acceptable prices p a,j are high, and all households start charging when the price finally drops [19]. These crucial events result in a peak of the distribution at the right edge at increasing linearly with the system size N . Such periods with large energy purchases, i.e.
stress to the grid, can be critical for the stability of the electric power grid by triggering malfunctions that might ultimately results in a blackout [24]. Remarkably, such events can not even be considered rare, as the probability density shows pronounced peaks. We note that similar distributions with peaks at the right edge have been intensively studied in reliability theory [25]. In Fig. 8, it is also shown how this effect changes for different mean reversion rates of the price γ p . If smaller and smaller γ p are used to generate the price time series p(t), high stress situations become more and more unlikely since the battery storage device cannot sustain the long periods of high prices and the demand response effect is diminished. Although one might consider these situations as preferable due to the absence of high stress situations, they are not beneficial to the individual households. Since they are not able to escape high prices with the help of the BESS, the average cost of a household is considerably higher than in case with faster price dynamics, which is not desirable to individual households.
To further quantify the likelihood of situations that strongly affect the grid, we evaluate the probability P (E tot > f · D ·∆t) that the purchases energy exceeds the average demanded energy D · ∆t by a factor of f . Results are shown as a function of the capacity S Cap of the BESS in Fig. 9. Without DR, extreme events with f > 2 are never observed in our simulations. This is a direct consequence of the central limit theorem, which states that large deviations from the mean are exponentially unlikely. DR now makes these events possible as the demand is accumulated during time periods with low prices. In particular, we find that extreme events become possible if the capacity S Cap exceeds a threshold value.
If the capacity increases further, the likeliness decreases again because purchases are further concentrated to fewer and fewer points in time. That is, extreme events become less likely but more pronounced in their magnitude.  Figure 9. Stress to the grid for different battery sizes. The probability P (E tot > f · D tot · ∆t) of the total purchases energy is larger than f -times the average total demand D tot at the optimal strategy parameters q * and k * . Using larger batteries by increasing their capacity S Cap generally decreases the stress to the grid but for one important effect. There is a sharp increase in the likelihood of very high stress situations for different f values if one increases the capacity of the batteries.

V. DISCUSSION
Demand response (DR) summarizes a variety of approaches to adapt the demand for electric power to better match the supply. This can be achieved by load shifting -consumers shift their demand in time and may receive financial compensation for the utility company in return. DR can be an important source of flexibility in future renewable power systems, where the generation is volatile and cannot be easily adapted to the demand.
In this article, we have analyzed a model demand response system from a statistical viewpoint. Load shifting is realized by the optimized charging of a household battery electric storage system in response to real-time electricity pricing. Such storage systems are often installed together with a rooftop photovoltaic system, and it becomes increasingly important to their role in the operation of the entire system.
On average, the model DR systems provide the desired load shifting effect. However, the statistics of the grid loads change dramatically, which may have unwanted or even harmful effects. These effects manifest the collective behaviour of many DR systems driven by the same price signals. Without DR, the electricity load of single households is largely uncorrelated besides the common daily profile. Hence individual fluctuations average out, and the total grid load is smoothed. With DR, the electricity load can get synchronized.
The smoothing effect is lost, and we observe pronounced peaks instead. The distribution of the grid load then assumes a bathtub shape with pronounced peaks at zero and peak load.
Importantly, the demand peaks do not necessarily occur during the periods of the lowest prices. Instead, they may also occur if the price drops after a long period of high values.
In such a case, DR operation may be counter-productive for system stability, introducing demand peaks at times of limited generation.
In conclusion, we have demonstrated that demand response may induce load shifting patterns with intricate statistical properties. An analysis of the potentials of DR should not neglect the complexity of the emergent statistics. A comprehensive assessment of the benefits of DR requires a comprehensive statistical analysis of the systemic impacts.