Energy Management in Prosumer Communities: A Coordinated Approach

: The introduction of uncontrollable renewable energy is having a positive impact on our health, the climate, and the economy, but it is also pushing the limits of the power system. The main reason for this is that, in any power system, the generation and consumption must match each other at all times. Thus, if we want to further introduce uncontrollable generation, we need a large ability to manage the demand. However, the ability to control the power consumption of existing demand management approaches is limited, and most of these approaches cannot contribute to the introduction of reneweables, because they do not consider distributed uncontrolled consumption and generation in the control. Furthermore, these methods do not allow users to exchange or jointly manage their power generation and consumption. In this context, we propose an augmented energy management model for prosumers (i.e., producer and consumer). This model considers controlled and uncontrolled generation and consumption, as well as the prosumer’s ability (i) to plan the intended power consumption; and (ii) to manage real-time deviations from the intended consumption. We apply this model to the energy management of prosumer communities, by allowing the prosumers to coordinate their power consumption plan, to manage the deviations from the intended consumption, and to help each other by compensating deviations. The proposed approach seeks to enhance the power system, and to enable a prosumer society that takes account social and environmental issues, as well as each prosumer’s quality of life. Abstract: The introduction of uncontrollable renewable energy is having a positive impact on our health, the climate, and the economy, but it is also pushing the limits of the power system. The main reason for this is that, in any power system, the generation and consumption must match each other at all times. Thus, if we want to further introduce uncontrollable generation, we need a large ability to manage the demand. However, the ability to control the power consumption of existing demand management approaches is limited, and most of these approaches cannot contribute to the introduction of reneweables, because they do not consider distributed uncontrolled consumption and generation in the control. Furthermore, these methods do not allow users to exchange or jointly manage their power generation and consumption. In this context, we propose an augmented energy management model for prosumers (i.e., producer and consumer). This model considers controlled and uncontrolled generation and consumption, as well as the prosumer’s ability (i) to plan the intended power consumption; and (ii) to manage real-time deviations from the intended consumption. We apply this model to the energy management of prosumer communities, by allowing the prosumers to coordinate their power consumption plan, to manage the deviations from the intended consumption, and to help each other by compensating deviations. The proposed approach seeks to enhance the power system, and to enable a prosumer society that takes account social and environmental issues, as well as each prosumer’s quality of life.


Introduction
The traditional power system is a uni-directional centralized system, where the generation is controlled and the demand is mostly uncontrolled. It assumes that a large demand is aggregated, so that consumption is made smoother, making the generation control easier, thus increasing stability and reliability.
During the last 30 years, information and communication technologies have been introduced in the generation, transmission and distribution systems of the power grid. These technologies are commonly known as the "smartgrid" and have been used to improve the power system's reliability. In recent years, advanced countries (e.g., Japan, USA, Germany [1]) have shifted their priorities: (i) to having a better management of the energy consumption; and (ii) to diversifying the generation mix, all these mainly due to environmental concerns and demographics changes (e.g., decrease in population size), or seeking to reduce cost and increase energy security [2]. As a result, these countries have implemented demand management programs to suppress energy usage (e.g., through power efficient appliances), and to reduce high consumption peaks (e.g., through the so-called demand respond programs).
An additional trend has been the recent rapid introduction of uncontrollable renewables (such as Photo-voltaic (PV) and wind). This is the result of (i) the lower cost of renewables and batteries; and (ii) government policies encouraging the installation of renewables (e.g., the feed-in tariff scheme). As a consequence, more consumers have installed their own generation, energy storage and energy management systems (EMS).
In addition to the energy management of individual users, the energy management of groups of users has been addressed through the so called demand response programs, programs that have been mainly used to increase stability and reduce cost. Although these program have had a positive impact, their ability to control the power consumption is limited. These approaches usually only manage controllable devices, with uncontrolled consumption and generation not being explicitly considered. Therefore, they do not contribute much to the introduction of reneweables. Furthermore, these approaches do not provide mechanisms for consumers and producers to exchange power or to jointly manage their generation and consumption. As a result, demand response cannot have a large positive impact on the power system.
In summary, we are observing a rapid introduction of distributed uncontrollable renewables and some advances in the ability to control the demand, in particular of individual users. The question becomes how to manage distributed controllable demand, while taking into account uncontrollable generation and uncontrolled consumption. This general question is the primary problem addressed in this paper.
In this context, each user should be considered as potential prosumer, i.e., a consumer and producer of energy, and therefore an energy management system for a society of prosumers is needed. From the social point-of-view, the introduction of such a system implies that a new market would emerge, where the users would be able: (i) to exchange energy and capacity; and (ii) to coordinate power consumption and generation, among others (e.g., to decide which energy they want to consume based on origin and source type). To implement such prosumer community, a new energy management approach is required.
Most existing demand management technologies have been developed from the generation-side's point-of-view and for the grid (thus the term "smart-grid"). However, such systems should be designed from the user's point-of-view, i.e., from the demand's point-of-view. Our work focuses on the latter direction, and to refer to our primary goal we use the term energy management, instead of "smart-grid".
When developing an energy management from the demand-side's point-of-view, it is natural to consider a decentralized management approach, in particular when each user is a potential prosumer. Thus, similar to information networks where small-scale local networks are inter-connected and form a bi-directional distributed network (the Internet) where two end-points can communicate, the energy management system needs to be distributed with all end-points having the ability to control their consumption and generation, and it needs to be bi-directional, with any two end-points being able to coordinate (or exchange) power consumption and generation [3]. Any energy management system, distributed or not, needs to consider the energy markets it interacts with. The structure of existing energy markets is basically the same across countries and regions: a day-ahead market seeks to determine (plan) the generation for the day -using economic and technical criteria-, while a real-time market seeks to minimize deviations from the intended generation (as defined in the day-ahead market). While large consumers take these markets into account in their energy management, energy management system associated to small consumers commonly manage these markets independently (e.g., "day-ahead" through time-of-use (TOU) prices, and "real-time" through critical-peak-prices (CPP) or curtailment programs). To achieve an effective management, demand management systems need to take into account both markets, and in particular the day-ahead management needs to take into account the real-time management that will take place during the day.
Seeking to address the issues discussed above, in this work we augment the demand management proposed in [4,5] using the ideas on demand management introduced in [3] and the ideas on coordinated energy management of prosumer communities outlined in [6]. For this, we propose an augmented power consumption management model that considers uncontrolled power consumption and generation, day-ahead controllable power, and real-time controllable power. We then use this model in the coordination of prosumer communities taking into account: (i) uncontrolled consumption and generation (real-time and forecast); and (ii) power management ability (real-time and scheduled) to achieve an intended power consumption, both at the agent and community level.
Paper structure. We first present a preliminary discussion on energy management (Section 2), including a brief discussion on policies and markets (Section 2.1), an outline of energy management paradigms (Section 2.2), and a discussion on coordinated energy management (Sections 2.3 and 2.4). Afterwards (Section 3) we present the proposed augmented power consumption management model and (Section 4) we describe the use of the augmented model in the context of a community, in particular for day-ahead coordinated energy management. Finally, we illustrate and validate the proposed augmented coordinated energy management in simulation (Section 5), to later conclude (Section 6).

