A network approach to decentralized coordination of energy production-consumption grids

Energy grids are facing a relatively new paradigm consisting in the formation of local distributed energy sources and loads that can operate in parallel independently from the main power grid (usually called microgrids). One of the main challenges in microgrid-like networks management is that of self-adapting to the production and demands in a decentralized coordinated way. Here, we propose a stylized model that allows to analytically predict the coordination of the elements in the network, depending on the network topology. Surprisingly, almost global coordination is attained when users interact locally, with a small neighborhood, instead of the obvious but more costly all-to-all coordination. We compute analytically the optimal value of coordinated users in random homogeneous networks. The methodology proposed opens a new way of confronting the analysis of energy demand-side management in networked systems.

However, the analysis of microgrids present new challenges rooted in its own idiosyncrasy of functioning, in particular the problem of distributed control [14][15][16][17][18]. Users in a microgrid can be understood as nodes of a production-consumption network operating, ideally, disconnected from the main electric grid. A microgrid can be powered by distributed generators, batteries, and/or renewable resources like solar panels. Depending on how it is charged and how its requirements are managed, a microgrid might run alone indefinitely. The main problem in this set up is to achieve a good balance between production and consumption in such a way that users are always coordinated in the use of the available energy. The scenario depicted can be abstracted to the mathematical problem of assessing local coordination of networked agents having access to the information of the total energy production in time. Note that total PLOS ONE | https://doi.org/10.1371/journal.pone.0191495 January 24, 2018 1 / 11 a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 production can be simply broadcasted to all individuals, however global coordination is a costly and difficult interplay.
Here we take advantage of the theory of complex networks to propose a stylized model for coordinating the different users' consumption demands according to the energy produced within the microgrid. Our results show that local coordination can effectively provide a way to satisfy users' demands restricted to the available energy production. The model, for random homogeneous networks, raises interesting results, attaining very large coordination levels (more than 95% of users) for relatively low number of coordinating neighbors (usually 10 −3 N, being N the number of users).

A coordination model for decentralized production-consumption control
We consider a population of N networked users representing the users of the microgrid. To simplify the users' consumption activity, each user i is characterized by a binary variable λ i that denotes its state, which can be either on (1) or off (0), for i = 1. . .N. The control goal is for the system to reach a "target" configuration, characterized by the parameter α (0 α 1), which represents the fraction of users that should be on, that is the consumption (load) that can be attained given the energy production. This is not the physical synchronization of the nodes of the underlying electrical grid, but a measure of how many users should concurrently consume electricity in order to match the available energy. To reach this target configuration we propose the dynamical model illustrated in Fig 1. At each time step, an user i is randomly selected among the population. The user only has partial information on the state of the system, that is it only sees its own state and the state of its neighbors. This information provides the local configuration of the system, centered on user i, where k i is the user's degree (i.e. the number of neighbours), and N ðiÞ its neighbors set. The user compares the local configuration χ(i) with the target configuration α. If they differ, then it evaluates if changing its own state would reduce the difference between α and the new local configuration, that is given byŵðiÞ ¼ . If indeed ja ÀŵðiÞj < ja À wðiÞj then the user changes its state λ i to 1 − λ i , otherwise it keeps its state as it is. In the physics literature, the proposed model corresponds to an Ising model in an uniform external field and temperature equal to zero.