Government Policies and Market Structure
Modeling energy systems requires the consideration of many issues, from technical and sustainability issues, to social and economical ones [7]. While these issues vary across countries, geographical locations and time, if we look at the big picture, the differences across countries are minor. In particular there are two key issues related to the introduction of uncontrollable generation and due to government policies trying to modify the generation mix and liberalize the energy market.
We will use the Japanese case to illustrate these issues. Let us first look at some context. From April 2016, Japan is continuing with a long process to deregulate its energy system and to change its energy mix. This process started several years ago, but it was disrupted and sped up after the earthquake and Fukushima-accident in 2011, in particular after all nuclear reactors were shut down. As a result two government policies were introduced to increase renewables and liberalize the retail market.
One such policy is the introduction of Fit-In-Tariff (FIT) programs [8], which in Japan and many countries seek to provide an incentive for the introduction of renewables. While this has promoted the installation of PVs, it has had two consequences. First, it is not clear what users will do after the FIT program period finishes (e.g., in the case of the 10-year program, small producers may not be able to inject power back to the grid). Second, some power systems started to apply restrictions to the further installation of uncontrollable renewables, due to their limited controllable generation capacity (such restrictions have been applied in Kyushu, Japan). These two problems may slow down the integration of renewables, but this could be alleviated with the help of advanced demand energy management systems.
A second policy that has taken place in many countries is the deregularization of the energy market. In the case of Japan, a liberalization process started several years ago and will go through an important change in 2016 [2,9,10], where the power and gas retail markets will be completely opened In this power market, the retailers need to buy (in advance) power for every 30-min time slot, and later to manage, in real-time, deviations from the intended power consumption to avoid penalties. Thus, a retailer should have the ability to plan (day-ahead) the power usage, to update the plan (hour-ahead), and to manage controllable power (in real-time) under uncontrolled consumption and generation.
In this context we propose an augmented coordinated energy management system for prosumer communities that we think is of interest for Japan and others around the world, for instance the European Union and New York where power generation and retail is already liberalized and where FIT programs have been used. Before going into the proposed augmented coordinated energy management system, in the remaining of the present section we give a brief discussion on existing energy management paradigms, and present the basic formulation of coordinated energy management.

Energy Management Paradigms
Supply Management. The conventional power system is designed based on three main assumptions [11][12][13]: (i) the generation is controllable; (ii) the demand is uncontrollable (but can be forecast); and (iii) the generated power is distributed from a central location to the consumers. Taking these into account, four supply management mechanisms are used to maintain stability and reduce economic cost: (i) unit commitment; (ii) economic dispatch; (iii) frequency restoration mechanism; and (iv) contingency reserves. Unit-commitment and dispatch are used for scheduling generation and for online control of generation, respectively, and they are managed by a system operator seeking to reduce total economic cost. Frequency restoration is required due to the difference between nominal demand and scheduled generation, while contingency reserves are required to respond when large loss of power supply occurs.
Demand Management. Given that power consumption depends on humans' living activities, in the supply management described above, the power consumption is not controlled. This can cause high consumption peaks, which requires expensive operational reserve just to supply enough power during those high peaks. Thus, demand management methods have been introduced: (i) to reduce peaks of very high demand (to reduce costs); and (ii) to avoid blackouts (in particular at times of energy scarcity).

Demand Management Strategies
Given that energy supports living and work activities, any demand management should: (i) fulfill the user's Quality of Life (QoL), and at least satisfy minimum QoL requirements (i.e., the user has a lower bound in the required energy); (ii) control the power consumption timing (rather than only reducing total consumption); and (iii) consider that part of the power consumption is uncontrollable due to the human living activities. In the context of this trade-off between QoL and power control, a question that rises is who implements the demand management. In that sense, demand management methods can be arranged in two broad categories: demand management from the supply-side and from the demand-side.
Demand Management from the Supply-Side Methods in this category are commonly known as Demand Response (DR) [14][15][16][17] and used to avoid peaks of high demand (to reduce cost) and blackouts (due to consumption larger than available generation). To avoid confusion, we use the term "Demand Response" only to refer to methods that implement a demand management from the supply-side. DR approaches are centralized, where the supply-side manages the demand through an "aggregator" that sends a top-down control signal to the demand (see Figure 1a). The aggregator serves as an intermediary between generation and demand, by managing the demand to achieve an intended power consumption pattern. DR strategies can be grouped in two categories: • Event-based: an aggregator remotely controls appliances (and the associated loss or gain in QoL), with the control taking place at particular events. Examples include direct load control, emergency programs, curtailment programs, and demand bidding programs. • Price-based: an aggregator sends the same price-signal to all users, seeking to modify their consumption patterns. Based on the price signal, each user independently decides its power usage. Examples include time-of-use (TOU), critical-peak-pricing (CPP), and real-time-pricing (RTP).
Among all DR approaches, it has been argued [11] that (event-based) direct load control is the best alternative from the control point-of-view. However, it has the drawback of remotely controlling the appliances, making it difficult to manage QoL and to integrate uncontrollable distributed generation.
On the other hand, price-based DR allows each user to self manage his/her trade-off between QoL and cost, but the price-based top-down control (see Figures 1a and 2a) has limitations in the ability to control aggregated demands [11,18]. There are two main reasons for this. (i) Each user decides his/her power usage without communicating with the aggregator after receiving the price signal. Thus, it works as a feed-forward control; (ii) All users receive the same price signal, which may cause them to respond in a similar way (e.g., using power at the same time). Such a feed-forward control that uses the same price signal to control many users requires an accurate model of the users' behavior, model that is difficult to obtain due to the unpredictable nature of human living activities and to privacy issues.
To address these issues, variants of the basic price-based DR approach have been proposed: [19,20] proposed to measure response and to control demand with a (randomized) engineering signal rather than a market price, whereas [21,22] suggested to add constraints to the price based scheme. Dynamic pricing has been also proposed, but it can introduce instability and volatile prices and loads [23].
In summary, DR limitations include: (i) event-based methods cannot manage the consumption pattern without having an important impact on the users' QoL; and (ii) price-based methods cannot fully manage the consumption pattern. In addition, DR approaches cannot provide functionalities such as power exchange or coordination among users, nor handle distributed generation. During the last few years, the distributed management of power usage has been proposed (see, e.g., [18,[24][25][26][27]), where the users implement a distributed control and exchange information to achieve the energy management. In the literature, this kind of approach has been refereed to as distributed DR [27] and coordinated DR [18]. These methods can be characterized as demand management from the demand-side.
While these methods have shown promising results, most of them address the same issues of demand response, but in a distributed manner. Some of the issues not addressed by these methods include: • The energy management does not take QoL into account (e.g., in [28][29][30]): the formulations consider cost-based functions or assume linear / quadratic dynamic models of power usage. • They do not consider a common goal for the group, but just the goal of each agent in the group.
• They consider not only the management of the demand, but also the management of the grid (transmission, distribution, and energy hubs). Whereas managing the grid is important, we think the energy management of the demand should be done independently of the underlying grid.
We think that a demand management from the demand-side approach should address the following challenges: manage the demand in a fully responsive fashion, allow adjusting the consumption pattern in a general way (e.g., to compensate fluctuating uncontrollable renewables), allow agents to manage their own QoL, and allow them to exchange or coordinate their consumption and generation. Existing methods do not address all of these challenges.

Coordinated Energy Management
Coordinated energy management was proposed in [5], extended in [4], and its concept described in [6]. It belongs to the demand management from the demand-side category, but differs from other methods in this category in the problem it tries to solve and in the management approach. In the present section we will revisit its main ideas and basic formulation. In a nutshell, coordinated energy management seeks: • To allow each agent to manage its QoL and associated power consumption and generation.
• To allow each user to be a prosumer (i.e., a producer and a consumer).
• To allow prosumers to form a community and jointly manage their power usage taking into account a common goal for the community (e.g., reduce cost, increase use of renewables, etc.) • To achieve full responsiveness in energy management (e.g., that controllable consumption is able to match uncontrollable generation and consumption at all times, instead of just seeking to reduce economical cost, increase stability or respond to external requests). This is achieved by enabling the users to communicate and coordinate their power consumption and generation. This communication implements a feedback control loop among EMS agents (see Figure 2b), which enables better responsiveness in the control (i.e., fast and predictable control).
To better illustrate coordinated energy management, in the following we will contrasts it against price-based demand response, which is the most popular demand response program. We start by noting that price-based demand response can be understood as a best-effort a group of independent users, while coordinated energy management implements a best-effort of the community (see Figure 2a,b).

Day-Ahead Power Consumption Coordination Formulation
Let us assume a community consisting of N = |N | agents, with each agent i ∈ N having an associated decision variable x i ∈ R T representing the power consumption profile of agent i, and T the number of time slots. The power used by agent i at time slot t, x i,t , can be positive (consumption) or negative (generation). The power profile x i is controlled by an energy management system (EMS), and we will refer to this EMS as agent (an appliance, household, factory, office, etc.).
To model the community, a cost function is associated to each agent, f i (x i ), and a global cost, The cost function f i (x i ) of agent i can measure QoL, economic cost/benefit, and physical constraints associated x i , while the cost function g(∑ i∈N x i ) can measure economic cost/benefit, constraints, and flatness associated to the aggregated profile ∑ i∈N x i . Figure 3a presents a scheme of the coordination and the involved functions, and Figure 3b illustrates the profile-based cost functions (see [5]

for agent cost functions and examples).
Power

Power[W]
T Time 1 To coordinate the power usage taking into account the agents' and the global cost functions, the community solves the following optimization problem (known as the sharing problem): with x i ∈ R T ∀i ∈ N the decision variables. Note that the power price is not a decision variable.

Distributed Coordination Protocol
To solve problem (P1), the protocol introduced in [5] is used (extensions of this protocol have been presented in [4,31,32]). This protocol is based on the Alternating Direction Method of Multipliers (ADMM) [33], and it iteratively solves Problem (P1): with iteration index k, and whereν ∈ R T is a vector of Lagrange multipliers [34], ρ > 0 a constant. Here we have used the notationā to refer to the average of a set of variables {a i } i∈N (i.e.,ā = 1 N ∑ i∈N a i ). This algorithm yields convergence without assumptions such as strict convexity of f i and g [33].
The iterative algorithm in Equation (1) allows a distributed negotiation (see Figure 4b): The first step in Equation (1) is solved concurrently by each agent (agent i only needs to know b k ), while the second and third steps are evaluated by a coordinator, which aggregates {x k+1 i } i , to later calculatē x k+1 ,z k+1 andν k+1 , and finally broadcast b k+1 to all agents. Thus, to take part of the coordination, agent i needs to solve the problem prox f i /ρ (v) = arg min x f i (x) + ρ 2 ||x − v|| 2 , i.e., to implement a proximal operator [35,36], while the coordinator has to implement a proximal operator and a linear update. The broadcast variable b k guides the coordination and measures the gap betweenx k and z k plus the scaled Lagrange multipliersν k . After convergencex K =z K , and the equality b K =ν K is fulfilled, values that can be interpreted as clearing prices of an exchange market [33]. Thus, the coordination determines the optimal power consumption and the clearing prices. This protocol is a power profile-based, with the profiles x k i communicated (negotiated) by the agents via the coordinator, and it differs largely from existing methods. In event-based DR methods (e.g., direct load control) the appliances' control variables (device starting time, A/C set point, etc.) are managed by an aggregator, while in the case of price-based DR, the control is done through price-signals.