Optimal coordination in random homogeneous networks
We test the previous model on Erdős-Rényi (ER) networks, of size N, with different edge probabilities p, that determine the network average degree hki = p(N − 1). The network topology defines the "social" neighbors each user coordinates with, and does not need to correspond with the underlying distribution network users' households are connected to. Even though ER networks do not reproduce the main characteristics of empirical social networks, the interest here is to investigate the minimum number of neighbors users need to coordinate with in order for the target configuration to be achieved. Coordination could then take place online, via a dedicated app, therefore the proposed social structure does not need to correspond to observed online and offline social networks. We start from an initial configuration in which states are randomly assigned so that approximately half of the users are on, and half are off, and we run the dynamics described in the previous section until the system reaches an stationary state. To represent the coordination level C of users with the energy production, we define We also define a second measure, that we will call alteration level A, indicating the fraction of users that have changed their state according to the model The lower the alteration the better in terms of users' initial requirements. The results of the simulations are reported in Fig 2, green circles. The three top panels show, for different values of α, the system coordination level at the stationary state. The three bottom panels show the system alteration level, that is the fraction of users that at the stationary state have a different state with respect to the initial configuration. We show results only for α > 0.5 because, thanks to symmetry, for each value of α < 0.5 the results are the same as for 1 − α.
The results reveal that it exists a value of the connectivity, represented by the probability p of connecting two nodes, for which the coordination is almost complete and the alteration is minimal (for p < 1). For this value, the target configuration is reached with the least effort (i.e. the least change in the users' states) and less communication. The result is only improved at a larger cost when p = 1, that is when each user is connected to every other user in the network, because in this topology users have complete information on the state of the system.
This surprising result can be explained by noticing that when the local configuration χ(i) only includes a few users, which is what happens when p approaches 0, then on states are favored. This is true when α > 0.5. If α < 0.5 the following reasoning can be reversed symmetrically for off states. Consider for example an isolated user (k i = 0). For any α > 0.5, χ(i) is either 1 or 0 (if the user is on or off, respectively), therefore the user always prefers the on state, because |α − 1| < |α − 0|. Moreover, for an user with only one neighbor (k i = 1), χ(i) can be Therefore if α > 0.75, the user turns on (or remains on if it already was) for any value of its neighbor's state, because this is what minimizes |α − χ(i)| in all cases. This reasoning can be extended for higher values of k, up to a point in which k is large enough so that χ(i) can take enough different values for the discretization not to bias the choice of the state. Therefore, below a critical p (whose value depends on α), the fraction of users that at the stationary state are on starts increasing while p decreases, reaching 1 when p = 0. Correspondingly, the coordination level defined by Eq 2 equals α when p = 0 and the fraction of on users is 1. It then increases with p while the fraction of on users decreases approaching the target state α, until a point in which this fraction becomes smaller than α, after which the coordination level starts decreasing as the configuration starts distancing the target state on the opposite direction (that is, before the maximum there were too many on users, after it there are too few). After reaching a minimum at the critical value of p for which discretization does not favor on states anymore, the coordination level starts increasing again while p increases (since more and more information available to the users), reaching 1 when p = 1.
For every α considered, we can identify some small value of p for which we have both high coordination and low alteration, showing that, reducing the number of users that have to coordinate can actually improve the whole system coordination in random homogeneous networks.

Mean-field approach
In this section we derive the mean-field analytical calculation of the coordination level for a given p, and then find the critical values of p for which coordination takes its minimum and maximum (in the 0 < p < 1 region). Let us denote with U(t) the number of users that at time t are on. This quantity evolves over time according to the following equation: where p 01 (p, U(t)) is the probability of an user to switch its status from 0 to 1 and p 10 (p, U(t)) the probability of switching from 1 to 0. The former probability is multiplied by the probability of finding an off user in the population, that is NÀ UðtÞ N , and the latter by the probability of finding an on user, that is UðtÞ N . According to the model presented, the two switching probabilities follow the binomial distribution: and θ(x) is the Heavside step function, which is 0 if x < 0, and 1 otherwise. At the stationary state, Eq 4 becomes p 01 ðp; U 1 ÞðN À U 1 Þ À p 10 ðp; U 1 ÞU 1 ¼ 0 : Solving this equation numerically as a fixed point equation, we obtain U 1 , that is the number of on users at the stationary state, and then we use it to compute the coordination level, that is given by 1 À ja À U 1 N j. The results are shown in Fig 2 as blue dots. Note that the results of the mean-field approach present the exact qualitative behavior of the numerical simulations, with a shift that comes from the neglected correlations, having the same optimal values of p † and p Ã for which minimum and maximum coordination is attained, respectively. The value of p † corresponding to the minimal coordination (red line) can be computed by solving the following system of equations: where gðp; U 1 Þ N p 01 ðp; U 1 Þ p 01 ðp; U 1 Þ þ p 10 ðp; U 1 Þ : The values of p Ã corresponding to maximum coordination (purple line) can be computed by solving Eq 9 with respect to p, having fixed U 1 = αN.
To check the accuracy of the analytical calculations, we run simulations on an annealed random network, which must be coherent with the mean-field approach. Simulations on the anneal network are conducted as follows. Having assigned a degree k i to each user i according to a degree distribution generated by an ER graph G (N, p), we then let the user see a different random subset k i of the population each time it is selected, instead of the same fixed set of neighbors. The results of this model are shown as light blue squares in Fig 2, and perfectly match the analytical dots, as expected.
For most values of p, the coordination level is higher for the annealed version of the model than for the original network. However, not fixing the network structure also implies a higher number of switches during the dynamics, since the local configuration of a node constantly changes. This is reflected in the alteration level, which is always higher for the annealed network, as shown in the bottom panels of Fig 2.  Fig 3 shows the evolution of the coordination and alteration levels over time for both models, for a specific p, which is chosen as a function of α as the smallest p that maximizes coordination and minimizes alteration (see the corresponding points in Fig 2). We can observe that, for these values of p, the coordination level is approximatively the same in the two models, whereas alteration is systematically lower in the original model. This indicates that fixing the network topology can lead to the same amount of coordination than in a mean-field situation, but with less effort (i.e. fewer changes in the users' states).

Discussion
Let us now discuss how the proposed model can be applied to energy demand side management. Suppose a microgrid which produces a daily amount of energy E, that has to be shared among its N households. Let us assume that over the whole day the microgrid produces enough energy to sustain the users daily consumption, i.e. the total demand, also known as load L, is equal to E. Even under this assumption, what it is crucial for the microgrid to work in isolated mode is that production and consumption match at each time.
Let us split the day in two parts, that we will simply call, with an abuse of lexicon, morning and afternoon. Imagine that a fraction α of E is produced in the morning, and the remaining 1 − α fraction in the afternoon. Each household in the microgrid is equipped with its own home appliances, that users turn on at different times of the day. Let us focus, as an example, on the washing machine. We suppose that each household wants to run the washing machine once per day, either in the morning or in the afternoon. To reach a matching of energy production and consumption, the system would need α per cent of the households to run, for example, the washing machine in the morning, and the other 1 − α per cent in the afternoon. This is the same idea at the basis of the proposed model, in which the target configuration is to have αN users in the on state, and (1 − α)N off. In the microgrid scenario, the target configuration of the model represents the fraction of energy available in the morning, and therefore the expected number of households that should run their washing machines in the morning. The results presented in the previous sections suggest that, in a situation in which no global information is available, a good matching between energy production and consumption can be obtained with very little information, having households coordinating only locally with their closest neighbors.
The model can be extended to take into account a more realistic scenario in which the day is divided in H = 24 parts, that is the 24 hours, and each household has several appliances that might be used during the day. Each user i is now characterized, instead that by a scalar variable λ i , by a vector θ i composed of H elements each corresponding to a given hour of the day, and each equal to either 1 (on) or 0 (off). Inspired by real-world consumption patterns, the initial distribution of on elements within the N vectors θ i is such that their normalized sum has the shape shown in the bottom panel of Fig 4 (light blue bars). The target configuration is now also a vector of length H, whose shape (lilac bars in Fig 4) is inspired by real-world microgrid production patterns based mostly on solar energy, and we set As in the previous model, at each time step an user i is randomly chosen and evaluates the local configuration, given by its own and its neighbors' state vectors: The user then "moves" one of its loads that is in a hour slot h 0 (i.e. θ i,h 0 = 1) where the local configuration exceeds the available energy (i.e. j h 0 À N k i þ1 ð1 þ P n2N ðiÞ y n;h 0 Þj > j h 0 À N k i þ1 P n2N ðiÞ y n;h 0 j), to a hour slot h@ where currently the user has no load (i.e. θ i,h@ = 0), and adding a load would improve the matching between the local and the target configuration (i.e. j h @ À N k i þ1 P n2N ðiÞ y n;h @ j < j h 0 À N k i þ1 ð1 þ P n2N ðiÞ y n;h @ Þj). If this is the case for more than one pair of hour slots (h 0 , h@), then the slots are chosen with probability proportional to the improvement that the move would provide to the matching between the target and the local configuration. At the end of this evaluation process, θ i,h@ = 1 and θ i,h 0 = 0, and then a new user is randomly selected, and so on, until the system reaches a stationary state. The two bottom panels of Fig 4 show the results of numerical simulations of the model on ER graphs with different edge probabilities p. The left panel shows, for each p, the system coordination level at the stationary state, now defined as The right panel shows the system alteration level, defined as the average difference between the users' state vector at the beginning of the dynamics and at the stationary state, that is: X H h¼1 jy i;h ðt ¼ 1Þ À y i;h ðt ¼ 0Þj : Again, full coordination and minimal alteration are obviously reached at p = 1. The coordination level then decreases as p decreases, until a critical point below which coordination starts increasing again, until it drops again for p = 0, as found in the previous model too. Interestingly, in ER networks of 1000 nodes, there is a range of p values, from p = 0.003 to p = 0.001, for which coordination increases while alteration decreases. This means that even in this extended model we find that a reduced set of coordinating users can actually be beneficial to approach the target configuration. Therefore, in the microgrid scenario with no complete information on the consumption patterns of all households, having information about, on average, only one other household can lead to a good matching between the grid available energy and the households' total load, with relatively little alteration in users schedules. The proposed model clearly presents a series of limitations. First, energy loads are modeled as binary (either on or off), instead of using numerical values representing consumed kilowatthours. Second, the microgrid is assumed to produce sufficient energy to supply the total daily consumption, which is often not the case in real microgrid settings. Third, the role of prosumers is not explicitly taken into account, the energy they produce being implicitly included in the total available energy E. These assumptions are strong and need to be overcome in future work. Moreover, the modeled social coordination takes place on top of a physical networkthe distributed grid-requiring additional synchronization. Future work should explicitly take into account both layers to attempt at proposing a more comprehensive model of physical and social synchronization in distributed energy systems.