Illustrative Example
We illustrate the basic coordination approach in a day-ahead planning scenario, where N agents, each consisting of a single appliance balance their power consumption. In this setting, x i ∈ R T corresponds to the power consumption profile of agent i, with T = 144 the number of time slots (10-min per time slot; for a total duration of 24 h), and x i,t the power used by agent i at time slot t. The results are presented for coordinated energy management and compared with a Time-of-Use (TOU) price-based DR.

Coordinated Energy Management
We assume the community seeks to flatten the aggregated power profile v = ∑ i x i , with shared cost given by g(v) = β||v|| 2 2 , with β = 2 × 10 −6 (note that other cost functions are possible: to match a predefined consumption profile, to minimize peak consumption, etc. [4,5]). For the agents, we consider a simplified model to illustrate the benefits of the coordination (see [5] for a generative probabilistic model of agents/appliances that can be built using machine learning methods). The dissatisfaction of agent i for selecting a profile x i is measured by: where t 0 i is agent's i preferred power usage starting time, σ i a measure of agent's i starting time flexibility (large σ i implies larger flexibility), and {ψ i (t i )} t i ∈U i the set of allowed profiles. In the experiments, the agents have a preferred starting time t 0 i uniformly distributed in [50, 75]. Second, each agent can have a load that can only be shifted, with profiles of the form and T d = 18 the consumption duration, t i the starting time (control variable), and t r i the remaining time.

Price-Based Demand Response
We implement a simple price-based demand response in a framework similar to coordinated energy management. We note that most price-based demand response programs can be formulated as a two-step process (see Figures 1a and 4a). First, an aggregator determines the price signal using an approximated model of the aggregated demand. Second, each user independently realizes its power usage taking into account the received price signal, but without communicating again with the aggregator nor with other users. This two-step process can be formalized as the following optimization problem:ȳ The functiong(Nȳ, p) is minimized by the aggregator and depends on the energy price p that the agents pay, and the average power profileȳ ∈ R T . We can think of p as price vector of the same dimension T asȳ. The functionf i (x i , p), minimized by agent i, measures the cost of agent i for selecting a profile x i given the energy price p. Given that we do not have a model ofg, we evaluate the response of users to various price signals p (instead of estimating the optimal price, which by itself is a difficult problem). The cost of agent i is given byf and p ∈ R T a price vector, and agent i independently solves its optimization problem (second equation in Problem (P2)).

Results and Discussion
We consider the case of N = 40 agents, with σ i = 3 for all agents, and analyze the obtained aggregated profiles. In Figure 5a, we can observe the profiles obtained for demand response with a price signal of the form p(α) = (1, . . . , 1, α, . . . , α, 1, . . . , 1), for α ∈ {1, 1.2, . . . , 2.2}, while in Figure 5b we can observe the power profiles obtained by the coordinated energy management during the iterations of a single negotiation process. The best case of price-based DR obtained a peak consumption about 6 kW (for α = 1.6), while coordination obtains a peak consumption of about 3 kW after 100 iterations (we use a value ρ = 0.1 × 10 −6 to control the convergence speed of the iterative algorithm). Also, price-based DR generates an aggregated profile that is always in the range [50,96], while in the case of coordination the load is spread over the range [40,110]. Hence, in this example, coordinated energy management performs a better control, almost halving the maximum peak and flattening the profile over a wider range. Time t (10min x 144) Note that the best case of price-based DR has a peak consumption of 6 kW, while for coordination the peak consumption is 3 kW.
We note that we have used a very simple price-based DR with a flat critical peak price being applied for a continuous period of time (a critical peak price (CPP)). Using price signals that are not flat can improve the results for DR [6], but the coordination still obtains better results. Thus, DR requires finding an appropriated price signal or using additional mechanisms (see also the discussion variants of the basic price-based DR in Section 2.2.1). This illustrates that determining the optimal price signal is one of the main difficulties of price-based DR, because it requires having an accurate model of the agent's response to price signals. On the other hand, coordinated energy management does not use a price-based control, and therefore does not requires a model of the agent's response to price signals, but instead the agents use a power-profile based coordination to determine their power consumption.

Augmented Prosumer Management Model
As discussed, we need an energy management system that considers each user as a potential prosumer, and not just as a consumer, and for this we need a prosumer management model. To model a prosumer, we assume she has controlled and uncontrolled appliances, possibly having storage capacity (e.g., a battery), and (un)controlled generation (e.g., PV), as shown in Figure 6. Such prosumer can share part of her controlled and uncontrolled power resources if part of a community. In this context, a prosumer agent (we will the term agent to refer to the energy management system used by the prosumer) has two primary goals: (i) To plan off-line (in advance) the intended power consumption. (ii) To achieve in real-time the intended power consumption. A third goal, not considered it in the current paper, consists of updating the power consumption plan. The off-line and real-time management goals are intrinsic to most energy markets: there are costs due to the intended power consumption and due to deviations from the intended consumption. At the retailer/utility level, these costs are managed in separate programs and for a group of users (e.g., TOU and CPP for day-ahead and real-time managements), but they should be managed at the prosumer level in an integrated manner.
Due to the nature of human living activities and to external conditions (e.g., weather), occasionally, an agent will not be able to achieve its intended power consumption. But, if the prosumer belongs to a community, the agents in the community can help each other by compensating (counterbalancing) each other's deviations. In the following we present an augmented model for such prosumer.

Augmented Prosumer Model
We consider three aspects to model the power consumption (and generation) of a prosumer agent: (i) controlled/uncontrolled; (ii) off-line/real-time; and (iii) shared/private resources. Based on these three aspects, we decompose the power consumption in 8 components, as presented in Figure 7. The top/bottom of the figure indicates off-line /real-time consumption. The left-/right side indicates controllable/uncontrollable resources. Shared/private resources are shown in the outer/inner parts of the diagram. Note that here off-line refers to an energy management that is done in advance: week-ahead, day-ahead, hour-ahead, etc. Figure 7. Augmented prosumer model. The power consumption is decomposed based on three aspects: controlled/uncontrolled, off-line/real-time, and shared/private resources, giving a total of eight components. In total, three components are shared (shown in red boxes/arrows) and can be jointly managed with the community: the intended power consumption x i , the deviation δ i ∼ F σ i , and the compensation ω i ∈ S κ i . See main text for details.

Power Consumption Decomposition
The power consumption of agent i is decomposed in controlled and uncontrolled components. (i) The controlled component is given by x c,+ i + ω + i ∈ R T , and it is further decomposed in off-line controllable power x c,+ i = x c i +x c i , and real-time controllable power ω + i (flexibility); (ii) The uncontrolled component is given by x u,+ i + δ + i ∈ R T , and it is further decomposed in off-line uncontrolled power x u,+ i = x u i +x u i , and real-time uncontrolled power δ + i (fluctuation). The private off-line components add to zero (x c i +x u i = 0), and they are not considered in the following. The private real-time components (controlled and uncontrolled) add to zero (ω i +δ i = 0), and we will use this relation to manage part of the fluctuation.
The real-time controllable power is decomposed as ω + i = ω i +ω i with ω + i ∈ S + i , where the set S + i represents the degree of control of ω + i , and where ω i ∈ S κ i is the shared real-time controllable power (the compensation) andω i ∈Ŝ κ i is the private real-time controllable power. The relation between the sets is given by S + i = S κ i ⊕Ŝ κ i , with ⊕ the Minkowski sum, and where call S κ i the capacity (set). We recall that the Minkowski sum of the sets S i and S j is given by S i ⊕ S j = {a + b |a ∈ S i , b ∈ S j }, and it is also known as the sumset.
The real-time uncontrolled power is decomposed as where the function F + i represents the degree of fluctuation of δ + i (we take F + i as the probability density function associated to δ + i or as an indicator function of the values δ + i can take) , and where δ i ∼ F σ i is the shared real-time uncontrollable power (the deviation) andδ i ∼F σ i is the real-time uncontrollable power. We call F σ i the tolerance (set). The relation between these functions is given by

Shared Power Resources
Agent i can share three resources: its intended consumption, its deviation and its compensation (see Figure 7). While the intended consumption is managed off-line, the deviation and compensation are managed in real-time. However, an off-line management should consider what deviations may be observed in real-time, and what is the available compensation ability. For this the tolerance and capacity are also shared. The shared resources are: • Intended consumption. It is given by , with x c i the shared scheduled power and x u i the shared forecast power (x u i may include expected PV generation, A/C consumption, etc.). • Compensation and capacity. The compensation is given by ω i ∈ S κ i and represents the shared real-time controllable power. The set S κ i represents the capacity to control power consumption in real-time. We use the term capacity to refer to the maximum ability to control the power consumption. Examples include controlling a battery, a lighting (by changing the illumination level), and an A/C (by changing the temperature set-point) . Thus, agent i plans the set S κ i off-line and controls ω i ∈ S κ i in real-time. • Deviation and tolerance. The deviation δ i ∼ F σ i can be derived fromδ + i = δ i +δ i andω i = −δ i , obtaining: δ i =δ + i −ω i . Thus, the amount of shared deviation δ i is depends on the fluctuation and it is managed using the private real-time controllable powerω i . The function F σ i represents the tolerance for the deviation δ i and it can be modeled using a probability density function or an indicator function of the values that δ i may take (we give an example of this later).
An agent that acts independently (not in a community) minimizes its deviations (δ i ≈ 0) and does not provide compensation (ω i = 0). However, such agent cannot eliminate all deviations unless it has a large ability to control its power consumption. On the contrary, if the agent is part of a community, it can receive help from others to minimize its deviation, and it can help others to compensate their deviations. Thus, an agent can manage its intended consumption x i , compensation ω i , capacity S κ i , deviation δ i , and tolerance F σ i , for its own benefit, while also receiving help from the community and contributing to it.

Augmented Device Model
A prosumer agent consists of one or more devices (appliances, storage, generation, etc.), so we need to integrate these devices in the prosumer model. To do this, we first make an augmented model for each device. Once we have the power decomposition model for each device p = 1, . . . , P: p i , and tolerance (shared and private) Thus, the capacity and tolerance sets are aggregated using the Minkowski sum or the convolution operator. This is illustrated in Figure 8 for the shared components. To build each device's model we require knowledge about the device: for controllable devices we need a control model and/or sensed data, and for uncontrolled devices we can use historical sensed data. The parameters of such models can be learned using machine learning or statistical learning methods.

Augmented Coordinated Energy Management in Prosumer Communities
We assume a community of N = |N | agents, where agent i ∈ N has the ability to manage its power consumption using the augmented model presented in the previous section. The question is how to use this model to manage the intended power consumption, the deviation and the compensation at the community level. This is done with the help of a coordinator, as illustrated in Figure 9. Each agent coordinates, off-line, the intended power consumption x i ∈ R T , the capacity (set) S κ i , and the tolerance F σ i , while the deviation δ i ∼ F σ i and the compensation ω i ∈ S κ i are managed in real-time. During the real-time management, the community minimizes the deviation ∆ = ∑ i δ i using the community compensation Ω = ∑ i ω i such that the deviation is compensated

Demand--side management
In the off-line management the community manages its intended consumption x = ∑ i x i , its capacity Ψ κ and tolerance Σ σ , with its capacity given by Ψ κ = S κ 1 ⊕ . . . ⊕ S κ N , and its tolerance given by Σ σ = F σ 1 * . . . * F σ N . To achieve the real-time compensation of deviation (Ω + ∆ ≈ 0), the community needs enough capacity to compensate the deviations (supp(Σ σ ) ⊂ Ψ κ ), which could be ensured off-line.

Augmented Day-Ahead Coordination
In the off-line management, the community coordinates its intended consumption x = ∑ i x i , capacity Σ σ and tolerance Ψ κ .
To do this, we parametrize the capacity and tolerance of each agent i as S κ Furthermore, we only allow a symmetric capacity set S κ i (κ i ) and a symmetric tolerance F σ i (σ i ) (private sets/functions do not need to be symmetric).
i . Then, we can write the community capacity as Ψ(κ) = S κ 1 ⊕ . . . ⊕ S κ N with κ = ∑ i κ i , and the community tolerance as Σ(σ) = F σ 1 * . . . * F σ N with σ = ∑ i σ i . Then, we can formulate the augmented day-ahead coordination as a sharing problem (similar to Problem (P1)): is the cost of the agent i ∈ N , with x i , σ i , κ i ∈ R T + the decision variables of agent i, and g(x, σ, κ) is the cost shared among all agents i ∈ N . This optimization problem can be solved using the ADMM-based algorithm in Equation (1) and the distributed implementation in Figure 4b by simply concatenating the profiles x i , σ i , κ i , and defining the concatenated broadcast signal.

Agent cost
The cost function of agent i, with u i ∈ U i the device control variable, is formulated as: The first three components of Equation (4) depend on the control signal u i : • f u i (u i ) can measure loss in QoL associated to the device operation mode (due to control signal u i ), • f x|u i (x i , u i ) can represent soft-constraints (e.g. encode achievable profiles x i due to control u i ), can measure the agent's ability to control deviation, where the control variable u i may include appliance mode control, battery charge/discharge control, generation control, etc. The last three components in Equation (4) can be associated to: : penalty of deviating from the power profile plan, and • f κ i (κ i ): benefit of reserving capacity for the community.

Community cost
Given x = ∑ i∈N x i , σ = ∑ i∈N σ i and κ = ∑ i∈N κ i (the community's aggregated power, deviation and capacity, respectively), the shared cost function for a community is defined as: where the components of g can measure: • g x (x): the cost associated to the intended community aggregated power consumption x, and • g σ,κ (σ, κ): the degree of capacity relative to tolerance, where ideally, the community capacity should be able manage any tolerance: i.e. supp (Σ(σ)) ⊂ supp (Ω(κ)).

Augmented Real-Time Coordination
We outline a possible protocol for the real-time coordination: every time an agent i cannot follow its indented consumption profile (δ i,t = 0), it sends a request to the coordinator indicating its corresponding deviation δ i,t . Once the coordinator has received agent's i deviation, as well as other agent's deviations, the community compensates the aggregated community deviation. The compensation applied by each agent j to compensate the deviation ∑ i δ i,t is determined by the coordinator. A simple compensation management consists of a proportional control: i.e., using reserved capacity the deviation can be compensated. The details of such control are out-of-scope of the present article.

Simulation Results
We consider two scenarios. The first scenario seeks to illustrate the augmented agent model and the augmented day-ahead coordination. The second scenario seeks to validate the augmented coordination using actual power consumption data. In both scenarios batteries provide off-line and real-time control.

Augmented Agent and Coordination Example (Scenario 1)
We consider an scenario where a community of N = 40 prosumer agents coordinate their power usage, with each agent having three devices: an appliance a that can be scheduled, a battery b that can be controlled, and uncontrolled PV g. This augmented agent model is based on the agent in Section 2.3, but we have added a battery and PV generation. This scenario illustrates how the augmented agent model is built and provides example results for the off-line (day-ahead) coordination.

Appliance
We consider a controllable appliance a, with a power profile x a i = ψ i (τ i ), where τ i ∈ Θ i is the control variable representing the starting time (it is the same model used in Section 3.2; see Equation (3), etc.). We assume that once the appliance a has been scheduled, its power consumption x a i does not change. Thus, this device does not contribute deviation nor compensation:

Battery
We assume a battery b with storage capacity C i = 700 Wh, maximum charge/discharge rate y max i = ±100W, and an initial/end charge C 0 i = C T i = C i /2. The battery provides control ability for flattening the prosumer's off-line plan, private real-time control, and compensation. The battery power consumption is y the duration of a time slot in hours (for T = 144) and: We allow the SOC to be in the range [C min , and we can write: parametrized by κ i and Equation (7), we then write : with the equations implicitly defining i represents the battery private "capacity" set. Note that in this formulation we have enforced that the capacity at one time-slot does not affect the capacity at a different time slot.

PV Generation
We consider a simple PV model. We assume the weather forecast says it will be cloudy, but it might be sunny at times. The PV output (cloudy case) will bex in δ + i ∈ [0,σ i ] (we assume there is no likelihood information of PV generation, but we know the upper and lower bound at each time). We recall that F g,+ i = F σ i * F i , and δ g i = δ σ i +δ i , where we can define: Note that if the probability density function were available for the PV (or some appliances), alternative definitions for the tolerance F g i could be given, e.g.,: for a uniform distribution, etc. By parametrizing F i andF i using σ i andσ i respectively, we can rewrite the (day-ahead) PV model:  Figure 11. Augmented day-ahead coordination results. (a) Intended consumption, appliance + generation, and battery (dis)charge. The coordination obtains an intended consumption with a peak below 10 kW (DR obtains a peak in the range [20,36] kW; see Figure 10); (b) The capacity is always larger than the tolerance, and complements the state-of-charge (SOC). The capacity and tolerance are shown in Wh (by multiplying them by ∆d.)

Device Model Aggregation
We aggregate the device models using the derived equalities, inequalities and parametrization above, instead of explicitly using the capacity and tolerance sets. We first recall that the intended consumption is given by x i = x a i + x b i + x g i thus we can write it as: where τ i ∈ Θ i ,x g i is fixed, and x b i is related to the shared capacity and tolerance. As for the tolerance, from the equalityδ i =ω i , we can setσ i =κ i . We also have that σ i = σ g i and κ i =κ b i . Then, by setting the private capacity to manage any private deviations in Equation (10), we can write: Then, combining Equations (12) and (8) we get the set of inequalities that define the relation between the tolerance, capacity, and intended battery charge/discharge of the agent: and a charge rate constraint that only considers the consumption x b i . The capacity and tolerance are given by S κ (13) is not necessarily symmetric, but it is considered symmetric when shared.

Cost Functions
Agent cost. The cost function of agent i is defined as: with τ i (appliance starting time), and y i (the battery dis/charge plan) the agent's internal control variables. For clarity we have changed notation, and used y i for the battery intended consumption, i.e., as in Section 2.4, measures the loss in deviating from the preferred starting time for an appliance whose control is defined by its start time τ i . We assume that the appliance is scheduled and that it does not provide control ability during the day.
Using the constraint in Equation (11) we relate control variables to the intended power consumption x i : with ψ i (τ i ) the appliance power usage, y i the battery intended power usage, andx g i ∈ R T the forecast PV generation.
Community Cost. We use a the community cost as in Equation (5): with C κ a minimum gap between deviation and capacity.
Using the defined cost functions, the day-ahead community coordination is formulated as in Problem (P3), and solved using the ADMM algorithm in Equation (1) and the distributed implementation in Figure 4b.
The implementation details for solving the optimization problems above are not included for clarity. In a nutshell, the equations are solved at the device-agent-community level using a hierarchical architecture (similar to the one used in [4] for inter-community coordinator). The optimization problems at the agent and at coordinator include solving a quadratic programing problem.

Experimental Results
For comparison purposes, in addition to the augmented day-ahead coordination, we also include the results of price-based DR. The device models and parameters used for coordinated energy management and for price-based DR are identical. For price-based DR, we use the price-based control model described in Section 2.4, but here each user has a battery that is used to flatten the intended power consumption, as well as to eliminate fluctuations in real-time. Given that in DR the agents are not part of a community, they do not need to share capacity nor to help each other to compensate deviations. However, each agent needs to manage its possible deviations by itself.
When comparing the results (below) to the ones in Section 2.4, one should have in mind the three additions in the current setup: (i) The augmented day-ahead management considers that a real-time management will take place; (ii) PV generation is added and a battery is managed; (iii) The battery is managed for flattening the intended power consumption and for real-time compensation of deviation. These apply to DR and coordination. The results of the simulations are presented in Figures 10 and 11. Figure 10b. Price-based DR with batteries can reduce the consumption peak, with the consumption peak being about (20 kW) in the best case. Note that this is similar to the result of the non-augmented coordination without batteries in Section 2.4; see Figure 5b. Figure 11a. The coordinated intended power consumption is presented (each agent manages appliances, battery dis/charge and generation). We can see that the coordination helps further reducing the largest consumption peak due to the appliances. The coordination obtains a flattened profile for the community intended consumption (∑ i x i ), with a small consumption peak (10 kW). This peak is half the one obtained by DR with batteries (see previous point; Figure 10b). Figure 11b. The obtained tolerance and capacity are coordinated, with the tolerance being lower that the capacity at all times. This shows that the augmented coordination does not only manage the power consumption (flattening the consumption and reducing the maximum peak in this example), but it also manages the aggregated capacity (the community real-time control ability) and tolerance. Figure 11b. This figure also shows the trade-off between the battery charge-discharge and the capacity. We can observe that the state-of-charge is large until the time slot t = 45, where the batteries start to discharge to help reducing the large consumption peak (see Figure 11a). Note that the state-of-charge is complementary to the capacity, meaning e.g., that when the battery is almost full, the capacity is small, while when the state-of-charge is half the capacity, the capacity achieves its maximum.
In summary, the augmented day-ahead coordination plans the intended power consumption, obtaining a flattened the power profile, while coordinating capacity and tolerance for a real-time management.

Augmented Coordination Validation (Scenario 2)
We apply the augmented coordinated energy management in a second scenario consisting of a community of prosumers having uncontrolled consumption and distributed batteries. The goal is to validate the proposed methodology using actual power consumption data. We use a prosumer agent model similar to the one used in the previous section, but now the agent does not have PV generation and it cannot schedule appliances. On the other hand, each agent has appliance power consumption that is not controlled and fluctuates freely. As before each agent has a controllable battery.
In this scenario we use historical power consumption data (i) to build the augmented prosumer model used in the off-line coordination; and (ii) to validate the obtained coordination results using consumption data from the same households. The historical data for each household is split in a training data (to build the augmented model) and a test data (for validation). In this way we can evaluate how does the obtained off-line coordination would behave in the real-time coordination. More specifically, we study whether the community could compensate the actual deviation in real-time.
We follow the augmented formulation presented in Section 4.2. Each agent i has an uncontrolled consumption, for which historical consumption data is available, and a controllable battery of capacity C i = q i 700 Wh. The parameter q i defines the battery capacity of agent i (we use various battery sizes, parametrized by q i ). As before, the battery provides ability to control the power consumption: to flatten the intended power consumption, to manage deviations, and to manage compensation ability.
The cost function of agent i is defined as (it does not consider a scheduled appliance): with y i the battery dis/charge plan of the agent (i.e., the agent's internal control variable). As before, for clarity we write y i for the battery intended consumption (y i = x b i ). The intended power consumption x i depends on the forecast appliance power consumption (x a i ∈ R T ) and on the battery power usage (y i ): For the battery cost function f σ,κ|y i (σ i , κ i , y i ) we use the same model as in Equation (16), and for the community cost function we use the same cost as Equation (17): g(x, σ, κ) = g x (x) + g σ,κ (σ, κ), with g x (x) = β 3 ||x|| 2 and g σ,κ (σ, κ) = Π[∆dσ t < ∆dκ t − C κ ∀t], with C κ = 50[Wh].
Historical operation power consumption data was used to build the agent model and to validate the community coordination. This sensed data corresponds to consumption data for N = 37 households collected in 2003 at various locations across Japan (residential consumption data from the energy consumption DB available at http://tkkankyo.eng.niigata-u.ac.jp/HP/HP/ database/japan2/index.htm on 2016/06/04). The original data was available at 1 min resolution, but it was averaged for the used time-slot duration (we use a 10 min time-slot for day-ahead (T = 144 time-slots, for a total of 24 h) and 1 h time-slots for week-ahead coordination (T = 120, 5 days)). The consumption model of agent i used during the coordination is defined by three parameters: the consumption range [σ min (16), and the forecast power consumptionx a i in Equation (19). We simply estimatedx a i as the mid-value of the consumption rangex a i = σ min ] was obtained for each agent using historical operational data (of that agent) as follows. For each time t, we first estimated the minimum and maximum power consumption for a period including 1 h before and after time t considering data for the same weekday at the same month. Once these maximum and minimum bounds were estimated, we took 1.2 times the minimum and 0.8 times of maximum as the upper and lower fluctuation bounds, respectively. Examples of these values can be observed in Figure 12. We note that the actual consumption is outside these bounds not more than a handful of times a day for a few agents (e.g., agent 1 at times t = 10, t = 120, and t = 140, and agent 6 at time t = 40, t = 120 and t = 130), which can be considered as the user deviating from its common living pattern from time to time. The battery capacity of agent i is given by C i = q i 700, and we consider three cases for the community's distribution of battery capacities: q i ∈ {0.1, 0.2, . . . , 0.5} (tiny), q i ∈ {1} (small), and q i ∈ {1, 2, . . . , 5} (mid-size). In each case the community average battery size wasC = 0.3 × 700 (tiny),C = 700 (small),C = 3 × 700 (middle). In addition to presenting results for various battery sizes, we also consider two off-line cases: day-ahead coordination and week-ahead coordination.

Results
Day-Ahead Augmented Coordination Figure 13 summarizes the results for the augmented day-ahead coordination. In the figure, each row corresponds to different battery sizes (from top to bottom: tiny, small, mid size), and the columns show: (Left) tolerance, deviation, capacity and compensation; (Center) intended consumption and actual consumption, and (Right) imbalance. The imbalance for each time-slot t is measured by: , with χ i,t the actual power consumption of agent i at time t. From Figure 13 we observe that: • When a tiny battery size per agent (C = 0.3 × 700 Wh) is considered, the community does not have enough capacity to compensate all deviations Figure 13a, cannot flatten the intended power profile Figure 13b, and generates some imbalance Figure 13c. • When a small battery size (C = 700 Wh) is considered (second row), the community has more capacity to compensate deviations Figure 13d, flattens the intended power profile Figure 13e, and eliminates almost all imbalance Figure 13f. • When a mid battery size (C = 3 × 700 Wh) is considered, the community has a large capacity Figure 13g, furthers flattens the intended power consumption profile Figure 13h and generates no imbalance Figure 13i.
Week-Ahead Augmented Coordination In summary, these results indicate that a community of agents coordinating their control ability, here given by distributed batteries, could eliminate imbalance and flatten the intended power consumption when a mid size-battery capacity (C = 3 × 700 Wh) is installed at each household. Even when the agents use a small battery (C = 700 Wh), the community could eliminate almost all imbalance, while slightly flattening the power consumption profile, thanks to the coordination of intended power consumption, capacity and tolerance. Note that the used community cost function gives more priority to having enough capacity when required over flattening the power consumption (in Equation (17) a hard constraint was used for the tolerance and capacity). Thus, if required, more importance can be given to flattening the intended power consumption by using a soft-constraint on the tolerance and capacity.   (g)C = 3 × 700 Wh; (h)C = 3 × 700 Wh; (i)C = 3 × 700 Wh.

Conclusions
We have presented an augmented model for coordinated energy management for prosumer communities that allows users in a community to jointly manage their power consumption and generation. The proposed energy management implements a "demand management from the demand-side" approach where each user is a potential producer and consumer (i.e., a prosumer) that manages its Quality of Life, and where all agents receive help from the community and contribute to it.
The proposed augmented coordination scheme uses a control strategy that implements a feedback in the control, giving the community a large ability to manage the its power resources, and furthermore it considers off-line and real-time ability to manage a power under controlled and uncontrolled devices. This is done using an augmented agent management model that is integrated in a community coordination protocol. This augmented model manages, in its off-line stage, each agent's intended power consumption, (compensation) capacity and (deviation) tolerance such that in real-time the agent and community has control ability to minimize deviations in real-time.
We presented results to in two scenarios where we illustrate the augmented model and its use in the community coordination. In the first case we observed that the proposed approach presented good control capabilities, allowing to flatten the power consumption while reserving control ability for a real-time management. In this scenario we observed that the augmented coordination has a better control ability than a simple price-based demand response program. In the second case we use actual consumption data to validate that the off-line management reserves enough control resources for the real-time management. In this results we observed that the community obtained a flattened intended power consumption, while coordinating capacity and tolerance for a real-time coordinated management, even when small size batteries are installed by the prosumers, thus successfully coordinating the ability to control the power consumption under uncontrolled consumption.
We believe that the proposed augmented coordinated energy management is a compelling solution for enhancing the power system, for implementing a prosumer society where the users can help each other, and for enabling the further introduction of distributed renewables, all this by putting the focus on the demand-side (namely on the user) instead of on the grid or the generation-side. As future work we are interested in (i) studying how the community can implement the real-time management, in particular taking into account distributed uncontrollable generation; (ii) analyzing user incentive and fairness issues, as well as allowing each prosumer to select his/her preferred energy type and energy source; and (iii) testing the proposed approach in a real-world system.